D3D11_SAMPLER_DESC structure (d3d11.h)

Describes a sampler state.

Syntax

typedef struct D3D11_SAMPLER_DESC {
  D3D11_FILTER               Filter;
  D3D11_TEXTURE_ADDRESS_MODE AddressU;
  D3D11_TEXTURE_ADDRESS_MODE AddressV;
  D3D11_TEXTURE_ADDRESS_MODE AddressW;
  FLOAT                      MipLODBias;
  UINT                       MaxAnisotropy;
  D3D11_COMPARISON_FUNC      ComparisonFunc;
  FLOAT                      BorderColor[4];
  FLOAT                      MinLOD;
  FLOAT                      MaxLOD;
} D3D11_SAMPLER_DESC;

Members

Filter

Type: D3D11_FILTER

Filtering method to use when sampling a texture (see D3D11_FILTER).

AddressU

Type: D3D11_TEXTURE_ADDRESS_MODE

Method to use for resolving a u texture coordinate that is outside the 0 to 1 range (see D3D11_TEXTURE_ADDRESS_MODE).

AddressV

Type: D3D11_TEXTURE_ADDRESS_MODE

Method to use for resolving a v texture coordinate that is outside the 0 to 1 range.

AddressW

Type: D3D11_TEXTURE_ADDRESS_MODE

Method to use for resolving a w texture coordinate that is outside the 0 to 1 range.

MipLODBias

Type: FLOAT

Offset from the calculated mipmap level. For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5.

MaxAnisotropy

Type: UINT

Clamping value used if D3D11_FILTER_ANISOTROPIC or D3D11_FILTER_COMPARISON_ANISOTROPIC is specified in Filter. Valid values are between 1 and 16.

ComparisonFunc

Type: D3D11_COMPARISON_FUNC

A function that compares sampled data against existing sampled data. The function options are listed in D3D11_COMPARISON_FUNC.

BorderColor[4]

Type: FLOAT[4]

Border color to use if D3D11_TEXTURE_ADDRESS_BORDER is specified for AddressU, AddressV, or AddressW. Range must be between 0.0 and 1.0 inclusive.

MinLOD

Type: FLOAT

Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed.

MaxLOD

Type: FLOAT

Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. To have no upper limit on LOD set this to a large value such as D3D11_FLOAT32_MAX.

Remarks

These are the default values for sampler state.

State Default Value
Filter D3D11_FILTER_MIN_MAG_MIP_LINEAR
AddressU D3D11_TEXTURE_ADDRESS_CLAMP
AddressV D3D11_TEXTURE_ADDRESS_CLAMP
AddressW D3D11_TEXTURE_ADDRESS_CLAMP
MinLOD -3.402823466e+38F (-FLT_MAX)
MaxLOD 3.402823466e+38F (FLT_MAX)
MipMapLODBias 0.0f
MaxAnisotropy 1
ComparisonFunc D3D11_COMPARISON_NEVER
BorderColor float4(1.0f,1.0f,1.0f,1.0f)
Texture N/A

Requirements

Requirement Value
Header d3d11.h

See also

Core Structures