summaryrefslogtreecommitdiff
path: root/src/asahi
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>2024-06-08 22:58:49 -0400
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>2024-06-16 12:15:22 -0400
commit9a29d08f9f624a2ce0d55a7a041f0db2b11f8925 (patch)
treef02f8d66856761aaae6838d9bddbb63cd143da10 /src/asahi
parent38c36990b672c5a852f736d3ea3b5d63b0cb1d9e (diff)
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 <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
Diffstat (limited to 'src/asahi')
-rw-r--r--src/asahi/lib/agx_helpers.h7
1 files changed, 6 insertions, 1 deletions
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;