blob: a0b3715198a582de2601995cafe90af883f58651 (
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
25
26
27
28
|
// precompiled-dxil-generics.slang
// A test that uses slang-modules with embedded precompiled DXIL and a library containing generics.
// The test compiles a library slang (export-library-generics.slang) with -embed-downstream-ir then links the
// library to entrypoint slang (this file).
// The test passes if there is no errror thrown.
// TODO: Check if final linkage used only the precompiled dxil.
//TEST(windows):COMPILE: tests/library/export-library-generics.slang -o tests/library/export-library-generics.slang-module -target dxil -embed-downstream-ir -profile lib_6_6 -incomplete-library
//TEST(windows):COMPILE: tests/library/precompiled-dxil-generics.slang -target dxil -stage anyhit -entry anyhit -o tests/library/linked.dxil
import "export-library-generics";
struct Payload
{
int val;
}
struct Attributes
{
float2 bary;
}
[shader("anyhit")]
void anyhit(inout Payload payload, Attributes attrib)
{
payload.val = normalFunc(x * y) + normalFuncUsesGeneric(y);
}
|