diff options
author | Dave Airlie <airlied@redhat.com> | 2020-08-12 15:48:42 +1000 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2020-08-19 22:28:30 +0200 |
commit | 1a588504bdcbfe5fdd4c1121d901c15cdda370dc (patch) | |
tree | 65fce45fc735f6faf730a0d11e3010a0ff1a74c7 /src | |
parent | 18b72e3c8f73113d3a9fcfe2a112d332c777bc3b (diff) |
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@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6287>
(cherry picked from commit 430e3310e2aed924dc4e0729644e629007d73ef7)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
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], |