[Mesa-dev] [PATCH 06/17] mesa: Fix errors values returned by glShaderBinary()

Ian Romanick idr at freedesktop.org
Wed Jul 29 12:44:24 PDT 2015


On 07/29/2015 07:01 AM, Samuel Iglesias Gonsalvez wrote:
> From: Eduardo Lima Mitev <elima at igalia.com>
> 
> Page 68, section 7.2 'Shader Binaries" of the of the OpenGL ES 3.1,
> and page 88 of the OpenGL 4.5 specs state:
> 
>     "An INVALID_VALUE error is generated if count or length is negative.
>      An INVALID_ENUM error is generated if binaryformat is not a supported
>      format returned in SHADER_BINARY_FORMATS."
> 
> Currently, an INVALID_OPERATION error is returned for all cases.
> 
> Fixes 1 dEQP test:
> * dEQP-GLES3.functional.negative_api.shader.shader_binary
> ---
>  src/mesa/main/shaderapi.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 0887c68..70ac034 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -1798,7 +1798,20 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
>     (void) binaryformat;
>     (void) binary;
>     (void) length;

With the "(void) length;" and "(void) n;" deleted (because they are now
used), this patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

I think this patch could also be tagged for the 10.6.x series.

> -   _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderBinary");
> +
> +   /* Page 68, section 7.2 'Shader Binaries" of the of the OpenGL ES 3.1, and
> +    * page 88 of the OpenGL 4.5 specs state:
> +    *
> +    *     "An INVALID_VALUE error is generated if count or length is negative.
> +    *      An INVALID_ENUM error is generated if binaryformat is not a supported
> +    *      format returned in SHADER_BINARY_FORMATS."
> +    */
> +   if (n < 0 || length < 0) {
> +      _mesa_error(ctx, GL_INVALID_VALUE, "glShaderBinary(count or length < 0)");
> +      return;
> +   }
> +
> +   _mesa_error(ctx, GL_INVALID_ENUM, "glShaderBinary(format)");
>  }
>  
>  
> 



More information about the mesa-dev mailing list