mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
virgl: do not use inline writes for subdata
Inline writes skip transfer map/unamp at the cost of an extra copy on the data during execbuffer. That is generally a win for small transfers. But the heuristic to use inline writes based on buffer sizes rather than transfer sizes makes little sense. More importantly, inline writes miss optimizations that are done for buffer transfers. Let's just use transfers. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This commit is contained in:
parent
898be8036d
commit
c7078397ca
1 changed files with 7 additions and 4 deletions
|
|
@ -174,6 +174,8 @@ static void virgl_buffer_subdata(struct pipe_context *pipe,
|
|||
unsigned usage, unsigned offset,
|
||||
unsigned size, const void *data)
|
||||
{
|
||||
struct pipe_transfer *transfer;
|
||||
uint8_t *map;
|
||||
struct pipe_box box;
|
||||
|
||||
assert(!(usage & PIPE_TRANSFER_READ));
|
||||
|
|
@ -192,10 +194,11 @@ static void virgl_buffer_subdata(struct pipe_context *pipe,
|
|||
virgl_buffer_transfer_extend(pipe, resource, usage, &box, data))
|
||||
return;
|
||||
|
||||
if (resource->width0 >= getpagesize())
|
||||
u_default_buffer_subdata(pipe, resource, usage, offset, size, data);
|
||||
else
|
||||
virgl_transfer_inline_write(pipe, resource, 0, usage, &box, data, 0, 0);
|
||||
map = pipe->transfer_map(pipe, resource, 0, usage, &box, &transfer);
|
||||
if (map) {
|
||||
memcpy(map, data, size);
|
||||
pipe_transfer_unmap(pipe, transfer);
|
||||
}
|
||||
}
|
||||
|
||||
void virgl_init_context_resource_functions(struct pipe_context *ctx)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue