Commit fcb70fd8 by Nicolas Capens

Fix assert on using GLSL sampler function arguments.

Bug b/31651425 Change-Id: Ic6c1f16b1ec3ef039e15e72e70a1daee711fba2f Reviewed-on: https://swiftshader-review.googlesource.com/9748Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 7831e44c
...@@ -2944,9 +2944,19 @@ namespace glsl ...@@ -2944,9 +2944,19 @@ namespace glsl
TIntermSymbol *symbol = sampler->getAsSymbolNode(); TIntermSymbol *symbol = sampler->getAsSymbolNode();
TIntermBinary *binary = sampler->getAsBinaryNode(); TIntermBinary *binary = sampler->getAsBinaryNode();
if(symbol && type.getQualifier() == EvqUniform) if(symbol)
{ {
return samplerRegister(symbol); switch(type.getQualifier())
{
case EvqUniform:
return samplerRegister(symbol);
case EvqIn:
case EvqConstReadOnly:
// Function arguments are not (uniform) sampler registers
return -1;
default:
UNREACHABLE(type.getQualifier());
}
} }
else if(binary) else if(binary)
{ {
...@@ -2992,7 +3002,7 @@ namespace glsl ...@@ -2992,7 +3002,7 @@ namespace glsl
} }
UNREACHABLE(0); UNREACHABLE(0);
return -1; // Not a sampler register return -1; // Not a (uniform) sampler register
} }
int OutputASM::samplerRegister(TIntermSymbol *sampler) int OutputASM::samplerRegister(TIntermSymbol *sampler)
......
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