Tint/tranfsorm/test: Refactor and add exhaustive test for Std140

This CL refactor unittests in std140_test.cc, and add exhaustive
parameterized unittests in std140_exhaustive_test.cc. In std140_test.cc,
only test Std140 transform result for `mat2x2<f32>` for matrix used as
array element type and `mat3x2<f32>` otherwise, and keep the source and
expected programs as plain WGSL code to ensure the readablity. In
std140_exhaustive_test.cc, all matrix shape and different constant index
are tested using parameterized WGSL code, at the cost of readablity.
This CL prepares for supporting f16 in Std140 transform by allowing
testing all shape of f16 matrix as well by simply adding parameters.

Bug: tint:1473, tint:1502
Change-Id: Ib2ef5bd806ee61eab04d73a415ba62c2191e2a7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104282
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This commit is contained in:
Zhaoming Jiang 2022-10-11 07:55:00 +00:00 committed by Dawn LUCI CQ
parent a880e661db
commit 5cbb32d764
4 changed files with 6804 additions and 1851 deletions

View File

@ -1214,6 +1214,7 @@ if (tint_build_unittests) {
"transform/simplify_pointers_test.cc", "transform/simplify_pointers_test.cc",
"transform/single_entry_point_test.cc", "transform/single_entry_point_test.cc",
"transform/spirv_atomic_test.cc", "transform/spirv_atomic_test.cc",
"transform/std140_exhaustive_test.cc",
"transform/std140_test.cc", "transform/std140_test.cc",
"transform/substitute_override_test.cc", "transform/substitute_override_test.cc",
"transform/test_helper.h", "transform/test_helper.h",

View File

@ -1130,6 +1130,7 @@ if(TINT_BUILD_TESTS)
transform/simplify_pointers_test.cc transform/simplify_pointers_test.cc
transform/single_entry_point_test.cc transform/single_entry_point_test.cc
transform/spirv_atomic_test.cc transform/spirv_atomic_test.cc
transform/std140_exhaustive_test.cc
transform/std140_test.cc transform/std140_test.cc
transform/substitute_override_test.cc transform/substitute_override_test.cc
transform/test_helper.h transform/test_helper.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff