From 8d2f6e4ddceb83009bb5f6b3d49001a2fd3cd761 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Mon, 24 Jun 2024 10:20:19 -0400 Subject: Add case to `emitVectorReshape` for when using a `vector` type with `T` value (#4419) * Add case to `emitVectorReshape` for `vector<>` type, `scalar` value 1. Add new case 2. Add test * fix warning * fix warning --- tests/bugs/gh-4411.slang | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/bugs/gh-4411.slang (limited to 'tests') diff --git a/tests/bugs/gh-4411.slang b/tests/bugs/gh-4411.slang new file mode 100644 index 000000000..06adff0b3 --- /dev/null +++ b/tests/bugs/gh-4411.slang @@ -0,0 +1,22 @@ +//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -dx12 -use-dxil -shaderobj + +//TEST_INPUT:RWTexture1D(format=R32_UINT, size=8, content = zero, mipMaps = 1):name=texture1D +RWTexture1D texture1D; + +//TEST_INPUT:RWTexture2D(format=R32_UINT, size=8, content = zero, mipMaps = 1):name=texture2D +RWTexture2D texture2D; + +//TEST_INPUT:ubuffer(data=[0]):out,name=outputBuffer +RWStructuredBuffer outputBuffer; + +void computeMain() { + texture1D[1].x = 15; + texture2D[uint2(2, 3)].x = 16; + + outputBuffer[0] = uint(true + && texture1D[1].x == 15 + && texture2D[uint2(2, 3)].x == 16 + ); + //BUF: 1 +} \ No newline at end of file -- cgit v1.2.3