Used to create a sampler using the hardware-native register descriptor for a sampler (SQ_SAMP_DESC_WORD0 to SQ_SAMP_DESC_WORD3), which D3D11X_SAMPLER_DESC mirrors. This provides a way to make sampler state combinations that are not exposed in standard D3D11.1.
public:
HRESULT CreateSamplerStateX(
const D3D11X_SAMPLER_DESC *pSamplerDesc,
ID3D11SamplerState **ppSamplerState
)
pSamplerDesc
Type: D3D11X_SAMPLER_DESC *
[in] Pointer to a sampler state description (see D3D11X_SAMPLER_DESC).
ppSamplerState
Type: ID3D11SamplerState **
[out, optional] Address of a pointer to the sampler state object created (see ID3D11SamplerState).
Type: HRESULT
One of the Direct3D 11 return codes.
Duplicate states are not detected by this method.
There is no limit to the total number of sampler objects.
The easiest way to determine how to fill in all of the many confusing fields of D3D11X_SAMPLER_DESC is to use CreateSamplerState to create the closest Direct3D equivalent, call GetDescX to get back the corresponding D3D11X_SAMPLER_DESC structure, override the appropriate fields, and then call CreateSamplerStateX.
If you looking to TriJuice your textures (called D3DSAMP_TRILINEARTHRESHOLD on the Xbox 360) then use CreateSamplerStateX and set the PerfMip field of D3D11X_SAMPLER_DESC appropriately to make trilinear sampling cost the same as bilinear when sampling close to a mip - the higher the number, the more it does a bilinear fetch instead of a trilinear one.
Header: Declared in d3d11_x.h.
Library: Use d3d11_x.lib.