* Print PIPE_USAGE_x enum values with a message.
*/
void
-debug_print_usage_enum(const char *msg, unsigned usage)
+debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage)
{
static const struct debug_named_value names[] = {
DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT),
debug_print_bind_flags(const char *msg, unsigned usage);
void
-debug_print_usage_enum(const char *msg, unsigned usage);
+debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage);
#ifdef __cplusplus
/**
* Create a new resource.
* \param bind bitmask of PIPE_BIND_x flags
- * \param usage bitmask of PIPE_USAGE_x flags
+ * \param usage a PIPE_USAGE_x value
*/
static inline struct pipe_resource *
pipe_buffer_create( struct pipe_screen *screen,
unsigned bind,
- unsigned usage,
+ enum pipe_resource_usage usage,
unsigned size )
{
struct pipe_resource buffer;
static inline struct pipe_resource *
pipe_buffer_create_with_data(struct pipe_context *pipe,
unsigned bind,
- unsigned usage,
+ enum pipe_resource_usage usage,
unsigned size,
const void *ptr)
{
struct util_staging_transfer *
util_staging_transfer_init(struct pipe_context *pipe,
struct pipe_resource *pt,
- unsigned level, unsigned usage,
+ unsigned level, enum pipe_resource_usage usage,
const struct pipe_box *box,
boolean direct, struct util_staging_transfer *tx)
{
struct util_staging_transfer *
util_staging_transfer_init(struct pipe_context *pipe,
struct pipe_resource *pt,
- unsigned level, unsigned usage,
+ unsigned level, enum pipe_resource_usage usage,
const struct pipe_box *box,
boolean direct, struct util_staging_transfer *tx);
unsigned size; /* Size of the whole buffer, in bytes. */
unsigned alignment; /* Alignment of each sub-allocation. */
unsigned bind; /* Bitmask of PIPE_BIND_* flags. */
- unsigned usage; /* One of PIPE_USAGE_* flags. */
+ enum pipe_resource_usage usage;
boolean zero_buffer_memory; /* If the buffer contents should be zeroed. */
struct pipe_resource *buffer; /* The buffer we suballocate from. */
*/
struct u_suballocator *
u_suballocator_create(struct pipe_context *pipe, unsigned size,
- unsigned alignment, unsigned bind, unsigned usage,
+ unsigned alignment, unsigned bind,
+ enum pipe_resource_usage usage,
boolean zero_buffer_memory)
{
struct u_suballocator *allocator = CALLOC_STRUCT(u_suballocator);
struct u_suballocator *
u_suballocator_create(struct pipe_context *pipe, unsigned size,
- unsigned alignment, unsigned bind, unsigned usage,
+ unsigned alignment, unsigned bind,
+ enum pipe_resource_usage usage,
boolean zero_buffer_memory);
void
unsigned default_size; /* Minimum size of the upload buffer, in bytes. */
unsigned bind; /* Bitmask of PIPE_BIND_* flags. */
- unsigned usage; /* PIPE_USAGE_* */
+ enum pipe_resource_usage usage;
unsigned map_flags; /* Bitmask of PIPE_TRANSFER_* flags. */
boolean map_persistent; /* If persistent mappings are supported. */
struct u_upload_mgr *
u_upload_create(struct pipe_context *pipe, unsigned default_size,
- unsigned bind, unsigned usage)
+ unsigned bind, enum pipe_resource_usage usage)
{
struct u_upload_mgr *upload = CALLOC_STRUCT( u_upload_mgr );
if (!upload)
*/
struct u_upload_mgr *
u_upload_create(struct pipe_context *pipe, unsigned default_size,
- unsigned bind, unsigned usage);
+ unsigned bind, enum pipe_resource_usage usage);
/**
* Destroy the upload manager.