Both compressed and decompressed sRGB textures in the test are decoded
to linear color by sampler. The loss of precision during this conversion
caused the subtest failure. It can be fixed by avoiding the sRGB decoding
for sRGB textures.

Skipping the decoding in non-sRGB cases isn't serving any purpose.

Signed-off-by: Anuj Phogat <[email protected]>
---
 .../spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c 
b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
index 6429c2e..5126820 100644
--- a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
+++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
@@ -171,7 +171,7 @@ bool draw_compare_levels(bool check_error, bool check_srgb,
 
                /* Draw miplevel of compressed texture. */
                glBindTexture(GL_TEXTURE_2D, compressed_tex);
-               if (!check_srgb)
+               if (check_srgb)
                        glTexParameteri(GL_TEXTURE_2D,
                                        GL_TEXTURE_SRGB_DECODE_EXT,
                                        GL_SKIP_DECODE_EXT);
@@ -181,7 +181,7 @@ bool draw_compare_levels(bool check_error, bool check_srgb,
                /* Draw miplevel of decompressed texture. */
                if (!check_error) {
                        glBindTexture(GL_TEXTURE_2D, decompressed_tex);
-                       if (!check_srgb)
+                       if (check_srgb)
                                glTexParameteri(GL_TEXTURE_2D,
                                                GL_TEXTURE_SRGB_DECODE_EXT,
                                                GL_SKIP_DECODE_EXT);
@@ -244,7 +244,7 @@ test_miptrees(void* input_type)
                "12x12"
        };
 
-       if (!is_srgb_test)
+       if (is_srgb_test)
                piglit_require_extension("GL_EXT_texture_sRGB_decode");
 
        GLint pixel_offset_loc = glGetUniformLocation(prog, "pixel_offset");
-- 
2.5.5

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

Reply via email to