summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/freedreno/a6xx/fd6_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/a6xx/fd6_texture.c')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_texture.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c
index e516e94b0d9..af5f49fd3f2 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c
@@ -246,7 +246,7 @@ fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
so->texconst0 =
A6XX_TEX_CONST_0_FMT(fd6_pipe2tex(format)) |
A6XX_TEX_CONST_0_SAMPLES(fd_msaa_samples(prsc->nr_samples)) |
- fd6_tex_swiz(format, cso->swizzle_r, cso->swizzle_g,
+ fd6_tex_swiz(prsc, cso->swizzle_r, cso->swizzle_g,
cso->swizzle_b, cso->swizzle_a);
/* NOTE: since we sample z24s8 using 8888_UINT format, the swizzle
@@ -257,8 +257,12 @@ fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
* Note that gallium expects stencil sampler to return (s,s,s,s)
* which isn't quite true. To make that happen we'd have to massage
* the swizzle. But in practice only the .x component is used.
+ *
+ * Skip this in the tile case because tiled formats are not swapped
+ * and we have already applied the inverse swap in fd6_tex_swiz()
+ * to componsate for that.
*/
- if (format == PIPE_FORMAT_X24S8_UINT) {
+ if ((format == PIPE_FORMAT_X24S8_UINT) && !rsc->tile_mode) {
so->texconst0 |= A6XX_TEX_CONST_0_SWAP(XYZW);
}