Click or drag to resize
Ab4d.SharpEngine logo

GpuSamplerManager Class

GpuSamplerManager can be used to get the common textures samplers or create a custom sampler. Sampler defines how the texture bitmap is read by the GPU. The default sampler in SharpEngine is MirrorSampler.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.CoreComponentBase
    Ab4d.SharpEngine.CoreGpuDeviceComponent
      Ab4d.SharpEngine.UtilitiesGpuSamplerManager

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public class GpuSamplerManager : GpuDeviceComponent

The GpuSamplerManager type exposes the following members.

Properties
 NameDescription
Public propertyMirrorSampler The default Mirror sampler
Top
Methods
 NameDescription
Public methodStatic memberCreate Creates the GpuSamplerManager.
Public methodCreateSampler 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).
Protected methodDispose Releases unmanaged and managed resources (when disposing is true). This method may be called only from the CheckAndDispose(Boolean) method and must not be called manually by the user.
(Overrides ComponentBaseDispose(Boolean))
Public methodGetSampler(CommonSamplerTypes) Returns a VulkanSampler for the specified samplerType (used mips count is clamped by Vulkan to the value defined by texture size). The samples uses linear anisotropic filtering. To create a custom sampler use CreateSampler(Int32, SamplerAddressMode, Filter, SamplerMipmapMode, Single, BorderColor, String) method. The returned sample is owned by this VulkanSamplerFactory and is disposed when this object is disposed.
Public methodGetSampler(CommonSamplerTypes, Int32) Returns a VulkanSampler for the specified samplerType and the specified mipsCount. If you want to use mips count that is defined by the size of the texture, then set mipsCount to MaxMipsCount or use GetSampler(CommonSamplerTypes) method that does not require mips count parameter. This will require less samples to be created. The samples uses linear anisotropic filtering. To create a custom sampler use CreateSampler(Int32, SamplerAddressMode, Filter, SamplerMipmapMode, Single, BorderColor, String) method. The returned sample is owned by this VulkanSamplerFactory and is disposed when this object is disposed.
Top
Fields
 NameDescription
Public fieldStatic memberMaxMipsCount Maximum number of mips count (when using the maximum size of the texture). When creating a sampler you can use this mips count and Vulkan will use the mips that is defined from the size of the texture.
Top
See Also