<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 24, 2014 at 10:29 AM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tuesday, June 24, 2014 08:17:23 AM Ian Romanick wrote:<br>
</div><div><div class="h5">> Send patches with git-send-email and no other method.  Save this message<br>
> and apply it to origin/master using git-am to see why.<br>
><br>
> Hopefully Matt or Ken can review this...<br>
><br>
> On 06/12/2014 12:35 PM, Cody Northrop wrote:<br>
> > Commit 17c7ead7 exposed a bug in how uniform loading happens in the<br>
> > presence of discard.  It manifested itself in an application as randomly<br>
> > incorrect pixels on the borders of conditional areas.<br>
> ><br>
> > We believe it is due to how discards jump to the end of the shader<br>
> > incorrectly for some channels.  The current implementation checks each<br>
> > 2x2 subspan to preserve derivatives.  When uniform loading via samplers<br>
> > was turned on, it uses a full execution mask, as stated in<br>
> > lower_uniform_pull_constant_loads(), and only populates four channels of<br>
> > the destination (see generate_uniform_pull_constant_load_gen7()).  We<br>
> > think that is happening incorrectly when the first subspan has been<br>
> > jumped over.<br>
> ><br>
> > A possible fix is to only jump to the end of the shader if all relevant<br>
> > channels are disabled, i.e. all 8 or 16, depending on dispatch.  This<br>
> > preserves the original speedup noted in commit beafced2.  There are<br>
> > other more heavyweight fixes (i.e. don't use sampler for uniforms if<br>
> > discard in use), but this seems like a good fix.  I've appended it below<br>
> > as a patch.  It changes the shader accordingly:<br>
> ><br>
> > before    : 0x000000d0: (-f0.1.any4h) halt(8) 17 2<br>
> > null                            { align1 WE_all 1Q };<br>
> > after(8)  : 0x000000d0: (-f0.1.any8h) halt(8) 17 2<br>
> > null                            { align1 WE_all 1Q };<br>
> > after(16) : 0x00000250: (-f0.1.any16h) halt(16) 17 2<br>
> > null                            { align1 WE_all 1H };<br>
><br>
> All of this information should go in the commit message.<br>
><br>
> > I attached a test case to the bugzilla entry below.<br>
><br>
> Was the test also sent to the piglit mailing list for inclusion in the<br>
> the test suite?<br>
<br>
</div></div>Hi Cody,<br>
<br>
I noticed that the Piglit test is a hack to an existing SSO test - would it be<br>
possible to create a new Piglit test for this, and submit it to<br>
<a href="mailto:piglit@lists.freedesktop.org">piglit@lists.freedesktop.org</a> for inclusion upstream?  It'd be great to have a<br>
regression test in place so we don't break it in the future.<br></blockquote><div><br></div><div>Yes, I'll create a different test and submit it for inclusion.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Also, it apparently tries to use GLSL 1.40 in a legacy GL 3.0 context, which<br>
Mesa doesn't support.  I had to hack Mesa to get it to run.<br>
<br></blockquote><div><br></div><div>I just rebased the changes to latest mesa/piglit/waffle masters and the test runs fine.  :\  Anyway, I agree it has a couple problems and I'll avoid them in the new version.<br><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks again,<br>
--Ken</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div><font color="#999999"><font face="trebuchet ms, sans-serif"> Cody Northrop<br> Graphics Software Engineer<br> LunarG, Inc.- 3D Driver Innovations</font><font style="font-size:small" face="trebuchet ms, sans-serif"><br>
 Email: <a href="mailto:cody@lunarg.com" target="_blank">cody@lunarg.com</a><br> Website: <a href="http://www.lunarg.com/" target="_blank">http://www.lunarg.com</a></font></font></div></div>
</div></div>