diff --git a/src/gallium/drivers/virgl/ci/virpipe-gl-fails.txt b/src/gallium/drivers/virgl/ci/virpipe-gl-fails.txt index 33387e6fd2c..e28ae57c131 100644 --- a/src/gallium/drivers/virgl/ci/virpipe-gl-fails.txt +++ b/src/gallium/drivers/virgl/ci/virpipe-gl-fails.txt @@ -434,8 +434,6 @@ spec@arb_point_sprite@arb_point_sprite-mipmap,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex@'vs_input2[1][0]' on GL_PROGRAM_INPUT,Fail -spec@arb_shader_atomic_counters@fragment-discard,Fail - spec@arb_sample_shading@builtin-gl-sample-position 2,Fail spec@arb_shader_image_load_store@early-z,Fail spec@arb_shader_image_load_store@early-z@occlusion query test/early-z pass,Fail diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c index 461c1768ed8..f8edcc182bc 100644 --- a/src/gallium/drivers/virgl/virgl_resource.c +++ b/src/gallium/drivers/virgl/virgl_resource.c @@ -253,11 +253,6 @@ virgl_resource_transfer_prepare(struct virgl_context *vctx, else return VIRGL_TRANSFER_MAP_WRITE_TO_STAGING_WITH_READBACK; } - /* Readback is yet another command and is transparent to the state - * trackers. It should be waited for in all cases, including when - * PIPE_MAP_UNSYNCHRONIZED is set. - */ - wait = true; /* When the transfer queue has pending writes to this transfer's region, * we have to flush before readback. @@ -281,8 +276,16 @@ virgl_resource_transfer_prepare(struct virgl_context *vctx, return VIRGL_TRANSFER_MAP_ERROR; if (readback) { + /* Readback is yet another command and is transparent to the state + * trackers. It should be waited for in all cases, including when + * PIPE_MAP_UNSYNCHRONIZED is set. + */ + vws->resource_wait(vws, res->hw_res); vws->transfer_get(vws, res->hw_res, &xfer->base.box, xfer->base.stride, xfer->l_stride, xfer->offset, xfer->base.level); + /* transfer_get puts the resource into a maybe_busy state, so we will have + * to wait another time if we want to use that resource. */ + wait = true; } if (wait)