sample_l (sm4 - asm)

Samples data from the specified Element/texture using the specified address and the filtering mode identified by the given sampler.

sample_l[_aoffimmi(u,v,w)] dest[.mask], srcAddress[.swizzle], srcResource[.swizzle], srcSampler, srcLOD.select_component
Item Description
dest
[in] The address of the results of the operation.
srcAddress
[in] A set of texture coordinates. For more information see the sample instruction.
srcResource
[in] A texture register. For more information see the sample instruction.
srcSampler
[in] A sampler register. For more information see the sample instruction.
srcLOD
[in] The LOD.

Remarks

This instruction is identical to sample, except that LOD is provided directly by the application as a scalar value, representing no anisotropy. This instruction is available in all progammable Shader stages.

sample_l samples the texture using srcLOD to be the LOD. If the LOD value is <= 0, the zero'th (biggest map) is chosen, with the magnify filter applied (if applicable based on the filter mode). Because srcLOD is a floating point value, the fractional value is used to interpolate between two mip levels, if the minify filter is LINEAR or with anisotropic filtering.

sample_l ignores address derivatives, so filtering behavior is purely isotropic. Because derivatives are ignored, anisotropic filtering behaves as isotropic filtering.

Sampler states MIPLODBIAS and MAX/MINMIPLEVEL are honored.

When used in the Pixel Shader, sample_l implies that the choice of LOD is per-pixel, with no effect from neighboring pixels, for example in the same 2x2 stamp.

Fetching from an input slot that has nothing bound to it returns 0 for all components.

This instruction applies to the following shader stages:

Vertex Shader Geometry Shader Pixel Shader
X X x

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 5 yes
Shader Model 4.1 yes
Shader Model 4 yes
Shader Model 3 (DirectX HLSL) no
Shader Model 2 (DirectX HLSL) no
Shader Model 1 (DirectX HLSL) no

Shader Model 4 Assembly (DirectX HLSL)