yum-mirror/slang

Making it easier to work with shaders

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

Yong HeAdd slangc interface to compile and use ir modules. (#3615)401d8cdb1

master
1.4 KiB29 linesraw
1//TEST:COMPILE: tests/serialization/obfuscated-loc-module.slang -o tests/serialization/obfuscated-loc-module.zip -g -obfuscate 
2//TEST:SIMPLE(filecheck=CHECK):-target hlsl -stage compute -entry computeMain -obfuscate -r tests/serialization/obfuscated-loc-module.zip 
3//TEST:COMPILE: tests/serialization/obfuscated-loc-module.slang -o tests/serialization/obfuscated-loc-module.slang-module -g -obfuscate 
4//TEST:SIMPLE(filecheck=CHECK):-target hlsl -stage compute -entry computeMain -obfuscate -r tests/serialization/obfuscated-loc-module.slang-module
5//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
6RWStructuredBuffer<float> outputBuffer;
7
8// CHECK: {{.*}}: error 40020: loop does not terminate within the limited number of iterations, unrolling is aborted.
9
10// This test checks obfuscated source map loc tracking through a round trip, and producing a location correctly from slang-module that has a source map
11
12// We *don't* import because if we do we'll get a fresh compilation from source... we want to make sure it's using the -r module
13//import obfuscated_loc_module;
14extern int silly(int v);
15extern int billy(int v);
16
17[numthreads(1, 1, 1)]
18void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
19{
20    int x = int(dispatchThreadID.x);
21    
22    x = billy(x);
23    
24    // Will produce an error, because silly has an error.
25    int v = silly(x);
26    
27    outputBuffer[x] = v;
28}
29