[Mesa-dev] [PATCH 2/8] glsl: mark xfb varyings as always active

Kenneth Graunke kenneth at whitecape.org
Sat Sep 23 17:47:29 UTC 2017


On Friday, September 22, 2017 8:29:31 PM PDT Timothy Arceri wrote:
> 
> On 23/09/17 02:59, Kenneth Graunke wrote:
> > On Tuesday, September 12, 2017 4:37:29 PM PDT Timothy Arceri wrote:
> >> This will be used by the nir linking pass so that we don't remove
> >> otherwise unused varyings.
> >> ---
> >>   src/compiler/glsl/link_varyings.cpp | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
> >> index 528506fd0eb..656bf79ca9d 100644
> >> --- a/src/compiler/glsl/link_varyings.cpp
> >> +++ b/src/compiler/glsl/link_varyings.cpp
> >> @@ -2268,6 +2268,9 @@ assign_varying_locations(struct gl_context *ctx,
> >>            return false;
> >>         }
> >>   
> >> +      /* Mark xfb varyings as always active */
> >> +      matched_candidate->toplevel_var->data.always_active_io = 1;
> >> +
> >>         if (matched_candidate->toplevel_var->data.is_unmatched_generic_inout) {
> >>            matched_candidate->toplevel_var->data.is_xfb_only = 1;
> >>            matches.record(matched_candidate->toplevel_var, NULL);
> >>
> > 
> > Hmm...it looks like this could actually fix a bug today.  At least, I'm
> > not seeing what code prevents us from deleting variables that are used
> > for transform feedback but not otherwise.
> 
> is_xfb_only is used for that, it also has special meaning when packing 
> since xfb varyings must be packed. For a nir pass is_xfb_only isn't 
> really required and we can just use always_active_io instead.

Ah right, thanks!  It sounds like we could get rid of is_xfb_only
sometime in the future, after rewriting packing in NIR...or else rename
it to "must_pack" or something.

But, later :)
-------------- 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/20170923/e203acc2/attachment.sig>


More information about the mesa-dev mailing list