[Mesa-dev] [PATCH] [rfc] ac/nir->llvm: workaround llvm lowering kill to exec mask

Dave Airlie airlied at gmail.com
Tue Nov 1 19:56:19 UTC 2016


On 1 November 2016 at 23:49, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 01.11.2016 05:32, Dave Airlie wrote:
>>
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This just a discussion holder patch, radv has generated a shader
>> using discard that lowers the kilp intrinsic into
>>
>> s_mov_b64 exec, 0                               ; BEFE0180
>>
>> however that means exports never happen, and I think this leads
>> to a GPU hang as the frag shader must make at least one NULL export.
>>
>> This hacks just replaces kilp intrinsic with an explcit export
>> and endpgm for now. I'm sure it's probably all sorts of wrong.
>>
>> Either way I expect the fix has to be in the compiler, but this
>> patch lets me get CTS to run again
>
>
> Unfortunately, this will end up messing up other stuff when the kill _isn't_
> uniform, because now you have two places where you return from the function,
> which is bound to mess with control flow in hilarious ways.
>
> If you want to workaround the problem that you mentioned, I suggest trying
> to see whether you can use some NIR transformation to lower the kill as
>
> kill(condition)
>
> rather than
>
> br condition, die, live
>
> die:
> kill
>
> live:
>

At the moment that's just how the SPIR-V comes rolling in however I do
see we have a GLSL pass to convert if (cond) discard into discard(cond)
I'd need a similiar pass for NIR to convert to it's discard_if intrinsic.

Dave.


More information about the mesa-dev mailing list