From 98ff41989b04ce883e9dc9f4464c45290d30c560 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Mon, 17 Mar 2025 15:05:11 +0200 Subject: Add error diagnostic vectors and matrices with disallowed element types (#6596) - Add the diagnostic messages, and code to emit them - Add some tests This helps to address issue #6183. --- tests/compute/integer-matrix-diagnostic.slang | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/compute/integer-matrix-diagnostic.slang (limited to 'tests/compute/integer-matrix-diagnostic.slang') diff --git a/tests/compute/integer-matrix-diagnostic.slang b/tests/compute/integer-matrix-diagnostic.slang new file mode 100644 index 000000000..bd69c28e4 --- /dev/null +++ b/tests/compute/integer-matrix-diagnostic.slang @@ -0,0 +1,22 @@ +// Check that using matrices with integer floating point type yields the correct diagnostic + +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target glsl -entry computeMain -stage compute +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target metal -entry computeMain -stage compute +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv -entry computeMain -stage compute +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target wgsl -entry computeMain -stage compute + +cbuffer MatrixBuffer +{ + // CHECK: error 38202 + int4x4 iMatrix; +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out, name=outputBuffer +RWStructuredBuffer outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint index = dispatchThreadID.x; + outputBuffer[index] = iMatrix[0][0]; +} \ No newline at end of file -- cgit v1.2.3