summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_resource_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga/svga_resource_buffer.c')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c
index 34ab9e143e6..fa713ee88ad 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer.c
@@ -87,10 +87,13 @@ svga_buffer_get_transfer(struct pipe_context *pipe,
if (usage & PIPE_TRANSFER_WRITE) {
if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) {
/*
- * Finish writing any pending DMA commands, and tell the host to discard
- * the buffer contents on the next DMA operation.
+ * Flush any pending primitives, finish writing any pending DMA
+ * commands, and tell the host to discard the buffer contents on
+ * the next DMA operation.
*/
+ svga_hwtnl_flush_buffer(svga, resource);
+
if (sbuf->dma.pending) {
svga_buffer_upload_flush(svga, sbuf);
@@ -117,10 +120,12 @@ svga_buffer_get_transfer(struct pipe_context *pipe,
}
} else {
/*
- * Synchronizing, so finish writing any pending DMA command, and
- * ensure the next DMA will be done in order.
+ * Synchronizing, so flush any pending primitives, finish writing any
+ * pending DMA command, and ensure the next DMA will be done in order.
*/
+ svga_hwtnl_flush_buffer(svga, resource);
+
if (sbuf->dma.pending) {
svga_buffer_upload_flush(svga, sbuf);