/usr/bin/spirv-reduce - Reduce a SPIR-V binary file with respect to a user-provided interestingness test. USAGE: /usr/bin/spirv-reduce [options] -o -- [args...] The SPIR-V binary is read from . The reduced SPIR-V binary is written to . Whether a binary is interesting is determined by , which should be the path to a script. The "--" characters are optional but denote that all arguments that follow are positional arguments and thus will be forwarded to the interestingness test, and not parsed by /usr/bin/spirv-reduce. * The script must be executable. * The script should take the path to a SPIR-V binary file (.spv) as an argument, and exit with code 0 if and only if the binary file is interesting. The binary will be passed to the script as an argument after any other provided arguments [args...]. * Example: an interestingness test for reducing a SPIR-V binary file that causes tool "foo" to exit with error code 1 and print "Fatal error: bar" to standard error should: - invoke "foo" on the binary passed as the script argument; - capture the return code and standard error from "bar"; - exit with code 0 if and only if the return code of "foo" was 1 and the standard error from "bar" contained "Fatal error: bar". * The reducer does not place a time limit on how long the interestingness test takes to run, so it is advisable to use per-command timeouts inside the script when invoking SPIR-V-processing tools (such as "foo" in the above example). NOTE: The reducer is a work in progress. Options (in lexicographical order): --fail-on-validation-error Stop reduction with an error if any reduction step produces a SPIR-V module that fails to validate. -h, --help Print this help. --step-limit= 32-bit unsigned integer specifying maximum number of steps the reducer will take before giving up. --target-function= 32-bit unsigned integer specifying the id of a function in the input module. The reducer will restrict attention to this function, and will not make changes to other functions or to instructions outside of functions, except that some global instructions may be added in support of reducing the target function. If 0 is specified (the default) then all functions are reduced. --temp-file-prefix= Specifies a temporary file prefix that will be used to output temporary shader files during reduction. A number and .spv extension will be added. The default is "temp_", which will cause files like "temp_0001.spv" to be output to the current directory. --version Display reducer version information. Supported validator options are as follows. See `spirv-val --help` for details. --before-hlsl-legalization --relax-block-layout --relax-logical-pointer --relax-struct-store --scalar-block-layout --skip-block-layout