[Mesa-dev] [PATCH 2/2] glsl: reduce size of swizzle field in ir_state_slot

Ian Romanick idr at freedesktop.org
Wed May 28 10:15:37 PDT 2014


This won't actually do anything because the compiler still rounds the
size of the structure upto a multiple of sizeof(int) for alignment
purposes.  With your v2 patch applied, I still get

(gdb) print sizeof(ir_state_slot)
$1 = 24

which is 6*sizeof(int).

On 05/27/2014 10:09 PM, Tapani Pälli wrote:
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/glsl/ir.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/ir.h b/src/glsl/ir.h
> index ef4a12d..bc19208 100644
> --- a/src/glsl/ir.h
> +++ b/src/glsl/ir.h
> @@ -357,7 +357,7 @@ depth_layout_string(ir_depth_layout layout);
>   */
>  struct ir_state_slot {
>     int tokens[5];
> -   int swizzle;
> +   uint8_t swizzle;
>  };
>  
>  
> 



More information about the mesa-dev mailing list