Gawain: stricter lookup of builtin uniforms

UNIFORM_NONE should never match a valid uniform (builtin or custom).

The logic for UNIFORM_CUSTOM was just wrong, since it returned the first custom uniform. This function should only accept builtin (non-custom) uniforms.
This commit is contained in:
Mike Erwin 2017-06-04 22:09:39 -04:00
parent bb3e669d06
commit 179bb97740
1 changed files with 5 additions and 0 deletions

View File

@ -273,6 +273,11 @@ const ShaderInput* ShaderInterface_uniform(const ShaderInterface* shaderface, co
const ShaderInput* ShaderInterface_builtin_uniform(const ShaderInterface* shaderface, BuiltinUniform builtin)
{
#if TRUST_NO_ONE
assert(builtin != UNIFORM_NONE);
assert(builtin != UNIFORM_CUSTOM);
#endif
// look up by enum, not name
for (uint32_t i = 0; i < shaderface->uniform_ct; ++i)
{