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?