summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-07-22 07:32:36 -0600
committerBrian Paul <[email protected]>2015-07-23 20:19:50 -0600
commit81e2c256e921ad4f5c13bb0d95bbe0ad232ec37c (patch)
treecdeeeb63db6e6872194cea2ffbcbd4bd23c54af1 /src/mesa/main/teximage.c
parentdbefffa5b4c438008d44db106b5774f575cb495f (diff)
mesa: simplify format check in compressed_subtexture_target_check()
Lose the invalidformat local variable. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index cd451138b1c..4fe6ee4f305 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4586,21 +4586,17 @@ compressed_subtexture_target_check(struct gl_context *ctx, GLenum target,
* are valid here, which they are not, but of course not mentioned by
* core spec.
*/
- if (targetOK && target != GL_TEXTURE_2D_ARRAY &&
- target != GL_TEXTURE_CUBE_MAP_ARRAY) {
- bool invalidformat;
+ if (target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) {
switch (format) {
- /* These came from _mesa_is_compressed_format in glformats.c. */
- case GL_COMPRESSED_RGBA_BPTC_UNORM:
- case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:
- case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:
- case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:
- invalidformat = false;
- break;
- default:
- invalidformat = true;
- }
- if (invalidformat) {
+ /* These are the only 3D compression formats supported at this time */
+ case GL_COMPRESSED_RGBA_BPTC_UNORM:
+ case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:
+ case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:
+ case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:
+ /* valid format */
+ break;
+ default:
+ /* invalid format */
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid target %s for format %s)", caller,
_mesa_enum_to_string(target),