[Bf-blender-cvs] [179bb977408] blender2.8: Gawain: stricter lookup of builtin uniforms
Mike Erwin
noreply at git.blender.org
Wed Jun 7 22:29:05 CEST 2017
Commit: 179bb97740805904d65c2bbdf84b658c5292d1f1
Author: Mike Erwin
Date: Sun Jun 4 22:09:39 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB179bb97740805904d65c2bbdf84b658c5292d1f1
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.
===================================================================
M intern/gawain/src/shader_interface.c
===================================================================
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)
{
More information about the Bf-blender-cvs
mailing list