diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/serialization/std-lib-serialize.slang | 32 | ||||
| -rw-r--r-- | tests/serialization/std-lib-serialize.slang.expected.txt | 4 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/serialization/std-lib-serialize.slang b/tests/serialization/std-lib-serialize.slang new file mode 100644 index 000000000..e55a2cd69 --- /dev/null +++ b/tests/serialization/std-lib-serialize.slang @@ -0,0 +1,32 @@ +//TEST:COMPILE: -save-stdlib +//TEST:COMPARE_COMPUTE: -compile-arg -load-stdlib + +struct A +{ + float x; + + float addWith(float y) + { + return this.x + y; + } +}; + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<float> outputBuffer : register(u0); + + +float test(float inVal) +{ + A a; + a.x = inVal; + return a.addWith(inVal*inVal); +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + float inVal = float(tid); + float outVal = test(inVal); + outputBuffer[tid] = outVal; +}
\ No newline at end of file diff --git a/tests/serialization/std-lib-serialize.slang.expected.txt b/tests/serialization/std-lib-serialize.slang.expected.txt new file mode 100644 index 000000000..f73cfe6c3 --- /dev/null +++ b/tests/serialization/std-lib-serialize.slang.expected.txt @@ -0,0 +1,4 @@ +0 +40000000 +40C00000 +41400000 |
