[Mesa-dev] [PATCH 1/2] glsl: Don't remove XFB-only varyings.
Kenneth Graunke
kenneth at whitecape.org
Mon Apr 4 04:30:31 UTC 2016
On Sunday, April 3, 2016 9:34:05 PM PDT Timothy Arceri wrote:
> On Sun, 2016-04-03 at 01:37 -0700, Kenneth Graunke wrote:
> > Consider the case of linking a program with both a vertex and
> > fragment
> > shader. The VS may compute output varyings that are intended for
> > transform feedback, and not read by the fragment shader.
> >
> > In this case, var->data.is_unmatched_generic_inout will be true,
> > but we still cannot eliminate the varyings. We need to also check
> > !var->data.is_xfb_only.
> >
> > Fixes failures in ES31-CTS.gpu_shader5.fma_precision_*, which happen
> > to use transform feedback in a way we apparently hadn't seen before.
>
> Hmm ... are you sure there is not something else going wrong here
> somewhere? is_xfb_only is set in the same code block that should change
> is_unmatched_generic_inout to false.
>
> 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);
> }
>
> matches.record() should set is_unmatched_generic_inout to false and
> setup everything else needed for xfb. Seems like there is another bug
> here somewhere.
The shader actually contains:
layout(location = 0) out flat int outTextureSize;
So it triggers the very first condition of matches.record():
if ((producer_var && (!producer_var->data.is_unmatched_generic_inout ||
producer_var->data.explicit_location)) ||
(consumer_var && (!consumer_var->data.is_unmatched_generic_inout ||
consumer_var->data.explicit_location))) {
/* Either a location already exists for this variable (since it is part
* of fixed functionality), or it has already been recorded as part of a
* previous match.
*/
return;
}
and so it returns early. No match is recorded, and it never sets
producer_var->data.is_unmatched_generic_inout = 0.
Do you think we should do some of it anyway?
--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160403/284ac34b/attachment.sig>
More information about the mesa-dev
mailing list