Mesa (main): radv: fix resetting the entire vertex input dynamic state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 30 15:42:52 UTC 2021


Module: Mesa
Branch: main
Commit: 8f00f19da5b019b12396d2736c27a159d3eb1b21
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f00f19da5b019b12396d2736c27a159d3eb1b21

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Nov 18 12:19:53 2021 +0100

radv: fix resetting the entire vertex input dynamic state

If there is holes, eg. the application firsts set vertex attributes
0 and 1, then vertex attributes 0 and 7, the format of vertex attribute
1 is still the previous one, while it should be FORMAT_INVALID to avoid
a GPU hang.

This fixes a GPU hang with Yuzu.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5627
Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13856>

---

 src/amd/vulkan/radv_cmd_buffer.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 8f9f771dee8..5ce3356fb57 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -5477,14 +5477,7 @@ radv_CmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingD
 
    cmd_buffer->state.vbo_misaligned_mask = 0;
 
-   state->attribute_mask = 0;
-   state->misaligned_mask = 0;
-   state->possibly_misaligned_mask = 0;
-   state->instance_rate_inputs = 0;
-   state->nontrivial_divisors = 0;
-   state->post_shuffle = 0;
-   state->alpha_adjust_lo = 0;
-   state->alpha_adjust_hi = 0;
+   memset(state, 0, sizeof(*state));
 
    enum chip_class chip = cmd_buffer->device->physical_device->rad_info.chip_class;
    for (unsigned i = 0; i < vertexAttributeDescriptionCount; i++) {



More information about the mesa-commit mailing list