Validator: downgraded dupl type decl to warning

Validator check for uniqueness of type declarations
(commit 0e9c24fdd1)
was causing failures in vulkancts tests.

Downgrading from error to warning.
This commit is contained in:
Andrey Tuganov 2017-03-01 12:49:17 -05:00 committed by David Neto
parent 6a2b514826
commit 94d94e1f4a
2 changed files with 19 additions and 13 deletions

View File

@ -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;
}

View File

@ -25,10 +25,14 @@ namespace {
using ::testing::HasSubstr;
using std::string;
using std::pair;
using ValidateTypeUnique = spvtest::ValidateBase<bool>;
// 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)));
}