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: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
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
See Also