[Mesa-dev] [PATCH 2/7] mesa: add KHR_no_error support for glUseProgramStages()
Eric Anholt
eric at anholt.net
Thu May 4 17:42:24 UTC 2017
Timothy Arceri <tarceri at itsqueeze.com> writes:
> ---
> src/mapi/glapi/gen/ARB_separate_shader_objects.xml | 2 +-
> src/mesa/main/pipelineobj.c | 21 +++++++++++++++++++++
> src/mesa/main/pipelineobj.h | 3 +++
> 3 files changed, 25 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 26a7afa..9b17a4e 100644
> --- a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
> +++ b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
> @@ -8,21 +8,21 @@
> <enum name="ACTIVE_PROGRAM" value="0x8259"/>
> <enum name="PROGRAM_PIPELINE_BINDING" value="0x825A"/>
> <enum name="VERTEX_SHADER_BIT" value="0x00000001"/>
> <enum name="FRAGMENT_SHADER_BIT" value="0x00000002"/>
> <enum name="GEOMETRY_SHADER_BIT" value="0x00000004"/>
> <enum name="TESS_CONTROL_SHADER_BIT" value="0x00000008"/>
> <enum name="TESS_EVALUATION_SHADER_BIT" value="0x00000010"/>
> <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" />
> </function>
> <function name="ActiveShaderProgram" es2="3.1">
> <param name="pipeline" type="GLuint" />
> <param name="program" type="GLuint" />
> </function>
> <function name="CreateShaderProgramv" es2="3.1">
> <param name="type" type="GLenum" />
> diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
> index 047c0a3..b6a4332 100644
> --- a/src/mesa/main/pipelineobj.c
> +++ b/src/mesa/main/pipelineobj.c
> @@ -249,20 +249,41 @@ use_program_stages(struct gl_context *ctx, struct gl_shader_program *shProg,
>
> if ((stages & GL_TESS_EVALUATION_SHADER_BIT) != 0)
> use_program_stage(ctx, GL_TESS_EVALUATION_SHADER, shProg, pipe);
>
> if ((stages & GL_COMPUTE_SHADER_BIT) != 0)
> use_program_stage(ctx, GL_COMPUTE_SHADER, shProg, pipe);
>
> 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);
> +}
Does EverBound need to be set before the validation in the other path?
Wondering if we can just move EverBound setting to use_program_stages().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170504/4ff5318a/attachment-0001.sig>
More information about the mesa-dev
mailing list