Remove usage of tint::Validator
Validation is now automatically performed, and the Validator class is now redundant and will soon be removed from Tint. Bug: tint:642 Change-Id: I9ddbe523d85e2a4dfeff6d08324a6ca368d6cc74 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47124 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
5d2f2042de
commit
978c2e0105
|
@ -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<std::vector<uint32_t>> 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<tint::Program>(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<tint::Program>(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<uint32_t> spirv;
|
||||
DAWN_TRY_ASSIGN(spirv, ModuleToSPIRV(&program));
|
||||
DAWN_TRY(ValidateSpirv(spirv.data(), spirv.size()));
|
||||
|
|
Loading…
Reference in New Issue