From f875d3f5ba9c1ddc6aa9a0960efd5ab27ae4e4c9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 9 Aug 2023 20:11:09 -0700 Subject: Support implciit casted swizzled lvalue. (#3077) * Support implciit casted swizzled lvalue. * Fix warnings. * Fix. * fix comment. * Prefer mangled linkage name for global params. * Update tests. --------- Co-authored-by: Yong He --- tests/bugs/implicit-cast.slang | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/bugs/implicit-cast.slang (limited to 'tests/bugs/implicit-cast.slang') diff --git a/tests/bugs/implicit-cast.slang b/tests/bugs/implicit-cast.slang new file mode 100644 index 000000000..2ee62cc87 --- /dev/null +++ b/tests/bugs/implicit-cast.slang @@ -0,0 +1,18 @@ +//TEST(compute):COMPARE_COMPUTE:-vk -shaderobj + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name gBuffer +RWStructuredBuffer gBuffer; + +int getX(int4 v) { return v.x; } + +[numthreads(1, 1, 1)] +void computeMain(uint3 tid: SV_DispatchThreadID, uint GI: SV_GroupIndex) +{ + if (GI< 1) + { + uint LdsCoord = GI; + uint a = gBuffer[LdsCoord]; + LdsCoord += 1; + gBuffer[LdsCoord] = 1; + } +} -- cgit v1.2.3