Click or drag to resize
Ab4d.SharpEngine logo

GpuSamplerManagerCreateSampler Method

CreateSampler method creates a new instance of a custom sampler and returns the GpuSampler object and the DisposeToken that can be used to dispose the created sampler. When using linear anisotropic filtering and address mode that is defined by CommonSamplerTypes use the GetSampler(CommonSamplerTypes) method to get a commonly used shader and prevent creating a new instance of a sampler (note that number of samples in Vulkan is limited to 4000).

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.2.9386+3a404a3e1ebfa4efd231da7fe6f10dfb23b95dc4
Syntax
C#
public (GpuSampler sampler, DisposeToken disposeToken) CreateSampler(
	int textureMipsCount = 16,
	SamplerAddressMode addressMode = SamplerAddressMode.MirroredRepeat,
	Filter filter = Filter.Linear,
	SamplerMipmapMode mipmapMode = SamplerMipmapMode.Linear,
	float maxAnisotropy = 3,402823E+38f,
	BorderColor borderColor = BorderColor.FloatOpaqueWhite,
	string? name = null
)

Parameters

textureMipsCount  Int32  (Optional)
textureMipsCount (MaxMipsCount by default)
addressMode  SamplerAddressMode  (Optional)
addressMode (SamplerAddressMode.MirroredRepeat by default)
filter  Filter  (Optional)
filter (Filter.Linear by default)
mipmapMode  SamplerMipmapMode  (Optional)
mipmapMode (SamplerMipmapMode.Linear by default)
maxAnisotropy  Single  (Optional)
maxAnisotropy (float.MaxValue by default)
borderColor  BorderColor  (Optional)
borderColor (BorderColor.FloatOpaqueWhite by default)
name  String  (Optional)
optional name

Return Value

ValueTupleGpuSampler, DisposeToken
Tuple with created GpuSampler and DisposeToken that can be used to dispose the sampler when it it not used anymore
Remarks

[Missing <remarks> documentation for "M:Ab4d.SharpEngine.Utilities.GpuSamplerManager.CreateSampler(System.Int32,Ab4d.Vulkan.SamplerAddressMode,Ab4d.Vulkan.Filter,Ab4d.Vulkan.SamplerMipmapMode,System.Single,Ab4d.Vulkan.BorderColor,System.String)"]

See Also