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

Timothy Arceri timothy.arceri at collabora.com
Tue Oct 18 08:55:35 UTC 2016


On Tue, 2016-10-18 at 00:08 -0700, Kenneth Graunke wrote:
> 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.

Yeah sorry I meant to drop this patch. I worked out that I could get
rid of the bitfields, see patch 18.

> 
> > 
> >  
> >           /**
> > -          * 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
> > 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list