From a7392fbd8ade9c21c95ee5ad98cfcfe046375625 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 8 Jul 2021 12:00:31 +0000 Subject: [PATCH] [test]: Add test case for tint:369 Fixed: tint:369 Change-Id: Ib5f6c84bc8e0f43ab0034048ab1517335ae2d7bc Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57200 Auto-Submit: Ben Clayton Reviewed-by: Corentin Wallez Commit-Queue: Ben Clayton Kokoro: Kokoro --- test/bug/tint/369.wgsl | 6 ++++ test/bug/tint/369.wgsl.expected.hlsl | 9 ++++++ test/bug/tint/369.wgsl.expected.msl | 7 +++++ test/bug/tint/369.wgsl.expected.spvasm | 38 ++++++++++++++++++++++++++ test/bug/tint/369.wgsl.expected.wgsl | 8 ++++++ 5 files changed, 68 insertions(+) create mode 100644 test/bug/tint/369.wgsl create mode 100644 test/bug/tint/369.wgsl.expected.hlsl create mode 100644 test/bug/tint/369.wgsl.expected.msl create mode 100644 test/bug/tint/369.wgsl.expected.spvasm create mode 100644 test/bug/tint/369.wgsl.expected.wgsl diff --git a/test/bug/tint/369.wgsl b/test/bug/tint/369.wgsl new file mode 100644 index 0000000000..db09448054 --- /dev/null +++ b/test/bug/tint/369.wgsl @@ -0,0 +1,6 @@ +[[block]] struct S { + m : mat2x2; +}; + +[[group(0), binding(0)]] var SSBO : S; +[[group(0), binding(0)]] var UBO : S; diff --git a/test/bug/tint/369.wgsl.expected.hlsl b/test/bug/tint/369.wgsl.expected.hlsl new file mode 100644 index 0000000000..f7ba4cfc90 --- /dev/null +++ b/test/bug/tint/369.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +ByteAddressBuffer SSBO : register(t0, space0); +cbuffer cbuffer_UBO : register(b0, space0) { + uint4 UBO[1]; +}; diff --git a/test/bug/tint/369.wgsl.expected.msl b/test/bug/tint/369.wgsl.expected.msl new file mode 100644 index 0000000000..65ebdfbff2 --- /dev/null +++ b/test/bug/tint/369.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +struct S { + /* 0x0000 */ float2x2 m; +}; + diff --git a/test/bug/tint/369.wgsl.expected.spvasm b/test/bug/tint/369.wgsl.expected.spvasm new file mode 100644 index 0000000000..f71cf08004 --- /dev/null +++ b/test/bug/tint/369.wgsl.expected.spvasm @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 13 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %S "S" + OpMemberName %S 0 "m" + OpName %SSBO "SSBO" + OpName %UBO "UBO" + OpName %unused_entry_point "unused_entry_point" + OpDecorate %S Block + OpMemberDecorate %S 0 Offset 0 + OpMemberDecorate %S 0 ColMajor + OpMemberDecorate %S 0 MatrixStride 8 + OpDecorate %SSBO NonWritable + OpDecorate %SSBO DescriptorSet 0 + OpDecorate %SSBO Binding 0 + OpDecorate %UBO NonWritable + OpDecorate %UBO DescriptorSet 0 + OpDecorate %UBO Binding 0 + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat2v2float = OpTypeMatrix %v2float 2 + %S = OpTypeStruct %mat2v2float +%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S + %SSBO = OpVariable %_ptr_StorageBuffer_S StorageBuffer +%_ptr_Uniform_S = OpTypePointer Uniform %S + %UBO = OpVariable %_ptr_Uniform_S Uniform + %void = OpTypeVoid + %9 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %9 + %12 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/bug/tint/369.wgsl.expected.wgsl b/test/bug/tint/369.wgsl.expected.wgsl new file mode 100644 index 0000000000..72de20dfc2 --- /dev/null +++ b/test/bug/tint/369.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +[[block]] +struct S { + m : mat2x2; +}; + +[[group(0), binding(0)]] var SSBO : S; + +[[group(0), binding(0)]] var UBO : S;