u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_
authorMarek Olšák <maraeo@gmail.com>
Sun, 25 Sep 2011 17:16:21 +0000 (19:16 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 26 Sep 2011 13:25:04 +0000 (15:25 +0200)
src/gallium/auxiliary/util/u_vbuf_mgr.c
src/gallium/auxiliary/util/u_vbuf_mgr.h
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state_common.c

index 66c90a58d27e6d9069a9362a4ef529517d18cd7d..6bfbe865f6967f1cbc7f894276491829f18785e3 100644 (file)
@@ -34,7 +34,7 @@
 #include "translate/translate.h"
 #include "translate/translate_cache.h"
 
-struct u_vbuf_mgr_elements {
+struct u_vbuf_elements {
    unsigned count;
    struct pipe_vertex_element ve[PIPE_MAX_ATTRIBS];
 
@@ -52,14 +52,14 @@ struct u_vbuf_mgr_elements {
    boolean incompatible_layout;
 };
 
-struct u_vbuf_mgr_priv {
+struct u_vbuf_priv {
    struct u_vbuf_mgr b;
    struct pipe_context *pipe;
 
    struct translate_cache *translate_cache;
    unsigned translate_vb_slot;
 
-   struct u_vbuf_mgr_elements *ve;
+   struct u_vbuf_elements *ve;
    void *saved_ve, *fallback_ve;
    boolean ve_binding_lock;
 
@@ -67,7 +67,7 @@ struct u_vbuf_mgr_priv {
    boolean incompatible_vb_layout;
 };
 
-static void u_vbuf_mgr_init_format_caps(struct u_vbuf_mgr_priv *mgr)
+static void u_vbuf_init_format_caps(struct u_vbuf_priv *mgr)
 {
    struct pipe_screen *screen = mgr->pipe->screen;
 
@@ -97,13 +97,13 @@ static void u_vbuf_mgr_init_format_caps(struct u_vbuf_mgr_priv *mgr)
 }
 
 struct u_vbuf_mgr *
-u_vbuf_mgr_create(struct pipe_context *pipe,
-                  unsigned upload_buffer_size,
-                  unsigned upload_buffer_alignment,
-                  unsigned upload_buffer_bind,
-                  enum u_fetch_alignment fetch_alignment)
+u_vbuf_create(struct pipe_context *pipe,
+              unsigned upload_buffer_size,
+              unsigned upload_buffer_alignment,
+              unsigned upload_buffer_bind,
+              enum u_fetch_alignment fetch_alignment)
 {
-   struct u_vbuf_mgr_priv *mgr = CALLOC_STRUCT(u_vbuf_mgr_priv);
+   struct u_vbuf_priv *mgr = CALLOC_STRUCT(u_vbuf_priv);
 
    mgr->pipe = pipe;
    mgr->translate_cache = translate_cache_create();
@@ -115,14 +115,14 @@ u_vbuf_mgr_create(struct pipe_context *pipe,
    mgr->b.caps.fetch_dword_unaligned =
          fetch_alignment == U_VERTEX_FETCH_BYTE_ALIGNED;
 
-   u_vbuf_mgr_init_format_caps(mgr);
+   u_vbuf_init_format_caps(mgr);
 
    return &mgr->b;
 }
 
-void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgrb)
+void u_vbuf_destroy(struct u_vbuf_mgr *mgrb)
 {
-   struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+   struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
    unsigned i;
 
    for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
@@ -139,7 +139,7 @@ void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgrb)
 
 
 static enum u_vbuf_return_flags
-u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
+u_vbuf_translate_begin(struct u_vbuf_priv *mgr,
                        int min_index, int max_index)
 {
    struct translate_key key;
@@ -299,7 +299,7 @@ u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
    return upload_flushed ? U_VBUF_UPLOAD_FLUSHED : 0;
 }
 
-static void u_vbuf_translate_end(struct u_vbuf_mgr_priv *mgr)
+static void u_vbuf_translate_end(struct u_vbuf_priv *mgr)
 {
    if (mgr->fallback_ve == NULL) {
       return;
@@ -320,15 +320,15 @@ static void u_vbuf_translate_end(struct u_vbuf_mgr_priv *mgr)
 #define FORMAT_REPLACE(what, withwhat) \
     case PIPE_FORMAT_##what: format = PIPE_FORMAT_##withwhat; break
 
-struct u_vbuf_mgr_elements *
-u_vbuf_mgr_create_vertex_elements(struct u_vbuf_mgr *mgrb,
-                                  unsigned count,
-                                  const struct pipe_vertex_element *attribs,
-                                  struct pipe_vertex_element *native_attribs)
+struct u_vbuf_elements *
+u_vbuf_create_vertex_elements(struct u_vbuf_mgr *mgrb,
+                              unsigned count,
+                              const struct pipe_vertex_element *attribs,
+                              struct pipe_vertex_element *native_attribs)
 {
-   struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+   struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
    unsigned i;
-   struct u_vbuf_mgr_elements *ve = CALLOC_STRUCT(u_vbuf_mgr_elements);
+   struct u_vbuf_elements *ve = CALLOC_STRUCT(u_vbuf_elements);
 
    ve->count = count;
 
@@ -424,11 +424,11 @@ u_vbuf_mgr_create_vertex_elements(struct u_vbuf_mgr *mgrb,
    return ve;
 }
 
-void u_vbuf_mgr_bind_vertex_elements(struct u_vbuf_mgr *mgrb,
-                                     void *cso,
-                                     struct u_vbuf_mgr_elements *ve)
+void u_vbuf_bind_vertex_elements(struct u_vbuf_mgr *mgrb,
+                                 void *cso,
+                                 struct u_vbuf_elements *ve)
 {
-   struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+   struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
 
    if (!cso) {
       return;
@@ -440,17 +440,17 @@ void u_vbuf_mgr_bind_vertex_elements(struct u_vbuf_mgr *mgrb,
    }
 }
 
-void u_vbuf_mgr_destroy_vertex_elements(struct u_vbuf_mgr *mgr,
-                                        struct u_vbuf_mgr_elements *ve)
+void u_vbuf_destroy_vertex_elements(struct u_vbuf_mgr *mgr,
+                                    struct u_vbuf_elements *ve)
 {
    FREE(ve);
 }
 
-void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
-                                   unsigned count,
-                                   const struct pipe_vertex_buffer *bufs)
+void u_vbuf_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
+                               unsigned count,
+                               const struct pipe_vertex_buffer *bufs)
 {
-   struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+   struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
    unsigned i;
 
    mgr->any_user_vbs = FALSE;
@@ -505,7 +505,7 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
 }
 
 static enum u_vbuf_return_flags
-u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
+u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
                       int min_index, int max_index,
                       unsigned instance_count)
 {
@@ -561,7 +561,7 @@ u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
    return retval;
 }
 
-static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
+static void u_vbuf_compute_max_index(struct u_vbuf_priv *mgr)
 {
    unsigned i, nr = mgr->ve->count;
 
@@ -602,14 +602,14 @@ static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
 }
 
 enum u_vbuf_return_flags
-u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
-                      const struct pipe_draw_info *info)
+u_vbuf_draw_begin(struct u_vbuf_mgr *mgrb,
+                  const struct pipe_draw_info *info)
 {
-   struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+   struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
    int min_index, max_index;
    enum u_vbuf_return_flags retval = 0;
 
-   u_vbuf_mgr_compute_max_index(mgr);
+   u_vbuf_compute_max_index(mgr);
 
    min_index = info->min_index - info->index_bias;
    if (info->max_index == ~0) {
@@ -636,9 +636,9 @@ u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
    return retval;
 }
 
-void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgrb)
+void u_vbuf_draw_end(struct u_vbuf_mgr *mgrb)
 {
-   struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+   struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
 
    if (mgr->fallback_ve) {
       u_vbuf_translate_end(mgr);
index fabacbe4e0fe18293889278e31ac0854a3f21d8f..0042ad1e81f022cb4914b2823dd51c5b6c88d276 100644 (file)
@@ -88,7 +88,7 @@ struct u_vbuf_resource {
 };
 
 /* Opaque type containing information about vertex elements for the manager. */
-struct u_vbuf_mgr_elements;
+struct u_vbuf_elements;
 
 enum u_fetch_alignment {
    U_VERTEX_FETCH_BYTE_ALIGNED,
@@ -102,36 +102,35 @@ enum u_vbuf_return_flags {
 
 
 struct u_vbuf_mgr *
-u_vbuf_mgr_create(struct pipe_context *pipe,
-                  unsigned upload_buffer_size,
-                  unsigned upload_buffer_alignment,
-                  unsigned upload_buffer_bind,
-                  enum u_fetch_alignment fetch_alignment);
+u_vbuf_create(struct pipe_context *pipe,
+              unsigned upload_buffer_size,
+              unsigned upload_buffer_alignment,
+              unsigned upload_buffer_bind,
+              enum u_fetch_alignment fetch_alignment);
 
-void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgr);
+void u_vbuf_destroy(struct u_vbuf_mgr *mgr);
 
-struct u_vbuf_mgr_elements *
-u_vbuf_mgr_create_vertex_elements(struct u_vbuf_mgr *mgr,
-                                  unsigned count,
-                                  const struct pipe_vertex_element *attrs,
-                                  struct pipe_vertex_element *native_attrs);
+struct u_vbuf_elements *
+u_vbuf_create_vertex_elements(struct u_vbuf_mgr *mgr,
+                              unsigned count,
+                              const struct pipe_vertex_element *attrs,
+                              struct pipe_vertex_element *native_attrs);
 
-void u_vbuf_mgr_bind_vertex_elements(struct u_vbuf_mgr *mgr,
-                                     void *cso,
-                                     struct u_vbuf_mgr_elements *ve);
+void u_vbuf_bind_vertex_elements(struct u_vbuf_mgr *mgr,
+                                 void *cso,
+                                 struct u_vbuf_elements *ve);
 
-void u_vbuf_mgr_destroy_vertex_elements(struct u_vbuf_mgr *mgr,
-                                        struct u_vbuf_mgr_elements *ve);
+void u_vbuf_destroy_vertex_elements(struct u_vbuf_mgr *mgr,
+                                    struct u_vbuf_elements *ve);
 
-void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgr,
-                                   unsigned count,
-                                   const struct pipe_vertex_buffer *bufs);
+void u_vbuf_set_vertex_buffers(struct u_vbuf_mgr *mgr,
+                               unsigned count,
+                               const struct pipe_vertex_buffer *bufs);
 
-enum u_vbuf_return_flags
-u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgr,
-                      const struct pipe_draw_info *info);
+enum u_vbuf_return_flags u_vbuf_draw_begin(struct u_vbuf_mgr *mgr,
+                                           const struct pipe_draw_info *info);
 
-void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgr);
+void u_vbuf_draw_end(struct u_vbuf_mgr *mgr);
 
 
 static INLINE struct u_vbuf_resource *u_vbuf_resource(struct pipe_resource *r)
index b304999d424733aaec55e6b9d9b0bbf2c75a90a5..bcb47e0056cd4577ef3b9042e896a2f796c8ae8d 100644 (file)
@@ -108,7 +108,7 @@ static void r300_destroy_context(struct pipe_context* context)
         draw_destroy(r300->draw);
 
     if (r300->vbuf_mgr)
-        u_vbuf_mgr_destroy(r300->vbuf_mgr);
+        u_vbuf_destroy(r300->vbuf_mgr);
 
     /* XXX: This function assumes r300->query_list was initialized */
     r300_release_referenced_objects(r300);
@@ -442,7 +442,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300->context.create_video_decoder = vl_create_decoder;
     r300->context.create_video_buffer = vl_video_buffer_create;
 
-    r300->vbuf_mgr = u_vbuf_mgr_create(&r300->context, 1024 * 1024, 16,
+    r300->vbuf_mgr = u_vbuf_create(&r300->context, 1024 * 1024, 16,
                                        PIPE_BIND_VERTEX_BUFFER |
                                        PIPE_BIND_INDEX_BUFFER,
                                        U_VERTEX_FETCH_DWORD_ALIGNED);
index d71db0001a9783bfaaec7ee37a8f7c74ad0fd833..60cbe1a40f51d22acde997a4105d2983f4c83208 100644 (file)
@@ -425,7 +425,7 @@ struct r300_vertex_element_state {
     struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
     unsigned format_size[PIPE_MAX_ATTRIBS];
 
-    struct u_vbuf_mgr_elements *vmgr_elements;
+    struct u_vbuf_elements *vmgr_elements;
 
     /* The size of the vertex, in dwords. */
     unsigned vertex_size_dwords;
index 5576fe26184e55fa5ea5ce24378bb13358d14dc3..7d31ac403760a317571a12cf91787cc8344762b6 100644 (file)
@@ -779,7 +779,7 @@ static void r300_draw_vbo(struct pipe_context* pipe,
     r300_update_derived_state(r300);
 
     /* Start the vbuf manager and update buffers if needed. */
-    if (u_vbuf_mgr_draw_begin(r300->vbuf_mgr, &info) & U_VBUF_BUFFERS_UPDATED) {
+    if (u_vbuf_draw_begin(r300->vbuf_mgr, &info) & U_VBUF_BUFFERS_UPDATED) {
         r300->vertex_arrays_dirty = TRUE;
     }
 
@@ -810,7 +810,7 @@ static void r300_draw_vbo(struct pipe_context* pipe,
         }
     }
 
-    u_vbuf_mgr_draw_end(r300->vbuf_mgr);
+    u_vbuf_draw_end(r300->vbuf_mgr);
 }
 
 /****************************************************************************
index 057cd9faf0362a93278c4667c72b9b2214362c85..11282a45e0fa38a737911e2bd4085fa96df7c466 100644 (file)
@@ -1583,7 +1583,7 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
         count = 1;
     }
 
-    u_vbuf_mgr_set_vertex_buffers(r300->vbuf_mgr, count, buffers);
+    u_vbuf_set_vertex_buffers(r300->vbuf_mgr, count, buffers);
 
     if (r300->screen->caps.has_tcl) {
         /* HW TCL. */
@@ -1691,7 +1691,7 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
 
     velems->count = count;
     velems->vmgr_elements =
-        u_vbuf_mgr_create_vertex_elements(r300->vbuf_mgr, count, attribs,
+        u_vbuf_create_vertex_elements(r300->vbuf_mgr, count, attribs,
                                           velems->velem);
 
     if (r300_screen(pipe->screen)->caps.has_tcl) {
@@ -1721,7 +1721,7 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe,
 
     r300->velems = velems;
 
-    u_vbuf_mgr_bind_vertex_elements(r300->vbuf_mgr, state, velems->vmgr_elements);
+    u_vbuf_bind_vertex_elements(r300->vbuf_mgr, state, velems->vmgr_elements);
 
     if (r300->draw) {
         draw_set_vertex_elements(r300->draw, velems->count, velems->velem);
@@ -1738,7 +1738,7 @@ static void r300_delete_vertex_elements_state(struct pipe_context *pipe, void *s
     struct r300_context *r300 = r300_context(pipe);
     struct r300_vertex_element_state *velems = state;
 
-    u_vbuf_mgr_destroy_vertex_elements(r300->vbuf_mgr, velems->vmgr_elements);
+    u_vbuf_destroy_vertex_elements(r300->vbuf_mgr, velems->vmgr_elements);
     FREE(state);
 }
 
index 48b0fe97a6a3ba9f52b9e1221f6439a6e49b919a..53640169949ac946cc3e4daf01eca8dfe258d1b1 100644 (file)
@@ -173,7 +173,7 @@ static void r600_destroy_context(struct pipe_context *context)
                free(rctx->states[i]);
        }
 
-       u_vbuf_mgr_destroy(rctx->vbuf_mgr);
+       u_vbuf_destroy(rctx->vbuf_mgr);
        util_slab_destroy(&rctx->pool_transfers);
 
        if (rctx->fences.bo) {
@@ -263,7 +263,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
                         sizeof(struct pipe_transfer), 64,
                         UTIL_SLAB_SINGLETHREADED);
 
-       rctx->vbuf_mgr = u_vbuf_mgr_create(&rctx->context, 1024 * 1024, 256,
+       rctx->vbuf_mgr = u_vbuf_create(&rctx->context, 1024 * 1024, 256,
                                           PIPE_BIND_VERTEX_BUFFER |
                                           PIPE_BIND_INDEX_BUFFER |
                                           PIPE_BIND_CONSTANT_BUFFER,
index d7fa1b931b8683c34c737b9ca7649b5d5c82c63a..1deedf6cbf61f955988e341d2cf52041fc3e2445 100644 (file)
@@ -114,7 +114,7 @@ struct r600_vertex_element
 {
        unsigned                        count;
        struct pipe_vertex_element      elements[PIPE_MAX_ATTRIBS];
-       struct u_vbuf_mgr_elements      *vmgr_elements;
+       struct u_vbuf_elements  *vmgr_elements;
        struct r600_bo                  *fetch_shader;
        unsigned                        fs_size;
        struct r600_pipe_state          rstate;
index 559e75a8f11deb87e950fa4ffffe973048b4cbc4..bec31ffe9fd2c0ba49277e93218a536138be1bea 100644 (file)
@@ -162,7 +162,7 @@ void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
 
        rctx->vertex_elements = v;
        if (v) {
-               u_vbuf_mgr_bind_vertex_elements(rctx->vbuf_mgr, state,
+               u_vbuf_bind_vertex_elements(rctx->vbuf_mgr, state,
                                                v->vmgr_elements);
 
                rctx->states[v->rstate.id] = &v->rstate;
@@ -182,7 +182,7 @@ void r600_delete_vertex_element(struct pipe_context *ctx, void *state)
                rctx->vertex_elements = NULL;
 
        r600_bo_reference(&v->fetch_shader, NULL);
-       u_vbuf_mgr_destroy_vertex_elements(rctx->vbuf_mgr, v->vmgr_elements);
+       u_vbuf_destroy_vertex_elements(rctx->vbuf_mgr, v->vmgr_elements);
        FREE(state);
 }
 
@@ -227,7 +227,7 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count,
                }
        }
 
-       u_vbuf_mgr_set_vertex_buffers(rctx->vbuf_mgr, count, buffers);
+       u_vbuf_set_vertex_buffers(rctx->vbuf_mgr, count, buffers);
 }
 
 void *r600_create_vertex_elements(struct pipe_context *ctx,
@@ -243,7 +243,7 @@ void *r600_create_vertex_elements(struct pipe_context *ctx,
 
        v->count = count;
        v->vmgr_elements =
-               u_vbuf_mgr_create_vertex_elements(rctx->vbuf_mgr, count,
+               u_vbuf_create_vertex_elements(rctx->vbuf_mgr, count,
                                                  elements, v->elements);
 
        if (r600_vertex_elements_build_fetch_shader(rctx, v)) {
@@ -568,7 +568,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
        if (rctx->chip_class < EVERGREEN)
                r600_update_sampler_states(rctx);
 
-       u_vbuf_mgr_draw_begin(rctx->vbuf_mgr, info);
+       u_vbuf_draw_begin(rctx->vbuf_mgr, info);
        r600_vertex_buffer_update(rctx);
 
        draw.info = *info;
@@ -676,7 +676,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
 
        pipe_resource_reference(&draw.index_buffer, NULL);
 
-       u_vbuf_mgr_draw_end(rctx->vbuf_mgr);
+       u_vbuf_draw_end(rctx->vbuf_mgr);
 }
 
 void _r600_pipe_state_add_reg(struct r600_context *ctx,