yum-mirror/slang

Making it easier to work with shaders

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

Yong HeVarious dxc/fxc compatibility fixes. (#2863)d52376a65

master
1.4 KiB74 linesraw
1//TEST_IGNORE_FILE:
2#version 460
3#extension GL_NV_ray_tracing : require
4layout(row_major) uniform;
5layout(row_major) buffer;
6struct Sphere_0
7{
8    vec3 position_0;
9    float radius_0;
10};
11
12struct SLANG_ParameterGroup_U_0
13{
14    Sphere_0 gSphere_0;
15};
16
17layout(binding = 0)
18layout(std140) uniform _S1
19{
20    Sphere_0 gSphere_0;
21} U_0;
22struct RayDesc_0
23{
24    vec3 Origin_0;
25    float TMin_0;
26    vec3 Direction_0;
27    float TMax_0;
28};
29
30struct SphereHitAttributes_0
31{
32    vec3 normal_0;
33};
34
35bool rayIntersectsSphere_0(RayDesc_0 ray_0, Sphere_0 sphere_0, out float tHit_0, out SphereHitAttributes_0 attrs_0)
36{
37    tHit_0 = sphere_0.radius_0;
38    attrs_0.normal_0 = sphere_0.position_0;
39    return tHit_0 >= ray_0.TMin_0;
40}
41
42hitAttributeNV
43SphereHitAttributes_0 a_0;
44
45bool ReportHit_0(float tHit_1, uint hitKind_0, SphereHitAttributes_0 attributes_0)
46{
47    a_0 = attributes_0;
48    bool _S2 = reportIntersectionNV(tHit_1, hitKind_0);
49    return _S2;
50}
51
52void main()
53{
54    RayDesc_0 ray_1;
55    vec3 _S3 = ((gl_ObjectRayOriginNV));
56    ray_1.Origin_0 = _S3;
57    vec3 _S4 = ((gl_ObjectRayDirectionNV));
58    ray_1.Direction_0 = _S4;
59    float _S5 = ((gl_RayTminNV));
60    ray_1.TMin_0 = _S5;
61    float _S6 = ((gl_RayTmaxNV));
62    ray_1.TMax_0 = _S6;
63    float tHit_2;
64    SphereHitAttributes_0 attrs_1;
65    bool _S7 = rayIntersectsSphere_0(ray_1, U_0.gSphere_0, tHit_2, attrs_1);
66    if(_S7)
67    {
68        bool _S8 = ReportHit_0(tHit_2, uint(0), attrs_1);
69    }
70    else
71    {
72    }
73    return;
74}