[Mesa-dev] [PATCH] nir: put compact into bitfields in nir_variable_data

Kenneth Graunke kenneth at whitecape.org
Fri Sep 8 07:44:55 UTC 2017


On Tuesday, September 5, 2017 8:19:57 PM PDT Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This being declared bool means it won't get merged with the previous
> bitfields, this seems like an oversight rather than deliberate.
> 
> Noticed when running pahole.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/compiler/nir/nir.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 9313b7ac90..8330e6d7ce 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -220,7 +220,7 @@ typedef struct nir_variable {
>         * be tightly packed.  In other words, consecutive array elements
>         * should be stored one component apart, rather than one slot apart.
>         */
> -      bool compact:1;
> +      unsigned compact:1;
>  
>        /**
>         * Whether this is a fragment shader output implicitly initialized with
> 

This is fine, but I'd prefer to change the other booleans to "bool"
in the long term.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170908/e021e196/attachment-0001.sig>


More information about the mesa-dev mailing list