From: Erik Faye-Lund Date: Thu, 11 Jun 2020 11:03:22 +0000 (+0200) Subject: gallium/hud: don't use user vertex buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3d07c4a35fde31fede3b39d4771d6023b65ecc1;p=mesa.git gallium/hud: don't use user vertex buffers This gains back some performance lost in the previous commit, by bypassing u_vbuf. Reviewed-by: Marek Olšák Part-of: --- 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); }