struct virgl_screen *vs = virgl_screen(ctx->screen);
struct virgl_resource *vbuf = virgl_resource(resource);
struct virgl_transfer *trans;
- void *ptr;
bool readback;
bool flush = false;
if (readback || flush)
vs->vws->resource_wait(vs->vws, vbuf->hw_res);
- ptr = vs->vws->resource_map(vs->vws, vbuf->hw_res);
- if (!ptr) {
+ trans->hw_res_map = vs->vws->resource_map(vs->vws, vbuf->hw_res);
+ if (!trans->hw_res_map) {
virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
return NULL;
}
*transfer = &trans->base;
- return ptr + trans->offset;
+ return trans->hw_res_map + trans->offset;
}
static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
if (readback || flush)
vws->resource_wait(vws, vtex->hw_res);
- void *ptr = vws->resource_map(vws, vtex->hw_res);
- if (!ptr) {
+ trans->hw_res_map = vws->resource_map(vws, vtex->hw_res);
+ if (!trans->hw_res_map) {
virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
return NULL;
}
*transfer = &trans->base;
- return ptr + trans->offset;
+ return trans->hw_res_map + trans->offset;
}
static void *texture_transfer_map_resolve(struct pipe_context *ctx,