summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2019-04-11 10:10:04 +0200
committerThomas Hellstrom <[email protected]>2019-06-20 09:30:22 +0200
commit3b828c4e68bf4addd3b70cd6df92b80e9a40a7a7 (patch)
tree58a73aba894b792fa5f9506e100944a6551acde4 /src/gallium/drivers/svga
parentf51915ba62aebfda5fc3b15d90540bd3f6a981ea (diff)
svga: Map vertex- index- and constant buffers ansynchronously when reading
With SWTNL and index translation we're mapping buffers for reading. These buffers are commonly upload_mgr buffers that might already be referenced by another submitted or unsubmitted GPU command. A synchronous map will then trigger a flush and sync, at least on Linux that doesn't distinguish between read- and write referencing. So map these buffers async. If they for some obscure reason happen to be dirty (stream-output, buffer-copy), the resource_buffer code will read-back and sync anyway. For persistent / coherent buffers a corresponding read-back and sync will happen in the kernel fault handler. Testing: Piglit quick. No regressions. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_draw_elements.c4
-rw-r--r--src/gallium/drivers/svga/svga_swtnl_draw.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c
index b955b2f77e2..41cd4d18993 100644
--- a/src/gallium/drivers/svga/svga_draw_elements.c
+++ b/src/gallium/drivers/svga/svga_draw_elements.c
@@ -120,7 +120,9 @@ translate_indices(struct svga_hwtnl *hwtnl,
goto fail;
*out_offset = 0;
- src_map = pipe_buffer_map(pipe, info->index.resource, PIPE_TRANSFER_READ,
+ src_map = pipe_buffer_map(pipe, info->index.resource,
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
&src_transfer);
if (!src_map)
goto fail;
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c
index a7db73e02ee..1aa15d8cd26 100644
--- a/src/gallium/drivers/svga/svga_swtnl_draw.c
+++ b/src/gallium/drivers/svga/svga_swtnl_draw.c
@@ -73,7 +73,8 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
if (svga->curr.vb[i].buffer.resource) {
map = pipe_buffer_map(&svga->pipe,
svga->curr.vb[i].buffer.resource,
- PIPE_TRANSFER_READ,
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
&vb_transfer[i]);
draw_set_mapped_vertex_buffer(draw, i, map, ~0);
@@ -88,7 +89,8 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
map = (ubyte *) info->index.user;
} else {
map = pipe_buffer_map(&svga->pipe, info->index.resource,
- PIPE_TRANSFER_READ, &ib_transfer);
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED, &ib_transfer);
}
draw_set_indexes(draw,
(const ubyte *) map,
@@ -103,7 +105,8 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
map = pipe_buffer_map(&svga->pipe,
svga->curr.constbufs[PIPE_SHADER_VERTEX][i].buffer,
- PIPE_TRANSFER_READ,
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
&cb_transfer[i]);
assert(map);
draw_set_mapped_constant_buffer(