summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2014-12-10 16:55:52 -0800
committerLaura Ekstrand <laura@jlekstrand.net>2015-01-08 11:37:29 -0800
commitbf5c588cdea616e0fb57f904c38bc0eb5eb2b962 (patch)
tree68075eaebb76066b5403e2149be4fc34b8cbee55
parentd954f6023b80d9dd87f697c831f21ecdb831d13b (diff)
main: legal_get_tex_level_parameter_target now handles GL_TEXTURE_CUBE_MAP.
ARB_DIRECT_STATE_ACCESS functions allow an effective target of GL_TEXTURE_CUBE_MAP. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
-rw-r--r--src/mesa/main/texparam.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 8527a6464c..bee37e4428 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1204,7 +1204,8 @@ _mesa_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint *params)
}
static GLboolean
-legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target)
+legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target,
+ bool dsa)
{
switch (target) {
case GL_TEXTURE_1D:
@@ -1257,6 +1258,16 @@ legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target)
case GL_PROXY_TEXTURE_2D_MULTISAMPLE:
case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
return ctx->Extensions.ARB_texture_multisample;
+
+ /* This is a valid target for dsa, but the OpenGL 4.5 core spec
+ * (30.10.2014) Section 8.11 Texture Queries says:
+ * "For GetTextureLevelParameter* only, texture may also be a cube
+ * map texture object. In this case the query is always performed
+ * for face zero (the TEXTURE_CUBE_MAP_POSITIVE_X face), since there
+ * is no way to specify another face."
+ */
+ case GL_TEXTURE_CUBE_MAP:
+ return dsa;
default:
return GL_FALSE;
}
@@ -1570,7 +1581,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
return;
}
- if (!legal_get_tex_level_parameter_target(ctx, target)) {
+ if (!legal_get_tex_level_parameter_target(ctx, target, false)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(target=0x%x)", target);
return;