Mesa (staging/21.0): radv: round-up num_records division in radv_flush_vertex_descriptors
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Feb 3 17:29:25 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: adc73b1af6143f631555b5e4abdfc69d7fa23e93
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=adc73b1af6143f631555b5e4abdfc69d7fa23e93
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Mon Nov 30 15:44:08 2020 +0000
radv: round-up num_records division in radv_flush_vertex_descriptors
Vertex attribute bounds checking is supposed to be done per-attribute:
is_oob = index * stride + attrib_offset + attrib_size > buffer_size
but we were obtaining num_records by dividing the buffer size by the
stride, making it per-vertex:
is_oob = index * stride + (stride - 1) >= buffer_size
An example from Dead Cells (Wine) is:
attribute bindings: 0, 1, 2
attribute formats: r32g32, r32g32, r32g32b32a32
attribute offsets: 0, 0, 0
binding buffers: all the same buffer
binding offsets: 0, 8, 16
binding sizes: 128, 120, 112
binding strides: 32, 32, 32
Workaround this issue without switching to per-attribute descriptors by
rounding up the division. This is still incorrect, but it should now no
longer consider in-bounds attributes out-of-bounds.
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3796
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4199
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8835>
(cherry picked from commit 56cd79b63d25ef0d5d795bfa6ab58955b9f96e3b)
---
.gitlab-ci/deqp-radv-navi10-aco-fails.txt | 109 ++++++++++++++++++++++
.gitlab-ci/deqp-radv-navi14-aco-fails.txt | 109 ++++++++++++++++++++++
.gitlab-ci/deqp-radv-pitcairn-aco-fails.txt | 109 ++++++++++++++++++++++
.gitlab-ci/deqp-radv-raven-aco-fails.txt | 109 ++++++++++++++++++++++
.gitlab-ci/deqp-radv-sienna_cichlid-aco-fails.txt | 109 ++++++++++++++++++++++
.gitlab-ci/deqp-radv-vega10-aco-fails.txt | 109 ++++++++++++++++++++++
.pick_status.json | 2 +-
src/amd/vulkan/radv_cmd_buffer.c | 2 +-
8 files changed, 656 insertions(+), 2 deletions(-)
Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=adc73b1af6143f631555b5e4abdfc69d7fa23e93
More information about the mesa-commit
mailing list