From 244cef1694fbeb6738b883afc2ca6c4cc9c05ff0 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 3 May 2017 15:34:52 +1000 Subject: mesa: add KHR_no_error support for glBindProgramPipeline() Reviewed-by: Eric Anholt --- src/mapi/glapi/gen/ARB_separate_shader_objects.xml | 2 +- src/mesa/main/pipelineobj.c | 26 ++++++++++++++++++++++ src/mesa/main/pipelineobj.h | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml index c3385e9370c..54c1be3fe73 100644 --- a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml +++ b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml @@ -30,7 +30,7 @@ - + diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index 993fc0a0b17..f7c911f2e44 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -431,6 +431,32 @@ _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program) _mesa_reference_shader_program(ctx, &pipe->ActiveProgram, shProg); } +void GLAPIENTRY +_mesa_BindProgramPipeline_no_error(GLuint pipeline) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_pipeline_object *newObj = NULL; + + /* Rebinding the same pipeline object: no change. + */ + if (ctx->_Shader->Name == pipeline) + return; + + /* Get pointer to new pipeline object (newObj) + */ + if (pipeline) { + /* non-default pipeline object */ + newObj = _mesa_lookup_pipeline_object(ctx, pipeline); + + /* Object is created by any Pipeline call but glGenProgramPipelines, + * glIsProgramPipeline and GetProgramPipelineInfoLog + */ + newObj->EverBound = GL_TRUE; + } + + _mesa_bind_pipeline(ctx, newObj); +} + /** * Make program of the pipeline current */ diff --git a/src/mesa/main/pipelineobj.h b/src/mesa/main/pipelineobj.h index 54aa40959ed..1bf6b713169 100644 --- a/src/mesa/main/pipelineobj.h +++ b/src/mesa/main/pipelineobj.h @@ -82,6 +82,8 @@ _mesa_ActiveShaderProgram_no_error(GLuint pipeline, GLuint program); extern void GLAPIENTRY _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program); +void GLAPIENTRY +_mesa_BindProgramPipeline_no_error(GLuint pipeline); extern void GLAPIENTRY _mesa_BindProgramPipeline(GLuint pipeline); -- cgit v1.2.3