yum-mirror/slang

Making it easier to work with shaders

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

venkataram-nvAvoiding the use of the global AST builder in DeclRefType::create (#4866)25bc5a3ad

master
585 B24 linesraw
1//TEST:COMPILE: tests/modules/environment.slang -o tests/modules/environment.slang-module
2//TEST:COMPILE: tests/modules/hit.slang -stage closesthit -entry closesthit -target dxil -o monolithic.dxil
3
4import environment;
5
6StructuredBuffer <Environment_sample_data> environment_sample_buffer;
7
8float3 sample_lights(inout uint seed)
9{
10    return environment_sample(environment_sample_buffer, seed);
11}
12
13struct RadianceHitInfo
14{
15    float3 contribution;
16};
17
18struct Attributes
19{
20    float2 bary;
21};
22
23[shader("closesthit")]
24void closesthit(inout RadianceHitInfo payload, Attributes attrib) {}