Mesa (staging/20.1): llvmpipe: only read 0 for channels being read

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 17 10:41:32 UTC 2020


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Aug 12 15:48:42 2020 +1000

llvmpipe: only read 0 for channels being read

KHR-GL45.robust_buffer_access_behavior.vertex_buffer_objects
on the CTS 4.6.0 branch and this fixes it.

Roland identified that if the vertex format doesn't contain channels
then we shouldn't be overriding them to 0, so RGB fetch out of bounds
should return 0 for RGB, but the A channel should still be getting back
1.

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/6287>
(cherry picked from commit 430e3310e2aed924dc4e0729644e629007d73ef7)

---

 .pick_status.json                      | 2 +-
 src/gallium/auxiliary/draw/draw_llvm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 56f68ef87a4..1633613c768 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -526,7 +526,7 @@
         "description": "llvmpipe: only read 0 for channels being read",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index f87d4667eff..2fdbd55718c 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1070,7 +1070,7 @@ fetch_vector(struct gallivm_state *gallivm,
    }
 
    /* out-of-bound fetches return all zeros */
-   for (i = 0; i < TGSI_NUM_CHANNELS; i++) {
+   for (i = 0; i < format_desc->nr_channels; i++) {
       inputs[i] = LLVMBuildBitCast(builder, inputs[i], blduivec.vec_type, "");
       inputs[i] = LLVMBuildAnd(builder, inputs[i], valid_mask, "");
       inputs[i] = LLVMBuildBitCast(builder, inputs[i],



More information about the mesa-commit mailing list