From dfb2ea35315f0d070d3307af8e2474049354a685 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jun 2022 13:41:21 -0600 Subject: [PATCH] llvmpipe: don't allow texture/resource swizzles on linear path This fixes another VMware test (dx9-stretch-formats-copy-a8r8g8b8-x8r8g8b8). Signed-off-by: Brian Paul Reviewed-by: Roland Scheidegger cc: mesa-stable Part-of: --- src/gallium/drivers/llvmpipe/lp_linear_sampler.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_linear_sampler.c b/src/gallium/drivers/llvmpipe/lp_linear_sampler.c index 3a8630e9671..db712bb5ceb 100644 --- a/src/gallium/drivers/llvmpipe/lp_linear_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_linear_sampler.c @@ -940,7 +940,9 @@ lp_linear_init_noop_sampler(struct lp_linear_sampler *samp) samp->base.fetch = fetch_noop; } -/* Check the variant for linear path compatibility. + +/* + * Check the given sampler and texture info for linear path compatibility. */ boolean lp_linear_check_sampler(const struct lp_sampler_static_state *sampler, @@ -972,6 +974,14 @@ lp_linear_check_sampler(const struct lp_sampler_static_state *sampler, sampler->texture_state.format != PIPE_FORMAT_B8G8R8X8_UNORM) return FALSE; + /* We don't support sampler view swizzling on the linear path */ + if (sampler->texture_state.swizzle_r != PIPE_SWIZZLE_X || + sampler->texture_state.swizzle_g != PIPE_SWIZZLE_Y || + sampler->texture_state.swizzle_b != PIPE_SWIZZLE_Z || + sampler->texture_state.swizzle_a != PIPE_SWIZZLE_W) { + return FALSE; + } + return TRUE; }