[Piglit] [PATCH 2/5] khr_texture_compression_astc: Skip the decoding for sRGB textures

Nanley Chery nanleychery at gmail.com
Tue Jul 19 18:21:33 UTC 2016


On Thu, Jul 07, 2016 at 04:28:10PM -0700, Anuj Phogat wrote:
> 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.
> 

I've thought about this some more and I'm not sure we want this change.

This patch modifies the test behavior so that sRGB decoding is not
performed for the sRGB textures. This would mean that half of the ASTC
texture formats would not be tested.

On the positive side, the fact that this test passes with
GL_SKIP_DECODE_EXT indicates that we support the 
GL_EXT_texture_sRGB_decode extension with ASTC. (I'm not exactly sure
how this works). We may want to make two calls to draw_compare_levels()
in the sRGB case to test our support for GL_EXT_texture_sRGB_decode.

- Nanley

> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  .../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
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list