diff options
author | Anuj Phogat <[email protected]> | 2011-11-23 16:14:43 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-12-05 17:02:05 -0800 |
commit | 29a7d7784def4f37d3fe38a123a17836dd7fafc0 (patch) | |
tree | 28410f918702cc3eaf00131e67d243793c8dfea5 /src/mesa/main | |
parent | 84d6201567ac82dc7350e437c4de488f59acd42e (diff) |
mesa: Allow glTexImage2D with a depth component cube map.
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/teximage.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 99905de3adb..8a002b6755c 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1636,7 +1636,8 @@ texture_error_check( struct gl_context *ctx, /* additional checks for depth textures */ if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ + /* 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 */ if (target != GL_TEXTURE_1D && target != GL_PROXY_TEXTURE_1D && target != GL_TEXTURE_2D && @@ -1646,7 +1647,9 @@ texture_error_check( struct gl_context *ctx, target != GL_TEXTURE_2D_ARRAY && target != GL_PROXY_TEXTURE_2D_ARRAY && target != GL_TEXTURE_RECTANGLE_ARB && - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { + target != GL_PROXY_TEXTURE_RECTANGLE_ARB && + !((_mesa_is_cube_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP) && + (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_gpu_shader4))) { if (!isProxy) _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target/internalFormat)"); |