From ca5d303748517889a5d5849224671fa8945e1c6d Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 18 Aug 2024 10:37:41 -0700 Subject: Make sure to resolve overloaded expr for call args. (#4864) --- tests/bugs/gh-4863.slang | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/bugs/gh-4863.slang (limited to 'tests/bugs') 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 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 -- cgit v1.2.3