diff options
author | Kenneth Graunke <[email protected]> | 2017-07-12 19:49:55 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-07-13 13:00:58 -0700 |
commit | 42c64b5f87531367eb554188fd924c885c8cecde (patch) | |
tree | 412c74d81a49350e8b4680adca0943f9fe63ebbb /src/mesa | |
parent | f33d8af7aa354d00808f8bfd55028c396c706635 (diff) |
mesa: Return GL_INVALID_ENUM for bogus TEXTURE_SRGB_DECODE_EXT params.
Fixes dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.srgb_decode_samplerparameter{f,fv,i,Iiv,Iuiv,iv}.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/samplerobj.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index d78528be2db..26e77252490 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -780,8 +780,19 @@ set_sampler_srgb_decode(struct gl_context *ctx, if (samp->sRGBDecode == param) return GL_FALSE; + /* The EXT_texture_sRGB_decode spec says: + * + * "INVALID_ENUM is generated if the <pname> parameter of + * TexParameter[i,f,Ii,Iui][v][EXT], + * MultiTexParameter[i,f,Ii,Iui][v]EXT, + * TextureParameter[i,f,Ii,Iui][v]EXT, SamplerParameter[i,f,Ii,Iui][v] + * is TEXTURE_SRGB_DECODE_EXT when the <param> parameter is not one of + * DECODE_EXT or SKIP_DECODE_EXT. + * + * Returning INVALID_PARAM makes that happen. + */ if (param != GL_DECODE_EXT && param != GL_SKIP_DECODE_EXT) - return INVALID_VALUE; + return INVALID_PARAM; flush(ctx); samp->sRGBDecode = param; |