util: s/unsigned/enum pipe_resource_usage/ for buffer usage variables
authorBrian Paul <brianp@vmware.com>
Wed, 25 May 2016 23:13:56 +0000 (17:13 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 26 May 2016 23:44:18 +0000 (17:44 -0600)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/util/u_debug.c
src/gallium/auxiliary/util/u_debug.h
src/gallium/auxiliary/util/u_inlines.h
src/gallium/auxiliary/util/u_staging.c
src/gallium/auxiliary/util/u_staging.h
src/gallium/auxiliary/util/u_suballoc.c
src/gallium/auxiliary/util/u_suballoc.h
src/gallium/auxiliary/util/u_upload_mgr.c
src/gallium/auxiliary/util/u_upload_mgr.h

index db6635713e5183000cfb6e51a07d8e531fde5cb8..0d63cfee5e85ab639003661fe29326e774b18357 100644 (file)
@@ -550,7 +550,7 @@ debug_print_bind_flags(const char *msg, unsigned usage)
  * 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),
index 85d0cb64e6c837624d0219e598da5c31f47c1cb1..7da7f53da573d4dde72bbea504bead07b1a77ed1 100644 (file)
@@ -473,7 +473,7 @@ void
 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
index 07c058abfba60322d43a68ed7c8599511aff9de0..a38223ca33c437994dff6b8449e8a15a6a285b35 100644 (file)
@@ -230,12 +230,12 @@ pipe_surface_equal(struct pipe_surface *s1, struct pipe_surface *s2)
 /**
  * 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;
@@ -395,7 +395,7 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
 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)
 {
index caef2a8245c21c99f35cf035ddf0ca81cdef9c01..5b61f5e0041b093f071551c7184b7f7f4e69d4f3 100644 (file)
@@ -56,7 +56,7 @@ util_staging_resource_template(struct pipe_resource *pt, unsigned width,
 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)
 {
index 6c468aad161072e00e26eecc957346d84e985c57..eed5584e0db5e591b14c0c7d5afe8ad225639310 100644 (file)
@@ -56,7 +56,7 @@ struct util_staging_transfer {
 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);
 
index efa9a0c5e09755f985da9a30f98a427027ac7bef..3f9ede075f22c7dbf08cd6c26d3635a3365e2947 100644 (file)
@@ -43,7 +43,7 @@ struct u_suballocator {
    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. */
@@ -59,7 +59,8 @@ 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)
 {
    struct u_suballocator *allocator = CALLOC_STRUCT(u_suballocator);
index 1f5550ffae36d7ae7cb149d937ba125da1aff64c..5f9ccde798063f8c2664dc014bd47cac3faeb010 100644 (file)
@@ -35,7 +35,8 @@ 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
index aa31ef2a4bd835abb11249ba4ca56c5f430e0eba..cfef1f0693b8a99160b078a1006d27daa99580ad 100644 (file)
@@ -43,7 +43,7 @@ struct u_upload_mgr {
 
    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. */
 
@@ -57,7 +57,7 @@ struct u_upload_mgr {
 
 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)
index 1d933d754ae07434ceae10b84364524fc0e99e96..6c70723ecc696c0998de8033af217c5aa1ee5670 100644 (file)
@@ -48,7 +48,7 @@ struct pipe_resource;
  */
 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.