diff options
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r-- | src/mesa/main/texstate.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 1b0d760fae5..f4d77189f29 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -496,23 +496,28 @@ update_texture_state( struct gl_context *ctx ) struct gl_vertex_program *vprog = NULL; GLbitfield enabledFragUnits = 0x0; - if (ctx->Shader.CurrentProgram && - ctx->Shader.CurrentProgram->LinkStatus) { - fprog = ctx->Shader.CurrentProgram->FragmentProgram; - vprog = ctx->Shader.CurrentProgram->VertexProgram; + if (ctx->Shader.CurrentVertexProgram && + ctx->Shader.CurrentVertexProgram->LinkStatus) { + vprog = ctx->Shader.CurrentVertexProgram->VertexProgram; + } else if (ctx->VertexProgram._Enabled) { + /* XXX enable this if/when non-shader vertex programs get + * texture fetches: + vprog = ctx->VertexProgram.Current; + */ } - else { - if (ctx->FragmentProgram._Enabled) { - fprog = ctx->FragmentProgram.Current; - } - if (ctx->VertexProgram._Enabled) { - /* XXX enable this if/when non-shader vertex programs get - * texture fetches: - vprog = ctx->VertexProgram.Current; - */ - } + + if (ctx->Shader.CurrentFragmentProgram && + ctx->Shader.CurrentFragmentProgram->LinkStatus) { + fprog = ctx->Shader.CurrentFragmentProgram->FragmentProgram; + } + else if (ctx->FragmentProgram._Enabled) { + fprog = ctx->FragmentProgram.Current; } + /* FINISHME: Geometry shader texture accesses should also be considered + * FINISHME: here. + */ + /* TODO: only set this if there are actual changes */ ctx->NewState |= _NEW_TEXTURE; |