From 9a29d08f9f624a2ce0d55a7a041f0db2b11f8925 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 8 Jun 2024 22:58:49 -0400 Subject: [PATCH] asahi: fix vbo clamp with stride=0 dEQP-VK.pipeline.monolithic.bind_buffers_2.single.stride_0_4_offset_0_0.count_1 Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/agx_helpers.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/asahi/lib/agx_helpers.h b/src/asahi/lib/agx_helpers.h index a9091ce062b..07baf8163fb 100644 --- a/src/asahi/lib/agx_helpers.h +++ b/src/asahi/lib/agx_helpers.h @@ -224,7 +224,12 @@ agx_calculate_vbo_clamp(uint64_t vbuf, uint64_t sink, enum pipe_format format, */ if (size_B >= subtracted_B) { *vbuf_out = vbuf + offset_B; - return (size_B - subtracted_B) / stride_B; + + /* If stride is zero, do not clamp, everything is valid. */ + if (stride_B) + return ((size_B - subtracted_B) / stride_B); + else + return UINT32_MAX; } else { *vbuf_out = sink; return 0;