Commit d5392bdc authored by Keith Whitwell's avatar Keith Whitwell

util: helpers for is_resource_referenced

parent 2f3492a5
......@@ -264,7 +264,8 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
static INLINE void
pipe_buffer_read(struct pipe_context *pipe,
struct pipe_resource *buf,
unsigned offset, unsigned size,
unsigned offset,
unsigned size,
void *data)
{
struct pipe_transfer *src_transfer;
......
......@@ -25,6 +25,14 @@ void u_resource_destroy_vtbl(struct pipe_screen *screen,
ur->vtbl->resource_destroy(screen, resource);
}
unsigned u_is_resource_referenced_vtbl( struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned face, unsigned level)
{
struct u_resource *ur = u_resource(resource);
return ur->vtbl->is_resource_referenced(pipe, resource, face, level);
}
struct pipe_transfer *u_get_transfer_vtbl(struct pipe_context *context,
struct pipe_resource *resource,
struct pipe_subresource sr,
......
......@@ -63,6 +63,13 @@ void u_default_transfer_flush_region( struct pipe_context *pipe,
*/
}
unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned face, unsigned level)
{
return 0;
}
struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
struct pipe_resource *resource,
struct pipe_subresource sr,
......
......@@ -23,6 +23,10 @@ void u_default_transfer_flush_region( struct pipe_context *pipe,
struct pipe_transfer *transfer,
const struct pipe_box *box);
unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned face, unsigned level);
struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
struct pipe_resource *resource,
struct pipe_subresource sr,
......@@ -49,6 +53,10 @@ struct u_resource_vtbl {
void (*resource_destroy)(struct pipe_screen *,
struct pipe_resource *pt);
unsigned (*is_resource_referenced)(struct pipe_context *pipe,
struct pipe_resource *texture,
unsigned face, unsigned level);
struct pipe_transfer *(*get_transfer)(struct pipe_context *,
struct pipe_resource *resource,
struct pipe_subresource,
......@@ -92,6 +100,10 @@ boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
void u_resource_destroy_vtbl(struct pipe_screen *screen,
struct pipe_resource *resource);
unsigned u_is_resource_referenced_vtbl( struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned face, unsigned level);
struct pipe_transfer *u_get_transfer_vtbl(struct pipe_context *context,
struct pipe_resource *resource,
struct pipe_subresource sr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment