yum-mirror/slang

Making it easier to work with shaders

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

jsmall-nvidiaLanguage experiments (#2068)447b7e0e2

master
608 B31 linesraw
1//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
2
3/* Tests around interface/generics
4
5.slang(7): error 20001: unexpected '<', expected '{'
6interface IThing<T>
7*/
8
9// Docs say this should work...
10// https://github.com/shader-slang/slang/blob/master/docs/language-reference/07-declarations.md
11
12interface IThing<T>
13{
14    T get();
15};
16
17struct X : IThing<int>
18{
19    int get() { return 10; }
20};
21
22[numthreads(4, 1, 1)]
23void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
24{    
25    int index = dispatchThreadID.x;
26
27    X x;
28    IThing<int> i = x;
29    
30	outputBuffer[index] = i.get();
31}