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 430e3310e2)
This commit is contained in:
Dave Airlie 2020-08-12 15:48:42 +10:00 committed by Eric Engestrom
parent 18b72e3c8f
commit 1a588504bd
2 changed files with 2 additions and 2 deletions

View file

@ -2101,7 +2101,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
},

View file

@ -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],