[Mesa-dev] [PATCH 1/2] main: Clean up a strange construction in use_shader_program().

Jordan Justen jordan.l.justen at intel.com
Wed Mar 11 15:43:37 PDT 2015


From: Paul Berry <stereotype441 at gmail.com>

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
---
 Two patches found in Paul's cs branch...

 src/mesa/main/shaderapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 5731d58..872b559 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1035,7 +1035,7 @@ use_shader_program(struct gl_context *ctx, GLenum type,
    gl_shader_stage stage = _mesa_shader_enum_to_shader_stage(type);
 
    target = &shTarget->CurrentProgram[stage];
-   if ((shProg == NULL) || (shProg->_LinkedShaders[stage] == NULL))
+   if ((shProg != NULL) && (shProg->_LinkedShaders[stage] == NULL))
       shProg = NULL;
 
    if (*target != shProg) {
-- 
2.1.4



More information about the mesa-dev mailing list