vrend: prefer glGetTexImage on GL

Given a source and destination image, consider the following sequence
of events:

1) glTexImage with src
2) virgl_resource_copy_region copies src to dst using GL
3) mesa attempts to readback dst, which returns the correct
   result with vrend_transfer_send_getteximage only

Commands that reproduce this scenario on i965/qemu:
   ./bin/arb_copy_image-formats -auto
   ./bin/fbo-generatemipmap-formats GL_ARB_texture_float -auto

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
macos/master
Gurchetan Singh 6 years ago
parent 08b3ddded8
commit 9aa833bafd
  1. 13
      src/vrend_renderer.c

@ -6880,16 +6880,17 @@ static int vrend_renderer_transfer_send_iov(struct vrend_resource *res,
can_readpixels = vrend_format_can_render(res->base.format) || vrend_format_is_ds(res->base.format);
if (can_readpixels) {
if (can_readpixels)
ret = vrend_transfer_send_readpixels(res, iov, num_iovs, info);
} else {
ret = vrend_transfer_send_readonly(res, iov, num_iovs, info);
}
/* Can hit this on a non-error path as well. */
if (ret != 0 && !vrend_state.use_gles) {
ret = vrend_transfer_send_getteximage(res, iov, num_iovs, info);
if (ret) {
if (!vrend_state.use_gles)
ret = vrend_transfer_send_getteximage(res, iov, num_iovs, info);
else
ret = vrend_transfer_send_readonly(res, iov, num_iovs, info);
}
return ret;
}
return 0;

Loading…
Cancel
Save