diff options
Diffstat (limited to 'tests/language-feature/simple-inline.slang')
| -rw-r--r-- | tests/language-feature/simple-inline.slang | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/language-feature/simple-inline.slang b/tests/language-feature/simple-inline.slang new file mode 100644 index 000000000..8203f489b --- /dev/null +++ b/tests/language-feature/simple-inline.slang @@ -0,0 +1,34 @@ +// simple-inline.slang + +//TEST(compute):COMPARE_COMPUTE: -shaderobj +//TEST(compute):COMPARE_COMPUTE: -vk -shaderobj +//DISABLE_TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj + +[ForceInline] +int test(int r) +{ + return r+2; +} + +[ForceInline] +void testVoid(int r, out int result) +{ + if (r == 0) + { + result = 2; + return; + } + result = r + 3; +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(1, 1, 1)] +void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) +{ + outputBuffer[0] = test(dispatchThreadID.x); + int rs; + testVoid(dispatchThreadID.x + 2, rs); + outputBuffer[1] = rs; +} |
