mesa: Simplify destroy_shader_program_variants_cb after previous refactors
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 20 Aug 2011 23:06:34 +0000 (16:06 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 7 Oct 2011 23:39:51 +0000 (16:39 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/state_tracker/st_program.c

index 4162bb99abf75fb5dfadbd9a5e2bcc4b3ce399e1..acd3b56b905e7fee437d8a0d76850ed68a9a9d90 100644 (file)
@@ -1153,12 +1153,9 @@ destroy_shader_program_variants_cb(GLuint key, void *data, void *userData)
             destroy_program_variants(st, shProg->Shaders[i]->Program);
          }
 
-         destroy_program_variants(st,
-                                  shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program);
-         destroy_program_variants(st,
-                                  shProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program);
-         destroy_program_variants(st,
-                                  shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program);
+        for (i = 0; i < Elements(shProg->_LinkedShaders); i++) {
+           destroy_program_variants(st, shProg->_LinkedShaders[i]->Program);
+        }
       }
       break;
    case GL_VERTEX_SHADER: