Re: [Mesa-dev] [PATCH 2/7] mesa: add KHR_no_error support for glUseProgramStages()

2017-05-04 Thread Eric Anholt
Eric Anholt  writes:

> [ Unknown signature status ]
> Timothy Arceri  writes:
>
>> ---
>> +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().

That said, it fits with the pattern of the other no_error functions in
the file, so either way, patches 1-4 and 6 are:

Reviewed-by: Eric Anholt 

Patch 5 I'm kind of ambivalent -- I like having the compile paths for
debug and non-debug as close as possible, and have compiler
optimizations removing the debug code.  I don't know of a good way to do
that when we have DEBUG #defined or #undef, rather than true or false,
though.

Patch 7, I had the same response to the macro as others.


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/7] mesa: add KHR_no_error support for glUseProgramStages()

2017-05-04 Thread Eric Anholt
Timothy Arceri  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 @@
> value="0x8259"/>
> value="0x825A"/>
> value="0x0001"/>
> value="0x0002"/>
> value="0x0004"/>
> value="0x0008"/>
> value="0x0010"/>
> value="0x"/>
> value="0x8258"/>
>  
> -  
> +  
>   
>   
>   
>
>
>   
>   
>
>
>   
> 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().


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/7] mesa: add KHR_no_error support for glUseProgramStages()

2017-05-03 Thread Timothy Arceri
---
 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 @@
   
   
   
   
   
   
   
   
   
 
-  
+  
  
  
  
   
   
  
  
   
   
  
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);
+}
+
 /**
  * Bound program to severals stages of the pipeline
  */
 void GLAPIENTRY
 _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
 {
GET_CURRENT_CONTEXT(ctx);
 
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, 
pipeline);
struct gl_shader_program *shProg = NULL;
diff --git a/src/mesa/main/pipelineobj.h b/src/mesa/main/pipelineobj.h
index fbcb765..048a4c7 100644
--- a/src/mesa/main/pipelineobj.h
+++ b/src/mesa/main/pipelineobj.h
@@ -64,20 +64,23 @@ _mesa_reference_pipeline_object(struct gl_context *ctx,
 
 extern void
 _mesa_bind_pipeline(struct gl_context *ctx,
 struct gl_pipeline_object *pipe);
 
 extern GLboolean
 _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);
 
 extern void GLAPIENTRY
 _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program);
 
 extern void GLAPIENTRY
 _mesa_BindProgramPipeline(GLuint pipeline);
 
 extern void GLAPIENTRY
-- 
2.9.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev