From 3322fbaf3b5e305ce00c1d08c26965bb98e0cef0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 14 Oct 2010 13:28:42 -0700 Subject: glsl: Slightly change the semantic of _LinkedShaders Previously _LinkedShaders was a compact array of the linked shaders for each shader stage. Now it is arranged such that each slot, indexed by the MESA_SHADER_* defines, refers to a specific shader stage. As a result, some slots will be NULL. This makes things a little more complex in the linker, but it simplifies things in other places. As a side effect _NumLinkedShaders is removed. NOTE: This may be a candidate for the 7.9 branch. If there are other patches that get backported to 7.9 that use _LinkedShader, this patch should be cherry picked also. --- src/mesa/drivers/dri/i965/brw_program.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/mesa/drivers/dri/i965/brw_program.c') diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 8bc255a1c0..1367d81469 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -148,15 +148,9 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx, * using the new FS backend. */ shader_program = _mesa_lookup_shader_program(ctx, prog->Id); - if (shader_program) { - for (i = 0; i < shader_program->_NumLinkedShaders; i++) { - struct brw_shader *shader; - - shader = (struct brw_shader *)shader_program->_LinkedShaders[i]; - if (shader->base.Type == GL_FRAGMENT_SHADER && shader->ir) { - return GL_TRUE; - } - } + if (shader_program + && shader_program->_LinkedShaders[MESA_SHADER_FRAGMENT]) { + return GL_TRUE; } } else if (target == GL_VERTEX_PROGRAM_ARB) { -- cgit v1.2.3