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/drivers/common/meta.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/drivers/common/meta.c')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 9946bf19900..1bfd76a665d 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -143,7 +143,10 @@ struct save_state struct gl_vertex_program *VertexProgram; GLboolean FragmentProgramEnabled; struct gl_fragment_program *FragmentProgram; - GLuint Shader; + GLuint VertexShader; + GLuint GeometryShader; + GLuint FragmentShader; + GLuint ActiveShader; /** META_STENCIL_TEST */ struct gl_stencil_attrib Stencil; @@ -433,8 +436,15 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) } if (ctx->Extensions.ARB_shader_objects) { - save->Shader = ctx->Shader.CurrentProgram ? - ctx->Shader.CurrentProgram->Name : 0; + save->VertexShader = ctx->Shader.CurrentVertexProgram ? + ctx->Shader.CurrentVertexProgram->Name : 0; + save->GeometryShader = ctx->Shader.CurrentGeometryProgram ? + ctx->Shader.CurrentGeometryProgram->Name : 0; + save->FragmentShader = ctx->Shader.CurrentFragmentProgram ? + ctx->Shader.CurrentFragmentProgram->Name : 0; + save->ActiveShader = ctx->Shader.ActiveProgram ? + ctx->Shader.ActiveProgram->Name : 0; + _mesa_UseProgramObjectARB(0); } } @@ -664,9 +674,17 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_reference_fragprog(ctx, &save->FragmentProgram, NULL); } - if (ctx->Extensions.ARB_shader_objects) { - _mesa_UseProgramObjectARB(save->Shader); - } + if (ctx->Extensions.ARB_vertex_shader) + _mesa_UseShaderProgramEXT(GL_VERTEX_SHADER, save->VertexShader); + + if (ctx->Extensions.ARB_geometry_shader4) + _mesa_UseShaderProgramEXT(GL_GEOMETRY_SHADER_ARB, + save->GeometryShader); + + if (ctx->Extensions.ARB_fragment_shader) + _mesa_UseShaderProgramEXT(GL_FRAGMENT_SHADER, save->FragmentShader); + + _mesa_ActiveProgramEXT(save->ActiveShader); } if (state & META_STENCIL_TEST) { |