yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
d52376a65
master
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{ 8vec3 position_0 ; 9float radius_0 ; 10}; 11 12struct SLANG_ParameterGroup_U_0 13{ 14Sphere_0 gSphere_0 ; 15}; 16 17layout (binding = 0 ) 18layout (std140 )uniform _S1 19{ 20Sphere_0 gSphere_0 ; 21}U_0 ; 22struct RayDesc_0 23{ 24vec3 Origin_0 ; 25float TMin_0 ; 26vec3 Direction_0 ; 27float TMax_0 ; 28}; 29 30struct SphereHitAttributes_0 31{ 32vec3 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{ 37tHit_0 = sphere_0 .radius_0 ; 38attrs_0 .normal_0 = sphere_0 .position_0 ; 39return 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{ 47a_0 = attributes_0 ; 48bool _S2 = reportIntersectionNV (tHit_1 ,hitKind_0 ); 49return _S2 ; 50} 51 52void main () 53{ 54RayDesc_0 ray_1 ; 55vec3 _S3 = ((gl_ObjectRayOriginNV )); 56ray_1 .Origin_0 = _S3 ; 57vec3 _S4 = ((gl_ObjectRayDirectionNV )); 58ray_1 .Direction_0 = _S4 ; 59float _S5 = ((gl_RayTminNV )); 60ray_1 .TMin_0 = _S5 ; 61float _S6 = ((gl_RayTmaxNV )); 62ray_1 .TMax_0 = _S6 ; 63float tHit_2 ; 64SphereHitAttributes_0 attrs_1 ; 65bool _S7 = rayIntersectsSphere_0 (ray_1 ,U_0 .gSphere_0 ,tHit_2 ,attrs_1 ); 66if (_S7 ) 67 { 68bool _S8 = ReportHit_0 (tHit_2 ,uint (0 ),attrs_1 ); 69 } 70else 71 { 72 } 73return ; 74}