Module: Mesa
Branch: master
Commit: 0bca4784c29e5b12f995eae52a90214de6249771
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0bca4784c29e5b12f995eae52a90214de6249771

Author: Timothy Arceri <tarc...@itsqueeze.com>
Date:   Wed May  3 15:26:22 2017 +1000

mesa: add KHR_no_error support for glActiveShaderProgram()

Reviewed-by: Eric Anholt <e...@anholt.net>

---

 src/mapi/glapi/gen/ARB_separate_shader_objects.xml |  2 +-
 src/mesa/main/pipelineobj.c                        | 18 ++++++++++++++++++
 src/mesa/main/pipelineobj.h                        |  2 ++
 3 files changed, 21 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 9b17a4e040..c3385e9370 100644
--- a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
+++ b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
@@ -20,7 +20,7 @@
          <param name="stages" type="GLbitfield" />
          <param name="program" type="GLuint" />
       </function>
-      <function name="ActiveShaderProgram" es2="3.1">
+      <function name="ActiveShaderProgram" es2="3.1" no_error="true">
          <param name="pipeline" type="GLuint" />
          <param name="program" type="GLuint" />
       </function>
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index b6a4332f60..993fc0a0b1 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -373,6 +373,24 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, 
GLuint program)
    use_program_stages(ctx, shProg, stages, pipe);
 }
 
+void GLAPIENTRY
+_mesa_ActiveShaderProgram_no_error(GLuint pipeline, GLuint program)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg = NULL;
+   struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, 
pipeline);
+
+   if (program)
+      shProg = _mesa_lookup_shader_program(ctx, program);
+
+   /* Object is created by any Pipeline call but glGenProgramPipelines,
+    * glIsProgramPipeline and GetProgramPipelineInfoLog
+    */
+   pipe->EverBound = GL_TRUE;
+
+   _mesa_reference_shader_program(ctx, &pipe->ActiveProgram, shProg);
+}
+
 /**
  * Use the named shader program for subsequent glUniform calls (if pipeline
  * bound)
diff --git a/src/mesa/main/pipelineobj.h b/src/mesa/main/pipelineobj.h
index 048a4c7bf3..54aa40959e 100644
--- a/src/mesa/main/pipelineobj.h
+++ b/src/mesa/main/pipelineobj.h
@@ -77,6 +77,8 @@ _mesa_UseProgramStages_no_error(GLuint pipeline, GLbitfield 
stages,
 extern void GLAPIENTRY
 _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
 
+void GLAPIENTRY
+_mesa_ActiveShaderProgram_no_error(GLuint pipeline, GLuint program);
 extern void GLAPIENTRY
 _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program);
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to