From 94d94e1f4afc57d2ef7f0062205323ce5263afd9 Mon Sep 17 00:00:00 2001 From: Andrey Tuganov Date: Wed, 1 Mar 2017 12:49:17 -0500 Subject: [PATCH] Validator: downgraded dupl type decl to warning Validator check for uniqueness of type declarations (commit 0e9c24fdd112e7742b9b5dcff35aee32e71a66fd) was causing failures in vulkancts tests. Downgrading from error to warning. --- source/validate_type_unique.cpp | 6 +++++- test/val/val_type_unique_test.cpp | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/source/validate_type_unique.cpp b/source/validate_type_unique.cpp index 857a0f5..c0dbeca 100644 --- a/source/validate_type_unique.cpp +++ b/source/validate_type_unique.cpp @@ -36,7 +36,11 @@ spv_result_t TypeUniquePass(ValidationState_t& _, } if (!_.RegisterUniqueTypeDeclaration(*inst)) { - return _.diag(SPV_ERROR_INVALID_DATA) + // TODO(atgoo@github) Error logging temporarily disabled because it's + // failing vulkancts tests. Message in the diagnostics is for unit tests. + // See https://github.com/KhronosGroup/SPIRV-Tools/issues/559 + // return _.diag(SPV_ERROR_INVALID_DATA) + return _.diag(SPV_SUCCESS) << "Duplicate non-aggregate type declarations are not allowed." << " Opcode: " << inst->opcode; } diff --git a/test/val/val_type_unique_test.cpp b/test/val/val_type_unique_test.cpp index f51cd9b..9dd44ed 100644 --- a/test/val/val_type_unique_test.cpp +++ b/test/val/val_type_unique_test.cpp @@ -25,10 +25,14 @@ namespace { using ::testing::HasSubstr; using std::string; -using std::pair; using ValidateTypeUnique = spvtest::ValidateBase; +// TODO(atgoo@github) Error logging temporarily disabled because it's failing +// vulkancts tests. See https://github.com/KhronosGroup/SPIRV-Tools/issues/559 +// const spv_result_t kDuplicateTypeError = SPV_ERROR_INVALID_DATA; +const spv_result_t kDuplicateTypeError = SPV_SUCCESS; + const string& GetHeader() { static const string header = R"( OpCapability Shader @@ -102,7 +106,7 @@ TEST_F(ValidateTypeUnique, duplicate_void) { %boolt2 = OpTypeVoid )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeVoid))); } @@ -111,7 +115,7 @@ TEST_F(ValidateTypeUnique, duplicate_bool) { %boolt2 = OpTypeBool )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeBool))); } @@ -120,7 +124,7 @@ TEST_F(ValidateTypeUnique, duplicate_int) { %uintt2 = OpTypeInt 32 0 )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeInt))); } @@ -129,7 +133,7 @@ TEST_F(ValidateTypeUnique, duplicate_float) { %floatt2 = OpTypeFloat 32 )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeFloat))); } @@ -138,7 +142,7 @@ TEST_F(ValidateTypeUnique, duplicate_vec3) { %vec3t2 = OpTypeVector %floatt 3 )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeVector))); } @@ -148,7 +152,7 @@ TEST_F(ValidateTypeUnique, duplicate_mat33) { %mat33t2 = OpTypeMatrix %vec3t 3 )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeMatrix))); } @@ -158,7 +162,7 @@ TEST_F(ValidateTypeUnique, duplicate_vfunc) { %vfunct2 = OpTypeFunction %voidt )" + GetBody(); CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeFunction))); } @@ -175,8 +179,7 @@ OpMemoryModel Physical32 OpenCL %ps2 = OpTypePipeStorage )"; CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, - ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypePipeStorage))); } @@ -192,8 +195,7 @@ OpMemoryModel Physical32 OpenCL %nb2 = OpTypeNamedBarrier )"; CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, - ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeNamedBarrier))); } -- 2.7.4