summaryrefslogtreecommitdiff
path: root/src/mesa/main/samplerobj.c
diff options
context:
space:
mode:
authorEduardo Lima Mitev <elima@igalia.com>2014-12-16 09:15:07 +0100
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>2015-02-19 09:35:37 +0100
commitdbc160a3f8a6be26110656a15c0d6048391f4fc7 (patch)
treeb820df6ef2f1364794653e3d90b194a382998fda /src/mesa/main/samplerobj.c
parente8e22cf65fc8b9b0c0355540985b073a03c69a51 (diff)
mesa: Returns correct error values from gl(Get)SamplerParameter*() on GL-ES 3.0+
'3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states: "An INVALID_OPERATION error is generated if sampler is not the name of a sampler object previously returned from a call to GenSamplers." In desktop GL, an GL_INVALID_VALUE is returned instead. Fixes 6 dEQP failing tests: * dEQP-GLES3.functional.negative_api.shader.get_sampler_parameteriv * dEQP-GLES3.functional.negative_api.shader.get_sampler_parameterfv * dEQP-GLES3.functional.negative_api.shader.sampler_parameteri * dEQP-GLES3.functional.negative_api.shader.sampler_parameteriv * dEQP-GLES3.functional.negative_api.shader.sampler_parameterf * dEQP-GLES3.functional.negative_api.shader.sampler_parameterfv Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/main/samplerobj.c')
-rw-r--r--src/mesa/main/samplerobj.c72
1 files changed, 60 insertions, 12 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index cadc9cc97ab..d62a06bf15b 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -732,8 +732,16 @@ _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(sampler %u)",
- sampler);
+ /* '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states:
+ *
+ * "An INVALID_OPERATION error is generated if sampler is not the name
+ * of a sampler object previously returned from a call to GenSamplers."
+ *
+ * In desktop GL, an GL_INVALID_VALUE is returned instead.
+ */
+ _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+ GL_INVALID_OPERATION : GL_INVALID_VALUE),
+ "glSamplerParameteri(sampler %u)", sampler);
return;
}
@@ -817,8 +825,16 @@ _mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(sampler %u)",
- sampler);
+ /* '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states:
+ *
+ * "An INVALID_OPERATION error is generated if sampler is not the name
+ * of a sampler object previously returned from a call to GenSamplers."
+ *
+ * In desktop GL, an GL_INVALID_VALUE is returned instead.
+ */
+ _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+ GL_INVALID_OPERATION : GL_INVALID_VALUE),
+ "glSamplerParameterf(sampler %u)", sampler);
return;
}
@@ -901,8 +917,16 @@ _mesa_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(sampler %u)",
- sampler);
+ /* '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states:
+ *
+ * "An INVALID_OPERATION error is generated if sampler is not the name
+ * of a sampler object previously returned from a call to GenSamplers."
+ *
+ * In desktop GL, an GL_INVALID_VALUE is returned instead.
+ */
+ _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+ GL_INVALID_OPERATION : GL_INVALID_VALUE),
+ "glSamplerParameteriv(sampler %u)", sampler);
return;
}
@@ -993,8 +1017,16 @@ _mesa_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(sampler %u)",
- sampler);
+ /* '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states:
+ *
+ * "An INVALID_OPERATION error is generated if sampler is not the name
+ * of a sampler object previously returned from a call to GenSamplers."
+ *
+ * In desktop GL, an GL_INVALID_VALUE is returned instead.
+ */
+ _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+ GL_INVALID_OPERATION : GL_INVALID_VALUE),
+ "glSamplerParameterfv(sampler %u)", sampler);
return;
}
@@ -1249,8 +1281,16 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameteriv(sampler %u)",
- sampler);
+ /* '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states:
+ *
+ * "An INVALID_OPERATION error is generated if sampler is not the name
+ * of a sampler object previously returned from a call to GenSamplers."
+ *
+ * In desktop GL, an GL_INVALID_VALUE is returned instead.
+ */
+ _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+ GL_INVALID_OPERATION : GL_INVALID_VALUE),
+ "glGetSamplerParameteriv(sampler %u)", sampler);
return;
}
@@ -1339,8 +1379,16 @@ _mesa_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params)
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameterfv(sampler %u)",
- sampler);
+ /* '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states:
+ *
+ * "An INVALID_OPERATION error is generated if sampler is not the name
+ * of a sampler object previously returned from a call to GenSamplers."
+ *
+ * In desktop GL, an GL_INVALID_VALUE is returned instead.
+ */
+ _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+ GL_INVALID_OPERATION : GL_INVALID_VALUE),
+ "glGetSamplerParameterfv(sampler %u)", sampler);
return;
}