HLSL: add standard sample position return form of GetSamplePosition method

Multisample textures support a GetSamplePosition() method intended to query
positions given a sample index.  This cannot be truly implemented in SPIR-V,
but #753 requested returning standard positions for the 1..16 cases, which
this PR adds.  Anything besides that returns (0,0).  If the standard positions
are not used, this will be wrong.

This should be revisited when there is a real query available.
This commit is contained in:
steve-lunarg
2017-04-26 08:31:56 -06:00
parent a1cdd13b1c
commit d4d0b29752
4 changed files with 935 additions and 36 deletions

View File

@@ -9,12 +9,12 @@ struct PS_OUTPUT
float Depth : SV_Depth;
};
PS_OUTPUT main()
PS_OUTPUT main(int sample : SAMPLE)
{
PS_OUTPUT psout;
float2 r00 = g_tTex2dmsf4.GetSamplePosition(1);
float2 r01 = g_tTex2dmsf4a.GetSamplePosition(2);
float2 r00 = g_tTex2dmsf4.GetSamplePosition(sample);
float2 r01 = g_tTex2dmsf4a.GetSamplePosition(sample);
psout.Color = 1.0;
psout.Depth = 1.0;