From cea15fe06d9e72c65abcdab73c8e41046d2f79f0 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 7 Dec 2022 21:43:43 +0900 Subject: [PATCH] asahi: Don't crash on VBOs without resources There's a Firefox QuakeJS heisenbug that triggers this sometimes, by binding vertex attributes with no buffer... Reviewed-by: Alyssa Rosenzweig Signed-off-by: Asahi Lina Part-of: --- src/gallium/drivers/asahi/agx_uniforms.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_uniforms.c b/src/gallium/drivers/asahi/agx_uniforms.c index 31188a2..c798191 100644 --- a/src/gallium/drivers/asahi/agx_uniforms.c +++ b/src/gallium/drivers/asahi/agx_uniforms.c @@ -75,6 +75,11 @@ agx_push_location_direct(struct agx_batch *batch, struct agx_push push, struct pipe_vertex_buffer vb = ctx->vertex_buffers[push.vbo]; assert(!vb.is_user_buffer); + if (!vb.buffer.resource) { + *address = 0; + return ptr.gpu; + } + struct agx_resource *rsrc = agx_resource(vb.buffer.resource); agx_batch_reads(batch, rsrc); -- 2.7.4