diff options
author | Ian Romanick <[email protected]> | 2010-10-13 13:58:44 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-10-27 13:35:53 -0700 |
commit | 84eba3ef71dfa822e5ff0463032cdd2e3515b888 (patch) | |
tree | dc737eed47f4e7ec35581a1ec9daf598765cb978 /src/mesa/main/texstate.c | |
parent | 75c6f472880706dcbb9d1e20727fa8f71db8b11c (diff) |
Track separate programs for each stage
The assumption is that all stages are the same program or that
varyings are passed between stages using built-in varyings.
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; |