Cc: Nanley Chery <[email protected]>
Signed-off-by: Anuj Phogat <[email protected]>
---
 .../oes_compressed_astc-miptree-3d.c               | 35 +++++++++++-----------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git 
a/tests/spec/oes_texture_compression_astc/oes_compressed_astc-miptree-3d.c 
b/tests/spec/oes_texture_compression_astc/oes_compressed_astc-miptree-3d.c
index d743f3c..0219e52 100644
--- a/tests/spec/oes_texture_compression_astc/oes_compressed_astc-miptree-3d.c
+++ b/tests/spec/oes_texture_compression_astc/oes_compressed_astc-miptree-3d.c
@@ -212,10 +212,6 @@ bool draw_compare_levels(bool check_error,
                        y += h;
        }
 
-       /* Delete bound textures */
-       glDeleteTextures(1, &compressed_tex);
-       glDeleteTextures(1, &decompressed_tex);
-
        piglit_present_results();
        return result;
 }
@@ -265,22 +261,21 @@ test_miptrees(void* input_type)
                piglit_set_tolerance_for_bits(8, 8, 8, 8);
 
        for ( ; block_dims < ARRAY_SIZE(block_dim_str); ++block_dims) {
-               for (slice = 0; slice < LEVEL0_DEPTH; slice++) {
-
-                       /* Texture objects. */
-                       GLuint tex_compressed = 0;
-                       GLuint tex_decompressed = 0;
-
-                       /* Load texture for current submode and block size */
-                       load_texture("compressed/3D", tests[subtest],
+               /* Texture objects. */
+               GLuint tex_compressed = 0;
+               GLuint tex_decompressed = 0;
+
+               /* Load texture for current submode and block size */
+               load_texture("compressed/3D", tests[subtest],
+                            block_dim_str[block_dims],
+                            &tex_compressed);
+               if (!check_error) {
+                       load_texture("decompressed/3D", tests[subtest],
                                     block_dim_str[block_dims],
-                                    &tex_compressed);
-                       if (!check_error) {
-                               load_texture("decompressed/3D", tests[subtest],
-                                            block_dim_str[block_dims],
-                                            &tex_decompressed);
-                       }
+                                    &tex_decompressed);
+               }
 
+               for (slice = 0; slice < LEVEL0_DEPTH; slice++) {
                        /* Draw and compare each level of the two textures */
                        glClear(GL_COLOR_BUFFER_BIT);
                        if (!draw_compare_levels(check_error,
@@ -296,6 +291,10 @@ test_miptrees(void* input_type)
                                return PIGLIT_FAIL;
                        }
                }
+               /* Delete bound textures */
+               glDeleteTextures(1, &tex_compressed);
+               if (!check_error)
+                       glDeleteTextures(1, &tex_decompressed);
        }
        return PIGLIT_PASS;
 }
-- 
2.5.5

_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to