From: Brian Paul Date: Thu, 18 Dec 2008 02:01:34 +0000 (-0700) Subject: mesa: choose GLSL vertex shader over ARB/internal vertex program in get_fp_input_mask() X-Git-Tag: mesa-7.8~4139^2~496^2~177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2389c055ed4c26ba5f3979c4a7871a333725dd88;p=platform%2Fupstream%2Fmesa.git mesa: choose GLSL vertex shader over ARB/internal vertex program in get_fp_input_mask() This is a work-around the for the fact that we do fragment shader state validation before vertex shader validation (see comments in state.c) so in get_fp_input_mask() we can't rely on ctx->VertexProgram._Current being up to date yet. This fixes a glean glsl1 test failure. --- diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 865ef8f..2f90a34 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -270,7 +270,19 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) } else { /* calculate from vp->outputs */ - GLbitfield vp_outputs = ctx->VertexProgram._Current->Base.OutputsWritten; + struct gl_vertex_program *vprog; + GLbitfield vp_outputs; + + /* Choose GLSL vertex shader over ARB vertex program. Need this + * since vertex shader state validation comes after fragment state + * validation (see additional comments in state.c). + */ + if (vertexShader) + vprog = ctx->Shader.CurrentProgram->VertexProgram; + else + vprog = ctx->VertexProgram._Current; + + vp_outputs = vprog->Base.OutputsWritten; /* These get generated in the setup routine regardless of the * vertex program: