diff options
Diffstat (limited to 'tests/current-bugs/generic/matrix.slang')
| -rw-r--r-- | tests/current-bugs/generic/matrix.slang | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/current-bugs/generic/matrix.slang b/tests/current-bugs/generic/matrix.slang new file mode 100644 index 000000000..d660b699c --- /dev/null +++ b/tests/current-bugs/generic/matrix.slang @@ -0,0 +1,28 @@ +//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj + +/* A test to use generics around resource/built in types. + +Doesn't work + +.slang(5): error 30019: expected an expression of type 'int', got 'typeof(W)' + matrix<float, W, H> values; + */ + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<int> outputBuffer; + +struct Another<W : int, H : int> +{ + matrix<float, W, H> values; +}; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int index = dispatchThreadID.x; + + Another<2, 4> a = {}; + + outputBuffer[index] = index; +} + |
