diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp index af6b2d7b1e..9090119ef0 100644 --- a/src/dawn_native/ShaderModule.cpp +++ b/src/dawn_native/ShaderModule.cpp @@ -428,25 +428,6 @@ namespace dawn_native { return std::move(program); } - MaybeError ValidateModule(const tint::Program* program, - OwnedCompilationMessages* outMessages) { - std::ostringstream errorStream; - errorStream << "Tint program validation" << std::endl; - - tint::Validator validator; - bool isValid = validator.Validate(program); - if (outMessages != nullptr) { - outMessages->AddMessages(validator.diagnostics()); - } - if (!isValid) { - auto err = validator.diagnostics().str(); - errorStream << "Validation: " << err << std::endl; - return DAWN_VALIDATION_ERROR(errorStream.str().c_str()); - } - - return {}; - } - ResultOrError> ModuleToSPIRV(const tint::Program* program) { std::ostringstream errorStream; errorStream << "Tint SPIR-V writer failure:" << std::endl; @@ -1093,9 +1074,6 @@ namespace dawn_native { if (device->IsToggleEnabled(Toggle::UseTintGenerator)) { tint::Program program; DAWN_TRY_ASSIGN(program, ParseSPIRV(spirv, outMessages)); - if (device->IsValidationEnabled()) { - DAWN_TRY(ValidateModule(&program, outMessages)); - } parseResult->tintProgram = std::make_unique(std::move(program)); } else { if (device->IsValidationEnabled()) { @@ -1116,9 +1094,6 @@ namespace dawn_native { DAWN_TRY_ASSIGN(program, ParseWGSL(&file, outMessages)); if (device->IsToggleEnabled(Toggle::UseTintGenerator)) { - if (device->IsValidationEnabled()) { - DAWN_TRY(ValidateModule(&program, outMessages)); - } parseResult->tintProgram = std::make_unique(std::move(program)); } else { tint::transform::Manager transformManager; @@ -1128,10 +1103,6 @@ namespace dawn_native { DAWN_TRY_ASSIGN(program, RunTransforms(&transformManager, &program, outMessages)); - if (device->IsValidationEnabled()) { - DAWN_TRY(ValidateModule(&program, outMessages)); - } - std::vector spirv; DAWN_TRY_ASSIGN(spirv, ModuleToSPIRV(&program)); DAWN_TRY(ValidateSpirv(spirv.data(), spirv.size()));