diff options
Diffstat (limited to 'tests/serialization/serialized-module-test.slang')
| -rw-r--r-- | tests/serialization/serialized-module-test.slang | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/serialization/serialized-module-test.slang b/tests/serialization/serialized-module-test.slang new file mode 100644 index 000000000..63c31e039 --- /dev/null +++ b/tests/serialization/serialized-module-test.slang @@ -0,0 +1,35 @@ +// serialized-module-test.slang + +// A test to try out the basics of module +// serialization. + +//TEST:SIMPLE_EX: tests/serialization/serialized-module.slang -o tests/serialization/serialized-module.slang-module +//TEST:COMPARE_COMPUTE_EX:-slang -compute -xslang -r -xslang tests/serialization/serialized-module.slang-module + +//import serialized_module; + +// This is fragile - needs match the definition in serialized_module +struct Thing +{ + int a; + int b; +}; + +// TODO: need to get the name mangling to line up! +int foo(Thing thing); + +//TEST_INPUT:ubuffer(data=[0 0 0 0 ], stride=4):dxbinding(0),glbinding(0),out,name outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + Thing thing; + + int index = (int)dispatchThreadID.x; + + thing.a = index; + thing.b = -index; + + outputBuffer[index] = foo(thing); +} |
