yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeFix function side-effectness prop logic. (#2875)38ed03a72

master
650 B32 linesraw
1RaytracingAccelerationStructure gScene_0 : register(t0);
2
3RWStructuredBuffer<int > gOutput_0 : register(u0);
4
5float3 helper_0(RayQuery<int(0) > q_0)
6{
7    RayQuery<int(0) > _S1 = q_0;
8
9    RayDesc ray_0;
10    float3 _S2 = (float3)0.0;
11
12    ray_0.Origin = _S2;
13    ray_0.Direction = _S2;
14    ray_0.TMin = 0.0;
15    ray_0.TMax = 1000.0;
16    _S1.TraceRayInline(gScene_0, 0U, 4294967295U, ray_0);
17
18    return _S1.WorldRayDirection();
19}
20
21
22[shader("compute")][numthreads(1, 1, 1)]
23void computeMain(uint tid_0 : SV_DISPATCHTHREADID)
24{
25    RayQuery<int(0) > rayQuery_0;
26
27    int _S3 = int(helper_0(rayQuery_0).x);
28
29    gOutput_0[tid_0.x] = _S3;
30    return;
31}
32