diff options
| -rw-r--r-- | tests/bugs/inherit-interface.slang | 38 | ||||
| -rw-r--r-- | tests/bugs/inherit-interface.slang.expected.txt | 5 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/bugs/inherit-interface.slang b/tests/bugs/inherit-interface.slang new file mode 100644 index 000000000..3b348d12e --- /dev/null +++ b/tests/bugs/inherit-interface.slang @@ -0,0 +1,38 @@ +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<float> outputBuffer; + +interface IA +{ + int doThing(int a); +}; + +interface IB : IA +{ + int anotherThing(int a); +}; + +struct Struct : IB +{ + int doThing(int a) { return a + 1; } + int anotherThing(int a) { return a * a; } +}; + +int doThing<B : IB>(B b, int c) +{ + return b.doThing(c) + b.anotherThing(c); +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + + Struct s; + int v = doThing(s, int(tid)); + + float inVal = float(tid + v); + + outputBuffer[tid] = inVal; +}
\ No newline at end of file diff --git a/tests/bugs/inherit-interface.slang.expected.txt b/tests/bugs/inherit-interface.slang.expected.txt new file mode 100644 index 000000000..fe70e7eb6 --- /dev/null +++ b/tests/bugs/inherit-interface.slang.expected.txt @@ -0,0 +1,5 @@ +type: float +1.000000 +4.000000 +9.000000 +16.000000 |
