[Mesa-dev] [PATCH 13/25] compiler: make uses_sample_qualifier a bitfield and add uses_centroid_qualifier

Kenneth Graunke kenneth at whitecape.org
Tue Oct 18 07:08:23 UTC 2016


On Tuesday, October 18, 2016 5:12:16 PM PDT Timothy Arceri wrote:
> These need to be bitfields for use with gallium.
> ---
>  src/compiler/glsl/glsl_to_nir.cpp |  2 +-
>  src/compiler/shader_info.h        | 12 +++++++++---
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
> index de76651..a2284e2 100644
> --- a/src/compiler/glsl/glsl_to_nir.cpp
> +++ b/src/compiler/glsl/glsl_to_nir.cpp
> @@ -185,7 +185,7 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
>           (struct gl_fragment_program *)sh->Program;
>  
>        shader->info->fs.uses_discard = fp->UsesKill;
> -      shader->info->fs.uses_sample_qualifier = fp->IsSample != 0;
> +      shader->info->fs.uses_sample_qualifier = fp->IsSample;
>        shader->info->fs.early_fragment_tests = sh->info.EarlyFragmentTests;
>        shader->info->fs.depth_layout = fp->FragDepthLayout;
>        break;
> diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
> index 66e06ad..dde36f5 100644
> --- a/src/compiler/shader_info.h
> +++ b/src/compiler/shader_info.h
> @@ -95,12 +95,18 @@ typedef struct shader_info {
>        } gs;
>  
>        struct {
> -         bool uses_discard;
> +         /**
> +          * A bitfield of input locations declared with the "sample" qualifier
> +          */
> +         uint64_t uses_sample_qualifier;

I would expect to see the initialization/usage of this updated to be a
proper bitfield rather than a boolean.  It looks like even by the end
of the series there's still a bit of boolean going on here.

>  
>           /**
> -          * Whether any inputs are declared with the "sample" qualifier.
> +          * A bitfield of input locations declared with the "centroid"
> +          * qualifier.
>            */
> -         bool uses_sample_qualifier;
> +         uint64_t uses_centroid_qualifier;

uses_centroid_qualifier doesn't appear to be used anywhere in the whole
series?

> +
> +         bool uses_discard;
>  
>           /**
>            * Whether early fragment tests are enabled as defined by
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161018/9bf82544/attachment-0001.sig>


More information about the mesa-dev mailing list