aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNeha Bhende <[email protected]>2018-01-29 09:32:19 -0700
committerBrian Paul <[email protected]>2018-01-29 21:04:49 -0700
commitd4a5e14fae17c7ea7bb8d1d0d6467fd4e0706dd1 (patch)
treeeeac1b054987286ef928e5e8001edfe9f6fd2b7f /src/gallium
parent6a7d1ca2c49ae06bbb323936f1e1c17ba7e2c9a1 (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_shader.c4
1 files changed, 4 insertions, 0 deletions
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];