From 31579c92b2cc2c3448112354e0b8ca6283913095 Mon Sep 17 00:00:00 2001 From: David Neto Date: Mon, 26 Jul 2021 17:18:26 +0000 Subject: [PATCH] spir-reader: fix validity of unit tests - skip dumping due to SPIR-V Tools validation error for Location conflicts for IO variables duplicated on an OpEntryPoint interface list (SPIRV-Tools issue #4403) - Skip dumping for unit test for conversion of RelaxedPrecision decoration. Bug: tint:1043 Change-Id: I8ce3a7660d74b771e3fa62dc39e4e030e4ba6aa1 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59560 Kokoro: Kokoro Reviewed-by: James Price Commit-Queue: James Price Auto-Submit: David Neto --- .../spirv/parser_impl_get_decorations_test.cc | 1 + .../spirv/parser_impl_module_var_test.cc | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/reader/spirv/parser_impl_get_decorations_test.cc b/src/reader/spirv/parser_impl_get_decorations_test.cc index f4fa13d329..eb81a349d1 100644 --- a/src/reader/spirv/parser_impl_get_decorations_test.cc +++ b/src/reader/spirv/parser_impl_get_decorations_test.cc @@ -118,6 +118,7 @@ TEST_F(SpvParserGetDecorationsTest, GetDecorationsForMember_RelaxedPrecision) { EXPECT_THAT(decorations, UnorderedElementsAre(Decoration{SpvDecorationRelaxedPrecision})); EXPECT_TRUE(p->error().empty()); + p->SkipDumpingPending(kSkipReason); } // TODO(dneto): Enable when ArrayStride is handled diff --git a/src/reader/spirv/parser_impl_module_var_test.cc b/src/reader/spirv/parser_impl_module_var_test.cc index 11da9b7159..95ed7ddcd8 100644 --- a/src/reader/spirv/parser_impl_module_var_test.cc +++ b/src/reader/spirv/parser_impl_module_var_test.cc @@ -5549,15 +5549,22 @@ TEST_F(SpvModuleScopeVarParserTest, RegisterInputOutputVars) { R"( OpCapability Shader OpMemoryModel Logical Simple - OpEntryPoint GLCompute %1000 "w1000" - OpEntryPoint GLCompute %1100 "w1100" %1 - OpEntryPoint GLCompute %1200 "w1200" %2 %15 + OpEntryPoint Fragment %1000 "w1000" + OpEntryPoint Fragment %1100 "w1100" %1 + OpEntryPoint Fragment %1200 "w1200" %2 %15 ; duplication is tolerated prior to SPIR-V 1.4 - OpEntryPoint GLCompute %1300 "w1300" %1 %15 %2 %1 - OpExecutionMode %1000 LocalSize 1 1 1 - OpExecutionMode %1100 LocalSize 1 1 1 - OpExecutionMode %1200 LocalSize 1 1 1 - OpExecutionMode %1300 LocalSize 1 1 1 + OpEntryPoint Fragment %1300 "w1300" %1 %15 %2 %1 + OpExecutionMode %1000 OriginUpperLeft + OpExecutionMode %1100 OriginUpperLeft + OpExecutionMode %1200 OriginUpperLeft + OpExecutionMode %1300 OriginUpperLeft + + OpDecorate %1 Location 1 + OpDecorate %2 Location 2 + OpDecorate %5 Location 5 + OpDecorate %11 Location 1 + OpDecorate %12 Location 2 + OpDecorate %15 Location 5 )" + CommonTypes() + R"( @@ -5644,6 +5651,11 @@ TEST_F(SpvModuleScopeVarParserTest, RegisterInputOutputVars) { EXPECT_EQ(1u, info_1300.size()); EXPECT_THAT(info_1300[0].inputs, ElementsAre(1, 2)); EXPECT_THAT(info_1300[0].outputs, ElementsAre(15)); + + // Validation incorrectly reports an overlap for the duplicated variable %1 on + // shader %1300 + p->SkipDumpingPending( + "https://github.com/KhronosGroup/SPIRV-Tools/issues/4403"); } TEST_F(SpvModuleScopeVarParserTest, InputVarsConvertedToPrivate) {