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

@@ -3043,8 +3043,10 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
// For now, we have nothing to map the component-wise comparison forms
// to, because neither GLSL nor SPIR-V has such an opcode. Issue an
// unimplemented error instead. Most of the machinery is here if that
// should ever become available.
if (cmpValues) {
// should ever become available. However, red can be passed through
// to OpImageDrefGather. G/B/A cannot, because that opcode does not
// accept a component.
if (cmpValues != 0 && op != EOpMethodGatherCmpRed) {
error(loc, "unimplemented: component-level gather compare", "", "");
return;
}
@@ -3125,7 +3127,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
}
// Add comparison value if we have one
if (argTex->getType().getSampler().isShadow())
if (argCmp != nullptr)
txgather->getSequence().push_back(argCmp);
// Add offset (either 1, or an array of 4) if we have one