Module: Mesa
Branch: staging/22.1
Commit: 8c18efea5050b8d473abd696e6476a52ada9e193
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c18efea5050b8d473abd696e6476a52ada9e193

Author: Brian Paul <[email protected]>
Date:   Tue Jun 14 13:41:21 2022 -0600

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 <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
(cherry picked from commit dfb2ea35315f0d070d3307af8e2474049354a685)

---

 .pick_status.json                                |  2 +-
 src/gallium/drivers/llvmpipe/lp_linear_sampler.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 49323565a8b..946576f5353 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -5179,7 +5179,7 @@
         "description": "llvmpipe: don't allow texture/resource swizzles on 
linear path",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/llvmpipe/lp_linear_sampler.c 
b/src/gallium/drivers/llvmpipe/lp_linear_sampler.c
index 4f11703bfc2..dbd8691f4e6 100644
--- a/src/gallium/drivers/llvmpipe/lp_linear_sampler.c
+++ b/src/gallium/drivers/llvmpipe/lp_linear_sampler.c
@@ -964,7 +964,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,
@@ -996,6 +998,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;
 }
 

Reply via email to