virgl: support write-back with staged transfers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 4 Apr 2019 15:27:52 +0000 (17:27 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 17 Apr 2019 07:27:08 +0000 (07:27 +0000)
commitafbd68378a4d052c4ff02cac3cd4739d7fd13336
tree131ec4858d5ab594113eb54fb905f9787391d106
parent0bc8683ffa10350e98c0be5bd2d740593aeb0966
virgl: support write-back with staged transfers

We currently don't support writing to resources that uses a temporary
staging-resource to resolve the pixels. If a write-bit was set, we
forgot to perform a blit back to the old resource, followed by trying to
update the wrong resource, which lacks backing-storage. The end-result
would be that nothing useful happened.

This approach also fixes a few smaller bugs, like using the wrong box
(without x y and z zeroed out), which means a partial update of a
multisampled texture could result in the wrong part of the texture being
updated.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_resource.h
src/gallium/drivers/virgl/virgl_texture.c