summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_texture.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index ac937ec36d1..3bffee9b7a5 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -110,13 +110,13 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
struct virgl_hw_res *hw_res;
bool doflushwait;
- doflushwait = virgl_res_needs_flush_wait(vctx, vtex, usage);
- if (doflushwait)
- ctx->flush(ctx, NULL, 0);
-
trans = virgl_resource_create_transfer(&vctx->transfer_pool, resource,
&vtex->metadata, level, usage, box);
+ doflushwait = virgl_res_needs_flush_wait(vctx, trans);
+ if (doflushwait)
+ ctx->flush(ctx, NULL, 0);
+
if (resource->nr_samples > 1) {
struct pipe_resource tmp_resource;
virgl_init_temp_resource_from_box(&tmp_resource, resource, box,