Enable GatherCmpRed. Green/Blue/Alpha cannot be supported.

This implements GatherCmpRed in terms of OpImageDrefGather.

There appears to be no way to implement the Green/Blue/Apha forms: see #673.
This commit is contained in:
steve-lunarg
2017-03-09 08:59:45 -07:00
parent 88e88e59cb
commit d00b026111
4 changed files with 671 additions and 55 deletions

View File

@@ -29,10 +29,10 @@ uniform float2 c2;
uniform float3 c3;
uniform float4 c4;
uniform int o1;
uniform int2 o2;
uniform int3 o3;
uniform int4 o4;
PS_OUTPUT main()
{
@@ -42,69 +42,72 @@ PS_OUTPUT main()
// no 1D gathers
float4 txval001 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2);
int4 txval011 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2);
uint4 txval021 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2);
float4 txval001 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0));
int4 txval011 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1));
uint4 txval021 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,1));
float4 txval004 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
int4 txval014 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
uint4 txval024 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
float4 txval004 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
int4 txval014 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1), int2(1,-1), int2(1,-1), int2(1,-1));
uint4 txval024 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,1), int2(1,1), int2(1,1), int2(1,1));
// float4 txval00s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval00s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
// float4 txval004s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval014s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval024s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// float4 txval004s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval014s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval024s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2);
int4 txval111 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2);
uint4 txval121 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2);
// GatherCmpGreen not implemented pending OpImageDrefGather component input
// float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval111 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
// uint4 txval121 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
// float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
// float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
float4 txval201 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2);
int4 txval211 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2);
uint4 txval221 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2);
// GatherCmpBlue not implemented pending OpImageDrefGather component input
// float4 txval201 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval211 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
// uint4 txval221 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
float4 txval204 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
int4 txval214 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
uint4 txval224 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
// float4 txval204 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// int4 txval214 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// uint4 txval224 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
float4 txval301 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2);
int4 txval311 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2);
uint4 txval321 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2);
// GatherCmpAlpha not implemented pending OpImageDrefGather component input
// float4 txval301 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval311 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
// uint4 txval321 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
float4 txval304 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
int4 txval314 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
uint4 txval324 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
// float4 txval304 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// int4 txval314 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// uint4 txval324 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
// no 3D gathers with offset