Advertisement

Pixel shader UAVs in ps_5_1

Started by March 03, 2018 02:10 PM
3 comments, last by galop1n 6 years, 11 months ago

I'm using fxc.exe from the Win10 SDK (10.0.10586.0) to build my HLSL code.

I've got some code in different pixel shaders that uses interlocked instructions on UAVs, such as:


RWBuffer<uint> FragmentCount : register(u2);
RWTexture2D<uint> HeadIndex : register(u3);
...
uint newNode = 0;
/*!!*/InterlockedAdd(FragmentCount[0], 1U, newNode);/*!!*/
...
uint previousTail = 0;
/*!!*/InterlockedExchange(HeadIndex[xy], newNode+1, previousTail); /*!!*/
...
uint previousHead = 0;
/*!!*/InterlockedAdd(HeadIndex[xy], 0x01000000, previousHead);/*!!*/

This compiles fine with the ps_5_0, cs_5_0 and cs_5_1 targets, but with ps_5_1, the compiler gives error x4532: cannot map expression to ps_5_1 instruction set, on the lines indicated with /*!!*/

Anyone else experienced this? What the hell, right?

That's odd, I tried compiling to ps_5_1 with windows sdk 10.0.16299.0 and it works as expected.

Advertisement

Thanks, upgrading to fxc.exe / dxcompiler.dll from v10.0.16299.0 of the SDK fixed it!

It seems that fxc.exe / d3dcompiler_47.dll from v10.0.10586.0 has a bug here...

Haha, i recognize that one ! 10586 was the latest sdk at the time and i filled a bug to Microsoft. At the time, they gave me a preview build of 16xxx that was already fixing it :)

This topic is closed to new replies.

Advertisement