D3D11X_SAMPLER_STATE_DESC Structure

Describes the state of a sampler.

Syntax

typedef struct D3D11X_SAMPLER_STATE_DESC {
    UINT Flags;
    D3D11X_TEX_XY_FILTER FilterMag;
    D3D11X_TEX_XY_FILTER FilterMin;
    D3D11X_TEX_MIP_FILTER FilterMip;
    D3D11X_TEX_Z_FILTER FilterZ;
    D3D11X_TEX_FILTER_MODE FilterMode;
    D3D11_TEXTURE_ADDRESS_MODE AddressU;
    D3D11_TEXTURE_ADDRESS_MODE AddressV;
    D3D11_TEXTURE_ADDRESS_MODE AddressW;
    FLOAT MinLOD;
    FLOAT MaxLOD;
    FLOAT MipLODBias;
    FLOAT MipLODBiasSecondary;
    UINT MaxAnisotropy;
    FLOAT AnisotropyBias;
    UINT AnisotropyThreshold;
    D3D11_COMPARISON_FUNC ComparisonFunc;
    D3D11X_TEX_BORDER_COLOR BorderColorType;
    UINT BorderColorIndex;
    UINT PerformanceMip;
    UINT PerformanceZ;
} D3D11X_SAMPLER_STATE_DESC;  

Members

Flags
Flags to control the sampler state description, as a D3D11X_SAMPLER_STATE_FLAGS enumeration.

FilterMag
A texture XY filter option for magnification, such as point sampling, bilinear interpolation, anisotropic interpolation, or bilinear anisotropic interpolation, as a D3D11X_TEX_XY_FILTER enumeration constant.

FilterMin
A texture XY filter option for minification, such as point sampling, bilinear interpolation, anisotropic interpolation, or bilinear anisotropic interpolation, as a D3D11X_TEX_XY_FILTER enumeration constant.

FilterMip
A texture filter option for mip-level sampling, such as no sampling, point sampling, or linear interpolation, as a D3D11X_TEX_MIP_FILTER enumeration constant.

FilterZ
A texture Z filter option, such as no sampling or interpolation, point sampling, or linear interpolation, as a D3D11X_TEX_Z_FILTER enumeration constant.

FilterMode
A filter mode (such as …LERP, MIN, or MAX), as a D3D11X_TEX_FILTER_MODE enumeration constant.

AddressU
Address mode for U. Specifies which technique to use for resolving texture coordinates that are outside of the boundaries of a texture. D3D11_TEXTURE_ADDRESS_MODE

AddressV
Address mode for V. D3D11_TEXTURE_ADDRESS_MODE

AddressW
Address mode for W. D3D11_TEXTURE_ADDRESS_MODE

MinLOD
The 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
The 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.

MipLODBias
The 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.

MipLODBiasSecondary
The secondary offset from the calculated mipmap level.

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

AnisotropyBias
To reduce the computed anisotropy, this u1.5 field is subtracted from the computed aniso ratio. The subtract occurs in log space, so 1.0 would halve the aniso ratio and the number of samples taken. The larger the value, the more quality is sacrificed for performance. Anisobias can be scaled down on a per-resource basis by the resource PERF_MOD field. The final_aniso_degree = 2^(aniso_degree_exp – AnisotropicBias). The maximum reduction with this bias is almost 4.

AnisotropyThreshold
Adjusts performance-versus-quality tradeoffs in the texture sampling hardware, regarding anisotropic filtering. Increased values lead to higher performance and lower sampling quality.

ComparisonFunc
A comparison option (as a D3D11_COMPARISON_FUNC enumeration constant) that determines whether how the runtime compares source (new) data against destination (existing) data before storing the new data. The comparison option is declared in a description before an object is created. Sets a comparison option for a sampler state.

BorderColorType
The border color, such as translucent black, opaque black, or opaque white, as a D3D11X_TEX_BORDER_COLOR enumeration constant.

BorderColorIndex
Only 12 bits of this field are used to specify the color of the border; the rest of the bits of this field store alignment information. A border color base address can be specified with GFXDEC:TA_BC_BASE_ADDR{,_HI} for gfx state contexts 1-7, or GFXUDEC:TA_CS_BC_BASE_ADDR{,_HI}, instance per micro-engine, when the state context is 0. They are 256-byte aligned, and the low and high registers provide bits [47:8] of address. The 12-bit pointer is an offset from the base in dwords.

PerformanceMip
Adjusts performance-versus-quality tradeoffs in the texture sampling hardware, regarding mip filtering. Increased values lead to higher performance and lower sampling quality.

PerformanceZ
Adjusts performance-versus-quality tradeoffs in the texture sampling hardware, regarding depth filtering. Increased values lead to higher performance and lower sampling quality.

Remarks

This structure passed into ID3D11DeviceX::ComposeSamplerState and D3D11XInitializeSamplerStateDesc.

Requirements

Header: Declared in d3d11_x.h.