Skip to content

Commit

Permalink
opt: Add TrimCapabilities pass to spirv-opt tool (#5545)
Browse files Browse the repository at this point in the history
Add an option to the spirv-opt tool to run the TrimCapabilitiesPass.
  • Loading branch information
sudonatalie authored Jan 26, 2024
1 parent b951948 commit 0a6f0d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/opt/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag,
pass_args.c_str());
return false;
}
} else if (pass_name == "trim-capabilities") {
RegisterPass(CreateTrimCapabilitiesPass());
} else {
Errorf(consumer(), nullptr, {},
"Unknown flag '--%s'. Use --help for a list of valid flags",
Expand Down
4 changes: 4 additions & 0 deletions tools/opt/opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ Options (in lexicographical order):)",
USR/SYS time are returned by getrusage() and can have a small
error.)");
printf(R"(
--trim-capabilities
Remove unnecessary capabilities and extensions declared within the
module.)");
printf(R"(
--upgrade-memory-model
Upgrades the Logical GLSL450 memory model to Logical VulkanKHR.
Transforms memory, image, atomic and barrier operations to conform
Expand Down

0 comments on commit 0a6f0d1

Please sign in to comment.