[PATCH] D70781: AMDGPU: Fix handling of infinite loops in fragment shaders

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 05:11:35 PST 2019


critson added a comment.

In D70781#1766679 <https://reviews.llvm.org/D70781#1766679>, @cwabbott wrote:

> In D70781#1766515 <https://reviews.llvm.org/D70781#1766515>, @critson wrote:
>
> > In D70781#1765291 <https://reviews.llvm.org/D70781#1765291>, @cwabbott wrote:
> >
> > > I think this isn't an issue because the exec mask at the end of the program is going to be the same as the mask when the last "real" export happens. The way `kill` is implemented means that control flow never reconverges for a killed thread, so it stays dead until the very end. I've done some manual tests with the aforementioned CTS test, and it does seem to be properly discarding the right pixels too. But that's a good question :)
> >
> >
> > I agree in the general case that should hold; however, if there was a discard //after// the true export done then it wouldn't.  I don't have a good use case for why such a thing would happen -- exports should in the main be the last thing a (PS) shader does.  So if we consider `kill` after `export done` semantically invalid then this is fine.
>
>
> Yeah, we definitely don't ever do such a thing in Mesa, presumably not in AMDVLK/PAL either, which covers all the frontends, and I can't think of a reason for doing that either. So I don't think it's a concern. Should I add a comment to explain this?


A brief comment seems reasonable in case someone runs into it in future.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70781/new/

https://reviews.llvm.org/D70781





More information about the llvm-commits mailing list