summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-10-13 13:58:44 -0700
committerIan Romanick <[email protected]>2010-10-27 13:35:53 -0700
commit84eba3ef71dfa822e5ff0463032cdd2e3515b888 (patch)
treedc737eed47f4e7ec35581a1ec9daf598765cb978 /src/mesa/main/state.c
parent75c6f472880706dcbb9d1e20727fa8f71db8b11c (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/state.c')
-rw-r--r--src/mesa/main/state.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 5529732de07..05f4165c44a 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -247,7 +247,9 @@ update_program_enables(struct gl_context *ctx)
static GLbitfield
update_program(struct gl_context *ctx)
{
- const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
+ const struct gl_shader_program *vsProg = ctx->Shader.CurrentVertexProgram;
+ const struct gl_shader_program *gsProg = ctx->Shader.CurrentGeometryProgram;
+ const struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram;
const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current;
@@ -269,10 +271,10 @@ update_program(struct gl_context *ctx)
* come up, or matter.
*/
- if (shProg && shProg->LinkStatus && shProg->FragmentProgram) {
+ if (fsProg && fsProg->LinkStatus && fsProg->FragmentProgram) {
/* Use shader programs */
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
- shProg->FragmentProgram);
+ fsProg->FragmentProgram);
}
else if (ctx->FragmentProgram._Enabled) {
/* use user-defined vertex program */
@@ -292,10 +294,10 @@ update_program(struct gl_context *ctx)
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
}
- if (shProg && shProg->LinkStatus && shProg->GeometryProgram) {
+ if (gsProg && gsProg->LinkStatus && gsProg->GeometryProgram) {
/* Use shader programs */
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current,
- shProg->GeometryProgram);
+ gsProg->GeometryProgram);
} else {
/* no fragment program */
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL);
@@ -305,10 +307,10 @@ update_program(struct gl_context *ctx)
* _mesa_get_fixed_func_vertex_program() needs to know active
* fragprog inputs.
*/
- if (shProg && shProg->LinkStatus && shProg->VertexProgram) {
+ if (vsProg && vsProg->LinkStatus && vsProg->VertexProgram) {
/* Use shader programs */
_mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
- shProg->VertexProgram);
+ vsProg->VertexProgram);
}
else if (ctx->VertexProgram._Enabled) {
/* use user-defined vertex program */