mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
transform: Add a debug flag to dump WGSL
Before and after each transform of a transform::Manager. This change makes the transforms use the Castable system so we can get the transform name. Change-Id: I2cf9335960f1aca56f1d32c5ba0d104db4cc46c1 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54581 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: James Price <jrprice@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
aa5686acc3
commit
4511a2ebb6
@@ -773,6 +773,16 @@ int main(int argc, const char** argv) {
|
||||
|
||||
tint::SetInternalCompilerErrorReporter(&TintInternalCompilerErrorReporter);
|
||||
|
||||
#if TINT_BUILD_WGSL_WRITER
|
||||
tint::Program::printer = [](const tint::Program* program) {
|
||||
auto result = tint::writer::wgsl::Generate(program, {});
|
||||
if (!result.error.empty()) {
|
||||
return "error: " + result.error;
|
||||
}
|
||||
return result.wgsl;
|
||||
};
|
||||
#endif // TINT_BUILD_WGSL_WRITER
|
||||
|
||||
if (!ParseArgs(args, &options)) {
|
||||
std::cerr << "Failed to parse arguments." << std::endl;
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user