blob: e168c19fe99d1ff682aef80e3d434774b6f87397 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// link-time-options.slang
// Test that we can pass in additional compiler options
// at link time.
// Lowers to `DOWNSTREAM_VALUE`, a macro that we will define
// for downstream compilation through link-time options.
float getMacroDefinedForDownstream()
{
__intrinsic_asm "(DOWNSTREAM_VALUE)";
}
[shader("compute")]
[numthreads(4,1,1)]
void computeMain(
uint3 sv_dispatchThreadID : SV_DispatchThreadID,
uniform RWStructuredBuffer<float> buffer)
{
buffer[sv_dispatchThreadID.x] = getMacroDefinedForDownstream();
}
|