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 <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
This commit is contained in:
Asahi Lina 2022-12-07 21:43:43 +09:00 committed by Marge Bot
parent 331c2f4b7e
commit cea15fe06d

View file

@ -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);