From 9130ec005fbc78a62420643414d8354d0929ca50 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 22 Jul 2021 10:50:50 +0000 Subject: Merge Mesa 21.1.5 --- lib/mesa/src/gallium/auxiliary/util/u_suballoc.h | 33 ++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'lib/mesa/src/gallium/auxiliary/util/u_suballoc.h') diff --git a/lib/mesa/src/gallium/auxiliary/util/u_suballoc.h b/lib/mesa/src/gallium/auxiliary/util/u_suballoc.h index e35382f04..ed95e7c32 100644 --- a/lib/mesa/src/gallium/auxiliary/util/u_suballoc.h +++ b/lib/mesa/src/gallium/auxiliary/util/u_suballoc.h @@ -31,12 +31,31 @@ #ifndef U_SUBALLOC #define U_SUBALLOC -struct u_suballocator; +#ifdef __cplusplus +extern "C" { +#endif + +struct pipe_context; + +struct u_suballocator { + struct pipe_context *pipe; + + unsigned size; /* Size of the whole buffer, in bytes. */ + unsigned bind; /* Bitmask of PIPE_BIND_* flags. */ + enum pipe_resource_usage usage; + unsigned flags; /* bitmask of PIPE_RESOURCE_FLAG_x */ + boolean zero_buffer_memory; /* If the buffer contents should be zeroed. */ -struct u_suballocator * -u_suballocator_create(struct pipe_context *pipe, unsigned size, unsigned bind, - enum pipe_resource_usage usage, unsigned flags, - boolean zero_buffer_memory); + struct pipe_resource *buffer; /* The buffer we suballocate from. */ + unsigned offset; /* Aligned offset pointing at the first unused byte. */ +}; + +void +u_suballocator_init(struct u_suballocator *allocator, + struct pipe_context *pipe, + unsigned size, unsigned bind, + enum pipe_resource_usage usage, unsigned flags, + boolean zero_buffer_memory); void u_suballocator_destroy(struct u_suballocator *allocator); @@ -46,4 +65,8 @@ u_suballocator_alloc(struct u_suballocator *allocator, unsigned size, unsigned alignment, unsigned *out_offset, struct pipe_resource **outbuf); +#ifdef __cplusplus +} +#endif + #endif -- cgit v1.2.3