diff options
| author | Yong He <yonghe@outlook.com> | 2024-08-18 10:37:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-18 10:37:41 -0700 |
| commit | ca5d303748517889a5d5849224671fa8945e1c6d (patch) | |
| tree | f25395b3b7227be3abec2da89114f85498b5f644 /tests | |
| parent | 25bc5a3ada5a2404f25ecf2de7d035ba60cd9fdf (diff) | |
Make sure to resolve overloaded expr for call args. (#4864)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/gh-4863.slang | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/bugs/gh-4863.slang b/tests/bugs/gh-4863.slang new file mode 100644 index 000000000..e1f4e1d2d --- /dev/null +++ b/tests/bugs/gh-4863.slang @@ -0,0 +1,36 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUFFER):-compute -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUFFER):-vk -compute -output-using-type + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +interface IFoo +{ + property float bar1 {get; set;} +}; + +struct Foo : IFoo +{ + uint4 data = 0; + property float bar1 + { + get { return asfloat(data.w); } + set { data.w = asuint(newValue); } + } +}; + +void doThing(inout Foo foo, uint2 ipos) +{ + foo.bar1 = 2; + foo.bar1 += 1.0f; +} + +[shader("compute")] +[numthreads(1, 1, 1)] +void computeMain(uint2 ipos : SV_DispatchThreadID) +{ + Foo foo; + doThing(foo, ipos); + // BUFFER: 3 + outputBuffer[0] = (int)foo.bar1; +}
\ No newline at end of file |
