diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-06-05 05:09:39 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-06-07 23:20:37 +0300 |
commit | 179bb97740805904d65c2bbdf84b658c5292d1f1 (patch) | |
tree | d7b687473e17146645b8dd91589bce6fcb6e6819 | |
parent | bb3e669d06ec5aead740affe75ac0375110b4d7a (diff) |
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.
-rw-r--r-- | intern/gawain/src/shader_interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/gawain/src/shader_interface.c b/intern/gawain/src/shader_interface.c index 4c9f7fae67f..49fd8b4e649 100644 --- a/intern/gawain/src/shader_interface.c +++ b/intern/gawain/src/shader_interface.c @@ -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) { |