summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-12-18 14:09:58 -0800
committerIan Romanick <[email protected]>2014-01-27 14:21:42 -0700
commit88db6ad7dbe14e2f149d655cfe5b983e1a8751da (patch)
treefa6f5834c171fdbad57706bbb77cb7cb0be8c9fd /src/mesa
parent3f3aafbfeeb3939cb5cf710954ccefb8bbe9cff9 (diff)
mesa: Generate the correct error for a depth format with a 3D texture
All versions of the OpenGL spec are quite clear that GL_INVALID_OPERATION should be generated. I added a quotation from the 3.3 core profile spec. Fixes the glTexImage3D subcases of ext_packed_depth_stencil-depth-stencil-texture and oes_packed_depth_stencil-depth-stencil-texture_gles2. The same subtests of oes_packed_depth_stencil-depth-stencil-texture_gles1 fail, but they fail with a different wrong error code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/teximage.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 8aac54e9d8d..0ebaeaa529a 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2133,8 +2133,22 @@ texture_error_check( struct gl_context *ctx,
/* additional checks for depth textures */
if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT
|| _mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_STENCIL) {
- /* Only 1D, 2D, rect, array and cube textures supported, not 3D
- * Cubemaps are only supported for GL version > 3.0 or with EXT_gpu_shader4 */
+ /* Section 3.8.3 (Texture Image Specification) of the OpenGL 3.3 Core
+ * Profile spec says:
+ *
+ * "Textures with a base internal format of DEPTH_COMPONENT or
+ * DEPTH_STENCIL are supported by texture image specification
+ * commands only if target is TEXTURE_1D, TEXTURE_2D,
+ * TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_RECTANGLE,
+ * TEXTURE_CUBE_MAP, PROXY_TEXTURE_1D, PROXY_TEXTURE_2D,
+ * PROXY_TEXTURE_1D_ARRAY, PROXY_TEXTURE_2D_ARRAY,
+ * PROXY_TEXTURE_RECTANGLE, or PROXY_TEXTURE_CUBE_MAP. Using these
+ * formats in conjunction with any other target will result in an
+ * INVALID_OPERATION error."
+ *
+ * Cubemaps are only supported with desktop OpenGL version >= 3.0,
+ * EXT_gpu_shader4, or, on OpenGL ES 2.0+, OES_depth_texture_cube_map.
+ */
if (target != GL_TEXTURE_1D &&
target != GL_PROXY_TEXTURE_1D &&
target != GL_TEXTURE_2D &&
@@ -2151,7 +2165,7 @@ texture_error_check( struct gl_context *ctx,
!((target == GL_TEXTURE_CUBE_MAP_ARRAY ||
target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY) &&
ctx->Extensions.ARB_texture_cube_map_array)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
+ _mesa_error(ctx, GL_INVALID_OPERATION,
"glTexImage%dD(bad target for depth texture)",
dimensions);
return GL_TRUE;