From d4a5e14fae17c7ea7bb8d1d0d6467fd4e0706dd1 Mon Sep 17 00:00:00 2001 From: Neha Bhende Date: Mon, 29 Jan 2018 09:32:19 -0700 Subject: svga: Adjust alpha for S3TC_DXT1_EXT RGB formats According to spec, S3TC_DXT1_EXT RGB formats are supposed to be opaque. Correspoding svga formats are not handling it so explicitly setting it to 1.0. This fixes piglit test spec@ext_texture_compression_s3tc@s3tc-targeted Note: This test is testcase for freedesktop bug 100925 Tested with mtt-piglit and mtt-glretrace on 8,9,10,11 and 15 Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_shader.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/drivers/svga') diff --git a/src/gallium/drivers/svga/svga_shader.c b/src/gallium/drivers/svga/svga_shader.c index 9e2b65771cd..c9cc0f739a3 100644 --- a/src/gallium/drivers/svga/svga_shader.c +++ b/src/gallium/drivers/svga/svga_shader.c @@ -234,6 +234,10 @@ svga_init_shader_key_common(const struct svga_context *svga, svga_texture_device_format_has_alpha(view->texture)) ? set_alpha : copy_alpha; + if (view->texture->format == PIPE_FORMAT_DXT1_RGB || + view->texture->format == PIPE_FORMAT_DXT1_SRGB) + swizzle_tab = set_alpha; + key->tex[i].swizzle_r = swizzle_tab[view->swizzle_r]; key->tex[i].swizzle_g = swizzle_tab[view->swizzle_g]; key->tex[i].swizzle_b = swizzle_tab[view->swizzle_b]; -- cgit v1.2.3