aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-03 14:20:26 +1000
committerTimothy Arceri <[email protected]>2017-05-11 10:56:08 +1000
commit00c5119a5e8210e801192c77069b79a87f63264e (patch)
treeadea3dbcb0606e97795f7a8a0a19601f1ecf22d5
parentea4c606441d7e2f0d8c86d5abce351935b16255c (diff)
mesa: add KHR_no_error support for glUseProgramStages()
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mapi/glapi/gen/ARB_separate_shader_objects.xml2
-rw-r--r--src/mesa/main/pipelineobj.c21
-rw-r--r--src/mesa/main/pipelineobj.h3
3 files changed, 25 insertions, 1 deletions
diff --git a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
index 26a7afa94a1..9b17a4e0406 100644
--- a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
+++ b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
@@ -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" />
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 047c0a340ed..b6a4332f605 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -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
*/
diff --git a/src/mesa/main/pipelineobj.h b/src/mesa/main/pipelineobj.h
index fbcb7659249..048a4c7bf39 100644
--- a/src/mesa/main/pipelineobj.h
+++ b/src/mesa/main/pipelineobj.h
@@ -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);