Re: [Mesa-dev] [PATCH 6/6] mesa/es3.1: Fix error code for glCreateShaderProgram

2015-06-23 Thread Matt Turner
I should have also mentioned -- the commit titles need some
improvement. "Fix error code" isn't very descriptive of the change,
and the change isn't actually specific to es3.1. How about

> mesa: Raise INVALID_VALUE from glCreateShaderProgramv if count < 0.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/6] mesa/es3.1: Fix error code for glCreateShaderProgram

2015-06-23 Thread Matt Turner
On Tue, Jun 23, 2015 at 5:23 AM, Marta Lofstedt
 wrote:
> From: Marta Lofstedt 
>
> According to the OpenGL ES standard, 7.3.
> For a call to glCreateShaderProgram with count < 0,
> a GL_INVALID_VALUE error should be generated.
>
> Signed-off-by: Marta Lofstedt 
> ---
>  src/mesa/main/shaderapi.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index c783c69..266064d 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -1890,6 +1890,15 @@ _mesa_create_shader_program(struct gl_context* ctx, 
> GLboolean separate,
> const GLuint shader = create_shader(ctx, type);
> GLuint program = 0;
>
> +   /*
> +* According to OpenGL ES 3.1 standard 7.3: GL_INVALID_VALUE
> +* should be generated, if count < 0.
> +*/

The format of spec citations is

/* Page 65 in section 7.3 Program Objects of the OpenGL ES 3.1 spec says:
 *
 * "An INVALID_VALUE error is generated if count is negative."
 *
 * "If an error is generated, zero is returned."
 */

> +   if (_mesa_is_gles31(ctx) && count < 0) {

glCreateShaderProgramv comes from ARB_separate_shader_objects (merged
in GL 4.1), and in GL 4.3 the spec gained the new text cited above. I
think we should take that change as a clarification (a change that
should apply to previous versions retroactively) instead of an actual
change in behavior. As such, I think we should remove the
_mesa_is_gles31 check. I'd modify the citation to mention GL 4.3 as
well.

> +  _mesa_error(ctx, GL_INVALID_VALUE, "glCreateShaderProgram (count < 
> 0)");

Missing the "v" at the end of "glCreateShaderProgramv"

> +  return program;

Just return literal 0 here to make it more clear.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/6] mesa/es3.1: Fix error code for glCreateShaderProgram

2015-06-23 Thread Erik Faye-Lund
On Tue, Jun 23, 2015 at 2:23 PM, Marta Lofstedt
 wrote:
> From: Marta Lofstedt 
>
> According to the OpenGL ES standard, 7.3.
> For a call to glCreateShaderProgram with count < 0,
> a GL_INVALID_VALUE error should be generated.
>

OpenGL 4.5 defines it the same way.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev