r600: fix evergreen_emit_vertex_buffers() related cl regression

For instance, this issue is triggered with "piglit/bin/cl-custom-buffer-flags":
Segmentation fault

Fixes: 81889f4d5c ("r600: ensure that the last vertex is always processed on evergreen")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33351>
(cherry picked from commit ee1cb894d6)
This commit is contained in:
Patrick Lerda 2025-02-02 20:46:12 +01:00 committed by Eric Engestrom
parent 4607eb7eae
commit ebca2fafa8
2 changed files with 3 additions and 2 deletions

View file

@ -14,7 +14,7 @@
"description": "r600: fix evergreen_emit_vertex_buffers() related cl regression",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "81889f4d5c1ffbd048cd3781f2e99e62853cd6fe",
"notes": null

View file

@ -2142,7 +2142,8 @@ static void evergreen_emit_vertex_buffers(struct r600_context *rctx,
radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 8, 0) | pkt_flags);
radeon_emit(cs, (resource_offset + buffer_index) * 8);
radeon_emit(cs, va); /* RESOURCEi_WORD0 */
radeon_emit(cs, rbuffer->b.b.width0 - vb->buffer_offset - 1 + shader->width_correction[buffer_index]); /* RESOURCEi_WORD1 */
radeon_emit(cs, rbuffer->b.b.width0 - vb->buffer_offset - 1 +
(shader ? shader->width_correction[buffer_index] : 0)); /* RESOURCEi_WORD1 */
radeon_emit(cs, /* RESOURCEi_WORD2 */
S_030008_ENDIAN_SWAP(r600_endian_swap(32)) |
S_030008_STRIDE(stride) |