[Mesa-dev] [PATCH 7/8] mesa: Reduce ffvertex_prog state_key to 36 bytes.

Brian Paul brianp at vmware.com
Mon Jan 29 16:05:57 UTC 2018


On 01/27/2018 12:09 PM, Mathias.Froehlich at gmx.net wrote:
> From: Mathias Fröhlich <mathias.froehlich at web.de>
> 
> Using lower alignment restrictions for the
> state key fields finally yields to a smaller hasing

"hashing"  And this 3-line comment could fit into two lines.
> state key.
> 
> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>

The series looks good tome.

Reviewed-by: Brian Paul <brianp at vmware.com>

Can you push this or do you need me to do it?

-Brian


> ---
>   src/mesa/main/ffvertex_prog.c | 29 +++++++++++++++--------------
>   1 file changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
> index 964d7079e1..172ab698db 100644
> --- a/src/mesa/main/ffvertex_prog.c
> +++ b/src/mesa/main/ffvertex_prog.c
> @@ -51,6 +51,10 @@
>   #define NUM_UNITS MAX2(MAX_TEXTURE_COORD_UNITS, MAX_LIGHTS)
>   
>   struct state_key {
> +   GLbitfield varying_vp_inputs;
> +
> +   unsigned fragprog_inputs_read:12;
> +
>      unsigned light_color_material_mask:12;
>      unsigned light_global_enabled:1;
>      unsigned light_local_viewer:1;
> @@ -63,22 +67,19 @@ struct state_key {
>      unsigned fog_distance_mode:2;
>      unsigned separate_specular:1;
>      unsigned point_attenuated:1;
> -   unsigned fragprog_inputs_read:12;
> -
> -   GLbitfield varying_vp_inputs;
>   
>      struct {
> -      unsigned light_enabled:1;
> -      unsigned light_eyepos3_is_zero:1;
> -      unsigned light_spotcutoff_is_180:1;
> -      unsigned light_attenuated:1;
> -      unsigned texmat_enabled:1;
> -      unsigned coord_replace:1;
> -      unsigned texgen_enabled:1;
> -      unsigned texgen_mode0:4;
> -      unsigned texgen_mode1:4;
> -      unsigned texgen_mode2:4;
> -      unsigned texgen_mode3:4;
> +      unsigned char light_enabled:1;
> +      unsigned char light_eyepos3_is_zero:1;
> +      unsigned char light_spotcutoff_is_180:1;
> +      unsigned char light_attenuated:1;
> +      unsigned char texmat_enabled:1;
> +      unsigned char coord_replace:1;
> +      unsigned char texgen_enabled:1;
> +      unsigned char texgen_mode0:4;
> +      unsigned char texgen_mode1:4;
> +      unsigned char texgen_mode2:4;
> +      unsigned char texgen_mode3:4;
>      } unit[NUM_UNITS];
>   };
>   
> 



More information about the mesa-dev mailing list