summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-05-08 14:53:47 -0700
committerChia-I Wu <[email protected]>2019-05-24 17:37:40 +0000
commitea1e0acfd04826d196c81d75bc16cde8a623caff (patch)
treef2f3a999df7c03579ecb3df1658585e0bc9a38e7 /src
parent56f9b60e50df82c3007264bf46a0d4c467688395 (diff)
virgl: remove an incorrect check in virgl_res_needs_flush
Imagine this resource_copy_region(ctx, dst, ..., src, ...); transfer_map(ctx, src, 0, PIPE_TRANSFER_WRITE, ...); at the beginning of a cmdbuf. We need to flush in transfer_map so that the transfer is not reordered before the resource copy. The check for "vctx->num_draws == 0 && vctx->num_compute == 0" is not enough. Removing the optimization entirely. Because of the more precise resource tracking in the previous commit, I hope the performance impact is minimized. We will have to go with perfect resource tracking, or attempt a more limited optimization, if there are specific cases we really need to optimize for. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/virgl/virgl_resource.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c
index 5d639ce64fd..6e23687b594 100644
--- a/src/gallium/drivers/virgl/virgl_resource.c
+++ b/src/gallium/drivers/virgl/virgl_resource.c
@@ -32,8 +32,6 @@
*
* - synchronization is disabled
* - the resource is not referenced by the current cmdbuf
- * - the current cmdbuf has no draw/compute command that accesses the
- * resource (XXX there are also clear or blit commands)
*/
static bool virgl_res_needs_flush(struct virgl_context *vctx,
struct virgl_transfer *trans)
@@ -47,19 +45,6 @@ static bool virgl_res_needs_flush(struct virgl_context *vctx,
if (!vws->res_is_referenced(vws, vctx->cbuf, res->hw_res))
return false;
- if (res->clean_mask & (1 << trans->base.level)) {
- /* XXX Consider
- *
- * glCopyBufferSubData(src, dst, ...);
- * glBufferSubData(src, ...);
- *
- * at the beginning of a cmdbuf. glBufferSubData will be incorrectly
- * reordered before glCopyBufferSubData.
- */
- if (vctx->num_draws == 0 && vctx->num_compute == 0)
- return false;
- }
-
return true;
}