From a3d07c4a35fde31fede3b39d4771d6023b65ecc1 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 11 Jun 2020 13:03:22 +0200 Subject: [PATCH] gallium/hud: don't use user vertex buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This gains back some performance lost in the previous commit, by bypassing u_vbuf. Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/hud/hud_context.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 2b84e6f88e6..bb614f76a95 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -85,11 +85,14 @@ hud_draw_colored_prims(struct hud_context *hud, unsigned prim, hud->constants.scale[1] = yscale * hud_scale; cso_set_constant_buffer(cso, PIPE_SHADER_VERTEX, 0, &hud->constbuf); - vbuffer.is_user_buffer = true; - vbuffer.buffer.user = buffer; + u_upload_data(hud->pipe->stream_uploader, 0, + num_vertices * 2 * sizeof(float), 16, buffer, + &vbuffer.buffer_offset, &vbuffer.buffer.resource); + u_upload_unmap(hud->pipe->stream_uploader); vbuffer.stride = 2 * sizeof(float); cso_set_vertex_buffers(cso, 0, 1, &vbuffer); + pipe_resource_reference(&vbuffer.buffer.resource, NULL); cso_set_fragment_shader_handle(hud->cso, hud->fs_color); cso_draw_arrays(cso, prim, 0, num_vertices); } -- 2.30.2