glsl: Swap the order of glsl_type::name and ::length

On x86-64 this saves 8 bytes of padding in the structure, and this
reduces the size of the structure to 32 bytes.

v2: Fix constructor so that GCC won't warn about the order of
initialization.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
Ian Romanick 2014-10-24 13:08:06 -07:00
parent 3711abd780
commit 9cdf66657a
2 changed files with 8 additions and 8 deletions

View File

@ -326,7 +326,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
sampler_type(0), interface_packing(0),
vector_elements(0), matrix_columns(0),
name(NULL), length(length)
length(length), name(NULL)
{
this->fields.array = array;
/* Inherit the gl type of the base. The GL type is used for

View File

@ -157,13 +157,6 @@ struct glsl_type {
uint8_t matrix_columns; /**< 1, 2, 3, or 4 matrix columns. */
/*@}*/
/**
* Name of the data type
*
* Will never be \c NULL.
*/
const char *name;
/**
* For \c GLSL_TYPE_ARRAY, this is the length of the array. For
* \c GLSL_TYPE_STRUCT or \c GLSL_TYPE_INTERFACE, it is the number of
@ -172,6 +165,13 @@ struct glsl_type {
*/
unsigned length;
/**
* Name of the data type
*
* Will never be \c NULL.
*/
const char *name;
/**
* Subtype of composite data types.
*/