mesa: add KHR_no_error support for glUseProgramStages()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 3 May 2017 04:20:26 +0000 (14:20 +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 26a7afa94a1f07819efba31af14406c9043cae7b..9b17a4e0406495e8e1e0c2cb9a8bf458e56d885e 100644 (file)
@@ -15,7 +15,7 @@
       <enum   name="ALL_SHADER_BITS"                              value="0xFFFFFFFF"/>
       <enum   name="PROGRAM_SEPARABLE"                            value="0x8258"/>
 
-      <function name="UseProgramStages" es2="3.1">
+      <function name="UseProgramStages" es2="3.1" no_error="true">
          <param name="pipeline" type="GLuint" />
          <param name="stages" type="GLbitfield" />
          <param name="program" type="GLuint" />
index 047c0a340edf145b73e165e8b4391faf32ad02b9..b6a4332f6057ab80ba37c93ac2e4ee0635476973 100644 (file)
@@ -256,6 +256,27 @@ use_program_stages(struct gl_context *ctx, struct gl_shader_program *shProg,
    pipe->Validated = false;
 }
 
+void GLAPIENTRY
+_mesa_UseProgramStages_no_error(GLuint pipeline, GLbitfield stages,
+                                GLuint prog)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_pipeline_object *pipe =
+      _mesa_lookup_pipeline_object(ctx, pipeline);
+   struct gl_shader_program *shProg = NULL;
+
+   if (prog)
+      _mesa_lookup_shader_program(ctx, prog);
+
+   /* Object is created by any Pipeline call but glGenProgramPipelines,
+    * glIsProgramPipeline and GetProgramPipelineInfoLog
+    */
+   pipe->EverBound = GL_TRUE;
+
+   use_program_stages(ctx, shProg, stages, pipe);
+}
+
 /**
  * Bound program to severals stages of the pipeline
  */
index fbcb7659249aeb37375ec38588ce584183f2479d..048a4c7bf39d17fa9f5e0b80521a99019b0cefbc 100644 (file)
@@ -71,6 +71,9 @@ _mesa_validate_program_pipeline(struct gl_context * ctx,
                                 struct gl_pipeline_object *pipe);
 
 
+void GLAPIENTRY
+_mesa_UseProgramStages_no_error(GLuint pipeline, GLbitfield stages,
+                                GLuint prog);
 extern void GLAPIENTRY
 _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);