From 4caa9db71ce05dc2cc86177ca42655c2011fbe4a Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 28 Jun 2013 17:18:35 -0700 Subject: mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_program Extend use_shader_program to support a different target. Allow to reuse the function to update the pipeline state. Note I bypass the flush when target isn't current. Maybe it would be better to create a new UseProgramStages driver function This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick Reviewed-by: Eric Anholt --- src/mesa/drivers/common/meta.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/common/meta.c') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index dbc6ab2a701..acf927b09a0 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -899,16 +899,19 @@ _mesa_meta_end(struct gl_context *ctx) if (ctx->Extensions.ARB_vertex_shader) { _mesa_use_shader_program(ctx, GL_VERTEX_SHADER, - save->Shader[MESA_SHADER_VERTEX]); + save->Shader[MESA_SHADER_VERTEX], + ctx->_Shader); } if (_mesa_has_geometry_shaders(ctx)) _mesa_use_shader_program(ctx, GL_GEOMETRY_SHADER_ARB, - save->Shader[MESA_SHADER_GEOMETRY]); + save->Shader[MESA_SHADER_GEOMETRY], + ctx->_Shader); if (ctx->Extensions.ARB_fragment_shader) _mesa_use_shader_program(ctx, GL_FRAGMENT_SHADER, - save->Shader[MESA_SHADER_FRAGMENT]); + save->Shader[MESA_SHADER_FRAGMENT], + ctx->_Shader); _mesa_reference_shader_program(ctx, &ctx->_Shader->ActiveProgram, save->ActiveShader); -- cgit v1.2.3