AGS_SDK icon indicating copy to clipboard operation
AGS_SDK copied to clipboard

AmdGetLastHitToken broken with latest DXC

Open BleuBleu opened this issue 9 months ago • 0 comments

Hi.

With the latest DXC (Feb 2025), I cannot use the AmdGetLastHitToken anymore.

Create this shader (change the include path to point to where your AGS includes are), save it as Test.hlsl

#include "ags_shader_intrinsics_dx12.hlsl"

RWStructuredBuffer<uint2> TestBuffer;

[shader("raygeneration")] void TestRGS()
{
	const uint DispatchThreadId = DispatchRaysIndex().x;
	TestBuffer[DispatchThreadId] = AmdGetLastHitToken();
}

Compile with:

dxc.exe /auto-binding-space 1 /exports TestRGS /Zpr /O3 /enable-16bit-types /Zss /Qembed_debug /HV 2018 /Zi /Fd .\ /T lib_6_3 /Fc Test.d3dasm /Fo Test.dxil Test.hlsl

You will get:

error: Entry function performs some operation that is incompatible with the shader stage or other entry properties.  See other errors for details.
error: Function requires a visible group, but is called from a shader without one.

DXC doesnt seem to like that the token is groupshared, to my understanding, ray-tracing shaders arent allowed to make use of groupshared memory.

-Mat

BleuBleu avatar Mar 12 '25 00:03 BleuBleu