Mesa (staging/20.1): llvmpipe: fix occlusion queries on big-endian.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 2 14:36:40 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 95dd7608f4f0bb87f6663c490332cdb6642f5649
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=95dd7608f4f0bb87f6663c490332cdb6642f5649

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jun 29 15:57:14 2020 +1000

llvmpipe: fix occlusion queries on big-endian.

Casting to u8 arrays and picking the lowest byte is fairly LE specific
grab the other byte.

Cc: <mesa-stable at lists.freedesktop.org>

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
(cherry picked from commit b743c9bf2d5c987c97a22e725a56a2b641b58ae4)

---

 .pick_status.json                           | 2 +-
 src/gallium/drivers/llvmpipe/lp_bld_depth.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 1c6e8a7f338..c2bf4b7392a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -634,7 +634,7 @@
         "description": "llvmpipe: fix occlusion queries on big-endian.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
index 3e8b6936b01..5edb54617a5 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
@@ -469,7 +469,11 @@ lp_build_occlusion_count(struct gallivm_state *gallivm,
       countv = LLVMBuildBitCast(builder, countv, i8vntype, "");
 
        for (i = 0; i < type.length; i++) {
+#if UTIL_ARCH_LITTLE_ENDIAN
           shuffles[i] = lp_build_const_int32(gallivm, 4*i);
+#else
+          shuffles[i] = lp_build_const_int32(gallivm, (4*i) + 3);
+#endif
        }
 
        shufflev = LLVMConstVector(shuffles, type.length);



More information about the mesa-commit mailing list