mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 19:40:06 +00:00
d4d0b29752
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.
24 lines
448 B
GLSL
24 lines
448 B
GLSL
SamplerState g_sSamp : register(s0);
|
|
|
|
Texture2DMS <float4> g_tTex2dmsf4;
|
|
Texture2DMSArray <float4> g_tTex2dmsf4a;
|
|
|
|
struct PS_OUTPUT
|
|
{
|
|
float4 Color : SV_Target0;
|
|
float Depth : SV_Depth;
|
|
};
|
|
|
|
PS_OUTPUT main(int sample : SAMPLE)
|
|
{
|
|
PS_OUTPUT psout;
|
|
|
|
float2 r00 = g_tTex2dmsf4.GetSamplePosition(sample);
|
|
float2 r01 = g_tTex2dmsf4a.GetSamplePosition(sample);
|
|
|
|
psout.Color = 1.0;
|
|
psout.Depth = 1.0;
|
|
|
|
return psout;
|
|
}
|