summaryrefslogtreecommitdiffstats
path: root/tests/modules/hit.slang
blob: d175275b4708f4201374334f5dd7a2aeb1103c53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//TEST:COMPILE: tests/modules/environment.slang -o tests/modules/environment.slang-module
//TEST:COMPILE: tests/modules/hit.slang -stage closesthit -entry closesthit -target dxil -o monolithic.dxil

import environment;

StructuredBuffer <Environment_sample_data> environment_sample_buffer;

float3 sample_lights(inout uint seed)
{
    return environment_sample(environment_sample_buffer, seed);
}

struct RadianceHitInfo
{
    float3 contribution;
};

struct Attributes
{
    float2 bary;
};

[shader("closesthit")]
void closesthit(inout RadianceHitInfo payload, Attributes attrib) {}