Diligent::SamplerDesc struct

Sampler description.

This structure describes the sampler state which is used in a call to IRenderDevice::CreateSampler() to create a sampler object.

To create an anisotropic filter, all three filters must either be Diligent::FILTER_TYPE_ANISOTROPIC or Diligent::FILTER_TYPE_COMPARISON_ANISOTROPIC.

MipFilter cannot be comparison filter except for Diligent::FILTER_TYPE_ANISOTROPIC if all three filters have that value.

Both MinFilter and MagFilter must either be regular filters or comparison filters. Mixing comparison and regular filters is an error.

Base classes

struct DeviceObjectAttribs
Describes common device object attributes.

Public functions

auto operator==(const SamplerDesc& RHS) const -> bool
Tests if two structures are equivalent.

Public variables

FILTER_TYPE MinFilter
Texture minification filter, see Diligent::FILTER_TYPE for details. Default value: Diligent::FILTER_TYPE_LINEAR.
FILTER_TYPE MagFilter
Texture magnification filter, see Diligent::FILTER_TYPE for details. Default value: Diligent::FILTER_TYPE_LINEAR.
FILTER_TYPE MipFilter
Mip filter, see Diligent::FILTER_TYPE for details. Only FILTER_TYPE_POINT, FILTER_TYPE_LINEAR, FILTER_TYPE_ANISOTROPIC, and FILTER_TYPE_COMPARISON_ANISOTROPIC are allowed. Default value: Diligent::FILTER_TYPE_LINEAR.
TEXTURE_ADDRESS_MODE AddressU
Texture address mode for U coordinate, see Diligent::TEXTURE_ADDRESS_MODE for details Default value: Diligent::TEXTURE_ADDRESS_CLAMP.
TEXTURE_ADDRESS_MODE AddressV
Texture address mode for V coordinate, see Diligent::TEXTURE_ADDRESS_MODE for details Default value: Diligent::TEXTURE_ADDRESS_CLAMP.
TEXTURE_ADDRESS_MODE AddressW
Texture address mode for W coordinate, see Diligent::TEXTURE_ADDRESS_MODE for details Default value: Diligent::TEXTURE_ADDRESS_CLAMP.
Float32 MipLODBias
Offset from the calculated mipmap level. For example, if a sampler calculates that a texture should be sampled at mipmap level 1.2 and MipLODBias is 2.3, then the texture will be sampled at mipmap level 3.5. Default value: 0.
Uint32 MaxAnisotropy
Maximum anisotropy level for the anisotropic filter. Default value: 0.
COMPARISON_FUNCTION ComparisonFunc
A function that compares sampled data against existing sampled data when comparsion filter is used. Default value: Diligent::COMPARISON_FUNC_NEVER.
Float32 BorderColor
Border color to use if TEXTURE_ADDRESS_BORDER is specified for AddressU, AddressV, or AddressW. Default value: {0,0,0,0}.
float MinLOD
Specifies the minimum value that LOD is clamped to before accessing the texture MIP levels. Must be less than or equal to MaxLOD. Default value: 0.
float MaxLOD
Specifies the maximum value that LOD is clamped to before accessing the texture MIP levels. Must be greater than or equal to MinLOD. Default value: +FLT_MAX.

Function documentation

bool Diligent::SamplerDesc::operator==(const SamplerDesc& RHS) const

Tests if two structures are equivalent.

Parameters
RHS in - reference to the structure to perform comparison with
Returns
  • True if all members of the two structures are equal.
  • False otherwise. The operator ignores DeviceObjectAttribs::Name field as it does not affect the sampler state.