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




[in] The address of the results of the operation.


[in] A set of texture coordinates. For more information see the sample instruction.


[in] A texture register. For more information see the sample instruction.


[in] A sampler register. For more information see the sample instruction.


[in] The LOD.



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 ShaderGeometry ShaderPixel Shader


Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
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


Related topics

Shader Model 4 Assembly (DirectX HLSL)