<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 2, 2016 at 10:39 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="HOEnZb"><div class="h5">On Thursday, September 1, 2016 7:00:01 PM PDT Connor Abbott wrote:<br>
> On Thu, Sep 1, 2016 at 6:19 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > On Thu, Sep 1, 2016 at 12:41 PM, Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br>
> >><br>
> >> As-is, this change will make us delete trivially infinite loops (i.e.<br>
> >> loops with no break statement). The most likely scenario where we get<br>
> >> one of those (besides for silly Piglit tests) is a developer with an<br>
> >> accidental bug in their shader. In that case, it seems kinda mean to<br>
> >> then delete the entire loop and pretend like it doesn't exist. Maybe<br>
> >> add something like<br>
> >><br>
> >> if (!after->imm_dom)<br>
> >> return false;<br>
> >><br>
> >> with a comment explaining what's going on? This would also help us<br>
> >> catch other places where we don't handle infinite loops correctly that<br>
> >> might've been hidden by this.<br>
> ><br>
> ><br>
> > I wrote that patch and kicked it off to Jenkins and it passed just fine.<br>
> > However, I don't know if I like it. Matt and I were talking about this<br>
> > yesterday and his suggestion was to, if they have an infinite loop, delete<br>
> > the entire shader and draw pink. That's more useful to developers than<br>
> > hanging their GPU.<br>
><br>
> Hmm... I guess if you did that it would be wise to also print a<br>
> message somewhere the developer could see, since "uhh now the entire<br>
> thing is pink" probably won't help clarify what the problem is, even<br>
> if it shows that there is in fact a problem :)<br>
><br>
> But I guess Matt is right that the danger is more theoretical than<br>
> practical. So go ahead and add my r-b to both patches with or without<br>
> the suggestion. Fake edges begone!<br></div></div></blockquote><div><br></div><div>Thanks! I went ahead and pushed the original version with your R-B.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
</div></div>It would be great to be able to emit a warning to the shader info log,<br>
or a KHR debug message. We've never hooked that up to NIR, but if we<br>
did, we could issue a warning and then basically do whatever we want<br>
with impunity.<br></blockquote><div><br></div><div>I'm looking into this. It shouldn't be terrible... <br></div></div><br></div></div>