gallium: rearrange some members to avoid memory holes/padding
authorZack Rusin <zack@kde.org>
Tue, 23 Jun 2009 23:12:46 +0000 (19:12 -0400)
committerZack Rusin <zack@kde.org>
Mon, 6 Jul 2009 21:21:37 +0000 (17:21 -0400)
plus it saves us a cacheline in the cso

src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/include/pipe/p_state.h

index f388bf5d951782a9b1cda9511416afd7ea5cd97a..36c882acb759102f2c0b2adf7278a3ba3eab539f 100644 (file)
@@ -55,14 +55,14 @@ struct cso_context {
    void *samplers[PIPE_MAX_SAMPLERS];
    unsigned nr_samplers;
 
-   void *samplers_saved[PIPE_MAX_SAMPLERS];
    unsigned nr_samplers_saved;
+   void *samplers_saved[PIPE_MAX_SAMPLERS];
 
    struct pipe_texture *textures[PIPE_MAX_SAMPLERS];
    uint nr_textures;
 
-   struct pipe_texture *textures_saved[PIPE_MAX_SAMPLERS];
    uint nr_textures_saved;
+   struct pipe_texture *textures_saved[PIPE_MAX_SAMPLERS];
 
    /** Current and saved state.
     * The saved state is used as a 1-deep stack.
index 932c024f156e1ff4e61433742e7b7f1632e3221e..626bedb35a85cf9a90c8eeddb772f6900efbce80 100644 (file)
@@ -75,11 +75,11 @@ struct pipe_surface;
  */
 struct pipe_buffer
 {
-   struct pipe_reference reference;
-   struct pipe_screen *screen;
-   unsigned alignment;
-   unsigned usage;
-   unsigned size;
+   struct pipe_reference  reference;
+   unsigned               size;
+   struct pipe_screen    *screen;
+   unsigned               alignment;
+   unsigned               usage;
 };
 
 
@@ -286,10 +286,10 @@ struct pipe_surface
    unsigned offset;              /**< offset from start of buffer, in bytes */
    unsigned usage;               /**< PIPE_BUFFER_USAGE_*  */
 
+   unsigned zslice;
    struct pipe_texture *texture; /**< texture into which this is a view  */
    unsigned face;
    unsigned level;
-   unsigned zslice;
 };