nir: improve nir_variable packing
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 23 Oct 2019 00:43:59 +0000 (11:43 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 24 Oct 2019 02:24:40 +0000 (13:24 +1100)
Before:

/* size: 136, cachelines: 3, members: 10 */

After:

/* size: 128, cachelines: 2, members: 10 */

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
src/compiler/nir/nir.h

index 33735d4320bc3e6de41b55629a21757ff0d1b6f2..6496ad92b11b7ab1052e8851c03df8097820c165 100644 (file)
@@ -498,6 +498,9 @@ typedef struct nir_variable {
       } image;
    } data;
 
+   /* Number of nir_variable_data members */
+   unsigned num_members;
+
    /**
     * Built-in state that backs this uniform
     *
@@ -539,7 +542,6 @@ typedef struct nir_variable {
     * inputs each with their own layout specifier.  This is only allowed on
     * variables with a struct or array of array of struct type.
     */
-   unsigned num_members;
    struct nir_variable_data *members;
 } nir_variable;