mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
u_staging: improve interface
This commit is contained in:
parent
c843a60e63
commit
3aaec4750d
2 changed files with 7 additions and 11 deletions
|
|
@ -23,20 +23,16 @@ util_staging_resource_template(struct pipe_resource *pt, unsigned width, unsigne
|
||||||
}
|
}
|
||||||
|
|
||||||
struct util_staging_transfer *
|
struct util_staging_transfer *
|
||||||
util_staging_transfer_new(struct pipe_context *pipe,
|
util_staging_transfer_init(struct pipe_context *pipe,
|
||||||
struct pipe_resource *pt,
|
struct pipe_resource *pt,
|
||||||
struct pipe_subresource sr,
|
struct pipe_subresource sr,
|
||||||
unsigned usage,
|
unsigned usage,
|
||||||
const struct pipe_box *box,
|
const struct pipe_box *box,
|
||||||
bool direct)
|
bool direct, struct util_staging_transfer *tx)
|
||||||
{
|
{
|
||||||
struct pipe_screen *pscreen = pipe->screen;
|
struct pipe_screen *pscreen = pipe->screen;
|
||||||
struct util_staging_transfer *tx;
|
|
||||||
struct pipe_resource staging_resource_template;
|
|
||||||
|
|
||||||
tx = CALLOC_STRUCT(util_staging_transfer);
|
struct pipe_resource staging_resource_template;
|
||||||
if (!tx)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
pipe_resource_reference(&tx->base.resource, pt);
|
pipe_resource_reference(&tx->base.resource, pt);
|
||||||
tx->base.sr = sr;
|
tx->base.sr = sr;
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,15 @@ struct util_staging_transfer {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* user must be stride, slice_stride and offset */
|
/* user must be stride, slice_stride and offset */
|
||||||
/* pt->usage == PIPE_USAGE_DYNAMIC should be a good value to pass for direct */
|
/* pt->usage == PIPE_USAGE_DYNAMIC || pt->usage == PIPE_USAGE_STAGING should be a good value to pass for direct */
|
||||||
/* staging resource is currently created with PIPE_USAGE_DYNAMIC */
|
/* staging resource is currently created with PIPE_USAGE_STAGING */
|
||||||
struct util_staging_transfer *
|
struct util_staging_transfer *
|
||||||
util_staging_transfer_new(struct pipe_context *pipe,
|
util_staging_transfer_init(struct pipe_context *pipe,
|
||||||
struct pipe_resource *pt,
|
struct pipe_resource *pt,
|
||||||
struct pipe_subresource sr,
|
struct pipe_subresource sr,
|
||||||
unsigned usage,
|
unsigned usage,
|
||||||
const struct pipe_box *box,
|
const struct pipe_box *box,
|
||||||
bool direct);
|
bool direct, struct util_staging_transfer *tx);
|
||||||
|
|
||||||
void
|
void
|
||||||
util_staging_transfer_destroy(struct pipe_context *pipe, struct pipe_transfer *ptx);
|
util_staging_transfer_destroy(struct pipe_context *pipe, struct pipe_transfer *ptx);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue