diff options
author | Gurchetan Singh <[email protected]> | 2018-11-30 14:54:33 -0800 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-12-19 13:29:16 +0100 |
commit | 174f530008c1b22ede7c67995f693b3d84f2a488 (patch) | |
tree | e6f2b9bacfb6b7ef3ae2dbc21469012d519720a6 /src/gallium/drivers/virgl/virgl_resource.h | |
parent | 13626b46f12eaa5ffb6c3eb72eea755e739b0b01 (diff) |
virgl: consolidate transfer code
We could allocate and destroy transfers in one place.
v2: Keep l_stride around.
Reviewed-by: Elie Tournier <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_resource.h')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_resource.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/virgl/virgl_resource.h b/src/gallium/drivers/virgl/virgl_resource.h index 5faedb47866..d41b9906fb1 100644 --- a/src/gallium/drivers/virgl/virgl_resource.h +++ b/src/gallium/drivers/virgl/virgl_resource.h @@ -74,7 +74,8 @@ struct virgl_texture { struct virgl_transfer { struct pipe_transfer base; - uint32_t offset; + uint32_t offset, l_stride; + struct util_range range; struct virgl_resource *resolve_tmp; }; @@ -155,7 +156,14 @@ bool virgl_res_needs_readback(struct virgl_context *vctx, void virgl_resource_layout(struct pipe_resource *pt, struct virgl_resource_metadata *metadata); -unsigned virgl_resource_offset(struct pipe_resource *pres, - struct virgl_resource_metadata *metadata, - unsigned level, unsigned layer); +struct virgl_transfer * +virgl_resource_create_transfer(struct pipe_context *ctx, + struct pipe_resource *pres, + const struct virgl_resource_metadata *metadata, + unsigned level, unsigned usage, + const struct pipe_box *box); + +void virgl_resource_destroy_transfer(struct virgl_context *vctx, + struct virgl_transfer *trans); + #endif |