From 21aaba5b83fd0f104d0ea21359fb6ca4d41cb8de Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 4 Jan 2024 14:13:25 -0400 Subject: [PATCH] asahi: inline something silly Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_uniforms.c | 32 +++++++++++------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_uniforms.c b/src/gallium/drivers/asahi/agx_uniforms.c index 97e8c01ab7b..c5c62f7a115 100644 --- a/src/gallium/drivers/asahi/agx_uniforms.c +++ b/src/gallium/drivers/asahi/agx_uniforms.c @@ -34,27 +34,23 @@ agx_shader_buffer_ptr(struct agx_batch *batch, struct pipe_shader_buffer *sb) } } -static uint64_t -agx_vertex_buffer_ptr(struct agx_batch *batch, unsigned vbo) -{ - struct pipe_vertex_buffer vb = batch->ctx->vertex_buffers[vbo]; - assert(!vb.is_user_buffer); - - if (vb.buffer.resource) { - struct agx_resource *rsrc = agx_resource(vb.buffer.resource); - agx_batch_reads(batch, rsrc); - - return rsrc->bo->ptr.gpu + vb.buffer_offset; - } else { - return 0; - } -} - void agx_upload_vbos(struct agx_batch *batch) { - u_foreach_bit(vbo, batch->ctx->vb_mask) { - batch->uniforms.vbo_base[vbo] = agx_vertex_buffer_ptr(batch, vbo); + struct agx_context *ctx = batch->ctx; + + u_foreach_bit(vbo, ctx->vb_mask) { + struct pipe_vertex_buffer vb = ctx->vertex_buffers[vbo]; + assert(!vb.is_user_buffer); + + if (vb.buffer.resource) { + struct agx_resource *rsrc = agx_resource(vb.buffer.resource); + agx_batch_reads(batch, rsrc); + + batch->uniforms.vbo_base[vbo] = rsrc->bo->ptr.gpu + vb.buffer_offset; + } else { + batch->uniforms.vbo_base[vbo] = 0; + } } }