Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GetSamplePosition (DirectX HLSL Texture Object)

Gets the position of the specified sample.

ret Object.GetSamplePosition(

int s

);

 

Parameters

ItemDescription

Object

A Texture2DMS or a Texture2DMSArray texture-object type.

s

[in] The zero-based sample index.

 

Return Value

Returns the (x,y) sample position, a two-component floating-point vector.

Minimum Shader Model

This function is supported in the following shader models.

vs_4_0vs_4_1¹ps_4_0ps_4_1¹gs_4_0gs_4_1¹
xxx

 

  • Shader Model 4.1 is available in Direct3D 10.1 or higher.

Remarks

A pixel shader can be evaluated at sample frequency (run a pixel shader once per sample) or at pixel frequency (run a pixel shader once per pixel). Attach the SV_SampleIndex semantic to a pixel shader input to invoke a pixel shader at sample frequency, the input value is then used as a sample index when sampling the render target.

You can interpolate a pixel shader input in several ways. To interpolate at:

  • A pixel center, don't use any semantic.
  • A sample, use the SV_SampleIndex semantic.
  • A centroid location, use the _centroid modifier.

Related topics

Texture-Object

 

 

Show:
© 2017 Microsoft