gather4_po_c (sm5 - asm)

Behaves the same as gather4_po, except performs comparison on texels, similar to sample_c.

gather4_po_c dest[.mask], srcAddress[.swizzle], srcOffset[.swizzle], srcResource[.swizzle], srcSampler[.r], srcReferenceValue
Item Description
dest
[in] The address of the result of the operation.
srcAddress
[in] A set of texture coordinates.
srcOffset
[in] The offset.
srcResource
[in] A texture register.
srcSampler
[in] A sampler register.
srcReferenceValue
[in] Single component selected.

Remarks

See sample_c for information about how srcReferenceValue is compared against each fetched texel. Unlike sample_c, gather4_po_c returns each comparison result, rather than filtering them.

This instruction, like gather4_po, only works with 2D textures. This is unlike gather4_c, which also works with TextureCubes.

For formats with float32 components, if the value being fetched is normalized, or +-INF, it is used in the comparison operation untouched. NaN is used in the comparison operation as NaN, but the exact bit representation of the NaN may be changed. Denorms are flushed to zero going into the comparison. For TextureCubes, some synthesis of the missing 4th texel must occur at corners, so the notion of returning bits unchanged for the synthesized texel does not apply.

Formats supported for gather4_po_c are same as those supported for sample_c. These are single-component formats, thus the .R on srcSampler, rather than an arbitrary swizzle.

gather4_po_c on an unbound resource returns 0.

Use this method for shadow map filtering.

This instruction applies to the following shader stages:

Vertex Hull Domain Geometry Pixel Compute
X X X X X X

Minimum Shader Model

This instruction is supported in the following shader models:

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

Shader Model 5 Assembly (DirectX HLSL)