mesa: add KHR_no_error support for glActiveShaderProgram()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 3 May 2017 05:26:22 +0000 (15:26 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 11 May 2017 00:56:08 +0000 (10:56 +1000)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mapi/glapi/gen/ARB_separate_shader_objects.xml
src/mesa/main/pipelineobj.c
src/mesa/main/pipelineobj.h

index 9b17a4e0406495e8e1e0c2cb9a8bf458e56d885e..c3385e9370c858746e336d152ae5522722544562 100644 (file)
@@ -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>
index b6a4332f6057ab80ba37c93ac2e4ee0635476973..993fc0a0b1707a3a7689f99faeb2592d5b6997f2 100644 (file)
@@ -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)
index 048a4c7bf39d17fa9f5e0b80521a99019b0cefbc..54aa40959edc3e56ec2488ffc20107dec07f10d4 100644 (file)
@@ -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);