D3D11X_TEX_CLAMP Enumeration

Texture clamping function specified in D3D11X_SAMPLER_DESC.

Syntax

typedef enum D3D11X_TEX_CLAMP
{
    D3D11X_TEX_CLAMP_WRAP = 0,
    D3D11X_TEX_CLAMP_MIRROR = 1,
    D3D11X_TEX_CLAMP_LAST_TEXEL = 2,
    D3D11X_TEX_CLAMP_MIRROR_ONCE_LAST_TEXEL = 3,
    D3D11X_TEX_CLAMP_HALF_BORDER = 4,
    D3D11X_TEX_CLAMP_MIRROR_ONCE_HALF_BORDER = 5,
    D3D11X_TEX_CLAMP_BORDER = 6,
    D3D11X_TEX_CLAMP_MIRROR_ONCE_BORDER = 7
} D3D11X_TEX_CLAMP;  

Constants

Constant Description
D3D11X_TEX_CLAMP_WRAP Texture coordinate range restricted to [0, 1) by applying modulo of 1.0; see the D3D11_TEXTURE_ADDRESS_WRAP member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_MIRROR Texture coordinate fractions in odd integer ranges are flipped; see the D3D11_TEXTURE_ADDRESS_MIRROR member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_LAST_TEXEL Texture coordinates outside the range [0, 1) clamped to edge texel; see the D3D11_TEXTURE_ADDRESS_CLAMP member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_MIRROR_ONCE_LAST_TEXEL Texture coordinate fractions in the integer range [-1,0) are flipped, otherwise clamped to edge texel; see the D3D11_TEXTURE_ADDRESS_MIRROR_ONCE member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_HALF_BORDER Texture coordinates outside the range [0, 1) clamped to edge texel, otherwise uses linearly interpolated edge texel and border color; see the D3D11_TEXTURE_ADDRESS_CLAMP member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_MIRROR_ONCE_HALF_BORDER Texture coordinate fractions in the integer range [-1,0) are flipped, otherwise uses linearly interpolated edge texel and border color; see the D3D11_TEXTURE_ADDRESS_CLAMP member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_BORDER Texture coordinates outside the range [0, 1) use border color; see the D3D11_TEXTURE_ADDRESS_CLAMP member of D3D11_TEXTURE_ADDRESS_MODE.
D3D11X_TEX_CLAMP_MIRROR_ONCE_BORDER Texture coordinate fractions in the integer range [-1,0) are flipped, otherwise border color used; see the D3D11_TEXTURE_ADDRESS_MIRROR_ONCE member of D3D11_TEXTURE_ADDRESS_MODE.

Remarks

For each texture coordinate a clamping calculation is performed based on the clamping policy.

The image below puts all of this together. In this example, the dimension is 4. The large numbers indicate the clamping actions. Texel coordinates labelled “B” indicate clamping to border has occurred. “b” indicates a clamp-half-to-border case with the texel coming from the diminsion-1 texel. “Bb” indicates a clamp-half-to-border case with the texel coming from the texel 0. An “x” in the fraction indicates fractions from 0x01..0x3e.

Figure 1.  Moving from a modal to an effect view.

Whenever the policy is a “half” variant, it means that a bilinear fetch must sample at least one texel from the texture map. In other words, D3D11X_TEX_CLAMP_BORDER might very well be composed of all border color, whereas D3D11X_TEX_CLAMP_HALF_BORDER must sample the texture, and will therefore have a maximum of 75% border color in a 2D case.

Requirements

Header: Declared in d3d11_x.h.