Commit 6817f81e by steve-lunarg

HLSL: Implement missing GatherCmp

parent 22be5788
...@@ -29,6 +29,10 @@ PS_OUTPUT main() ...@@ -29,6 +29,10 @@ PS_OUTPUT main()
// no 1D gathers // no 1D gathers
float4 txval80 = g_tTex2df4a . GatherCmp(g_sSampCmp, c3, .75);
int4 txval81 = g_tTex2di4a . GatherCmp(g_sSampCmp, c3, .75);
uint4 txval82 = g_tTex2du4a . GatherCmp(g_sSampCmp, c3, .75);
float4 txval00 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, .75); float4 txval00 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, .75);
int4 txval01 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, .75); int4 txval01 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, .75);
uint4 txval02 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, .75); uint4 txval02 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, .75);
......
...@@ -51,6 +51,10 @@ PS_OUTPUT main() ...@@ -51,6 +51,10 @@ PS_OUTPUT main()
int4 txval31 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75); int4 txval31 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75);
uint4 txval32 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75); uint4 txval32 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75);
float4 txval80 = g_tTex2df4 . GatherCmp(g_sSampCmp, c2, 0.75);
int4 txval81 = g_tTex2di4 . GatherCmp(g_sSampCmp, c2, 0.75);
uint4 txval82 = g_tTex2du4 . GatherCmp(g_sSampCmp, c2, 0.75);
// no 3D gathers // no 3D gathers
float4 txval40 = g_tTexcdf4 . GatherCmpRed(g_sSampCmp, c3, 0.75); float4 txval40 = g_tTexcdf4 . GatherCmpRed(g_sSampCmp, c3, 0.75);
...@@ -69,6 +73,10 @@ PS_OUTPUT main() ...@@ -69,6 +73,10 @@ PS_OUTPUT main()
int4 txval71 = g_tTexcdi4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75); int4 txval71 = g_tTexcdi4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75);
uint4 txval72 = g_tTexcdu4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75); uint4 txval72 = g_tTexcdu4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75);
float4 txval90 = g_tTexcdf4 . GatherCmp(g_sSampCmp, c3, 0.75);
int4 txval91 = g_tTexcdi4 . GatherCmp(g_sSampCmp, c3, 0.75);
uint4 txval92 = g_tTexcdu4 . GatherCmp(g_sSampCmp, c3, 0.75);
psout.Color = 1.0; psout.Color = 1.0;
psout.Depth = 1.0; psout.Depth = 1.0;
......
...@@ -50,13 +50,9 @@ PS_OUTPUT main() ...@@ -50,13 +50,9 @@ PS_OUTPUT main()
int4 txval014 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1), int2(1,-1), int2(1,-1), int2(1,-1)); 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)); 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, int2(1,0), status); float4 txval401 = g_tTex2df4 . GatherCmp(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status); int4 txval411 = g_tTex2di4 . GatherCmp(g_sSampCmp, c2, 0.75, int2(1,-1));
// uint4 txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status); uint4 txval421 = g_tTex2du4 . GatherCmp(g_sSampCmp, c2, 0.75, int2(1,1));
// 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);
// GatherCmpGreen not implemented pending OpImageDrefGather component input // GatherCmpGreen not implemented pending OpImageDrefGather component input
// float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0)); // float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
......
...@@ -36,6 +36,10 @@ PS_OUTPUT main() ...@@ -36,6 +36,10 @@ PS_OUTPUT main()
// no 1D gathers // no 1D gathers
float4 txval401 = g_tTex2df4a . GatherCmp(g_sSampCmp, c3, 0.75, o2);
int4 txval411 = g_tTex2di4a . GatherCmp(g_sSampCmp, c3, 0.75, o2);
uint4 txval421 = g_tTex2du4a . GatherCmp(g_sSampCmp, c3, 0.75, o2);
float4 txval001 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2); float4 txval001 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2);
int4 txval011 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2); int4 txval011 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2);
uint4 txval021 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2); uint4 txval021 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2);
......
...@@ -111,7 +111,8 @@ bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim ...@@ -111,7 +111,8 @@ bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim
name == "GatherAlpha"); name == "GatherAlpha");
const bool isGatherCmp = const bool isGatherCmp =
(name == "GatherCmpRed" || (name == "GatherCmp" ||
name == "GatherCmpRed" ||
name == "GatherCmpGreen" || name == "GatherCmpGreen" ||
name == "GatherCmpBlue" || name == "GatherCmpBlue" ||
name == "GatherCmpAlpha"); name == "GatherCmpAlpha");
...@@ -824,6 +825,12 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c ...@@ -824,6 +825,12 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "GatherAlpha", /* O-4 */ "V4", nullptr, "%@,S,V,,,,", "FIU,S,F,I,,,", EShLangAll, true }, { "GatherAlpha", /* O-4 */ "V4", nullptr, "%@,S,V,,,,", "FIU,S,F,I,,,", EShLangAll, true },
{ "GatherAlpha", /* O-4, status */"V4", nullptr, "%@,S,V,,,,,S", "FIU,S,F,I,,,,U", EShLangAll, true }, { "GatherAlpha", /* O-4, status */"V4", nullptr, "%@,S,V,,,,,S", "FIU,S,F,I,,,,U", EShLangAll, true },
{ "GatherCmp", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true },
{ "GatherCmp", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true },
{ "GatherCmp", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true },
{ "GatherCmp", /* O-4 */ "V4", nullptr, "%@,S,V,S,V,,,", "FIU,s,F,,I,,,", EShLangAll, true },
{ "GatherCmp", /* O-4, status */"V4", nullptr, "%@,S,V,S,V,,V,S","FIU,s,F,,I,,,,U",EShLangAll, true },
{ "GatherCmpRed", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true }, { "GatherCmpRed", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true },
{ "GatherCmpRed", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true }, { "GatherCmpRed", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true },
{ "GatherCmpRed", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true }, { "GatherCmpRed", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true },
...@@ -1203,6 +1210,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil ...@@ -1203,6 +1210,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherGreen", EOpMethodGatherGreen); symbolTable.relateToOperator(BUILTIN_PREFIX "GatherGreen", EOpMethodGatherGreen);
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherBlue", EOpMethodGatherBlue); symbolTable.relateToOperator(BUILTIN_PREFIX "GatherBlue", EOpMethodGatherBlue);
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherAlpha", EOpMethodGatherAlpha); symbolTable.relateToOperator(BUILTIN_PREFIX "GatherAlpha", EOpMethodGatherAlpha);
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmp", EOpMethodGatherCmpRed); // alias
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpRed", EOpMethodGatherCmpRed); symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpRed", EOpMethodGatherCmpRed);
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpGreen", EOpMethodGatherCmpGreen); symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpGreen", EOpMethodGatherCmpGreen);
symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpBlue", EOpMethodGatherCmpBlue); symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpBlue", EOpMethodGatherCmpBlue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment