diff options
author | Ian Romanick <[email protected]> | 2013-12-18 14:38:16 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-01-27 14:21:43 -0700 |
commit | af0b34783e4e4f2a5d03444738a785f15bbb755b (patch) | |
tree | fab574383b7b5eac11da6415b5285763632b92ed /src | |
parent | 421b5958eb53fa3558b7be80f3f63aa77d49c336 (diff) |
mesa: Validate internalFormat with target in glTexStorage paths
Fixes the glTexStorage3D failure in
ext_packed_depth_stencil-depth-stencil-texture and
oes_packed_depth_stencil-depth-stencil-texture_gles2.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/teximage.c | 4 | ||||
-rw-r--r-- | src/mesa/main/texstorage.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 0ba3cd29ff1..5bbcae37103 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2013,7 +2013,9 @@ _mesa_legal_texture_base_format_for_target(struct gl_context *ctx, target != GL_PROXY_TEXTURE_2D_ARRAY && target != GL_TEXTURE_RECTANGLE_ARB && target != GL_PROXY_TEXTURE_RECTANGLE_ARB && - !((_mesa_is_cube_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP) && + !((_mesa_is_cube_face(target) || + target == GL_TEXTURE_CUBE_MAP || + target == GL_PROXY_TEXTURE_CUBE_MAP) && (ctx->Version >= 30 || ctx->Extensions.EXT_gpu_shader4 || (ctx->API == API_OPENGLES2 && ctx->Extensions.OES_depth_texture_cube_map))) && !((target == GL_TEXTURE_CUBE_MAP_ARRAY || diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index 22208572f51..c1d2a5a6b77 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -332,6 +332,11 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target, return GL_TRUE; } + /* additional checks for depth textures */ + if (!_mesa_legal_texture_base_format_for_target(ctx, target, internalformat, + dims, "glTexStorage")) + return GL_TRUE; + return GL_FALSE; } |