HLSL: Additional channel value for textureGatherXXX().

When mapping HLSL gather intrinsics to GLSL textureGatherXXX() built-in
function, the channel selection value is only valid for non-shadow samplers.
This commit is contained in:
Rex Xu
2017-03-13 17:07:18 +08:00
parent b16f7e6819
commit d41a696c30
2 changed files with 3 additions and 25 deletions

View File

@@ -3082,7 +3082,9 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
if (argOffset != nullptr)
txgather->getSequence().push_back(argOffset);
txgather->getSequence().push_back(argChannel);
// Add channel value if the sampler is not shadow
if (! argSamp->getType().getSampler().isShadow())
txgather->getSequence().push_back(argChannel);
txgather->setType(node->getType());
txgather->setLoc(loc);