tint/transform: Include diagnostics in TINT_PRINT_PROGRAM_FOR_EACH_TRANSFORM

Change-Id: Id3e7e0cce464e8b1db00c2adab8db350eee0168c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111041
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-11-21 19:13:43 +00:00 committed by Dawn LUCI CQ
parent 87bccb74d8
commit 81ce4b6237
1 changed files with 8 additions and 4 deletions

View File

@ -37,11 +37,15 @@ Transform::ApplyResult Manager::Apply(const Program* program,
#if TINT_PRINT_PROGRAM_FOR_EACH_TRANSFORM
auto print_program = [&](const char* msg, const Transform* transform) {
auto wgsl = Program::printer(program);
std::cout << "---------------------------------------------------------" << std::endl;
std::cout << "-- " << msg << " " << transform->TypeInfo().name << ":" << std::endl;
std::cout << "---------------------------------------------------------" << std::endl;
std::cout << "=========================================================" << std::endl;
std::cout << "== " << msg << " " << transform->TypeInfo().name << ":" << std::endl;
std::cout << "=========================================================" << std::endl;
std::cout << wgsl << std::endl;
std::cout << "---------------------------------------------------------" << std::endl
if (!program->IsValid()) {
std::cout << "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" << std::endl;
std::cout << program->Diagnostics().str() << std::endl;
}
std::cout << "=========================================================" << std::endl
<< std::endl;
};
#endif