/usr/bin/spirv-val - Validate a SPIR-V binary file(s).
USAGE: /usr/bin/spirv-val [options] [<path>]
The SPIR-V binary is read from <path>. If no path is specified,
or if the path is "-", then the binary is read from standard input.
The <path> parameter may also specify a directory; in this case,
the tool will recursively process all regular files with the .spv
extension within that directory.
NOTE: The validator is a work in progress.
Options:
-h, --help Print this help.
--max-struct-members <maximum number of structure members allowed>
--max-struct-depth <maximum allowed nesting depth of structures>
--max-local-variables <maximum number of local variables allowed>
--max-global-variables <maximum number of global variables allowed>
--max-switch-branches <maximum number of branches allowed in switch statements>
--max-function-args <maximum number arguments allowed per function>
--max-control-flow-nesting-depth <maximum Control Flow nesting depth allowed>
--max-access-chain-indexes <maximum number of indexes allowed to use for Access Chain instructions>
--max-id-bound <maximum value for the id bound>
--relax-logical-pointer Allow allocating an object of a pointer type and returning
a pointer value from a function in logical addressing mode
--relax-block-layout Enable VK_KHR_relaxed_block_layout when checking standard
uniform, storage buffer, and push constant layouts.
This is the default when targeting Vulkan 1.1 or later.
--uniform-buffer-standard-layout Enable VK_KHR_uniform_buffer_standard_layout when checking standard
uniform buffer layouts.
--scalar-block-layout Enable VK_EXT_scalar_block_layout when checking standard
uniform, storage buffer, and push constant layouts. Scalar layout
rules are more permissive than relaxed block layout so in effect
this will override the --relax-block-layout option.
--workgroup-scalar-block-layout Enable scalar block layout when checking Workgroup block layouts.
--skip-block-layout Skip checking standard uniform/storage buffer layout.
Overrides any --relax-block-layout or --scalar-block-layout option.
--relax-struct-store Allow store from one struct type to a
different type with compatible layout and
members.
--allow-localsizeid Allow use of the LocalSizeId decoration where it would otherwise not
be allowed by the target environment.
--allow-offset-texture-operand Allow use of the Offset texture operands where it would otherwise not
be allowed by the target environment.
--allow-vulkan-32-bit-bitwise Allow use of non-32 bit for the Base operand where it would otherwise
not be allowed by the target environment.
--before-hlsl-legalization Allows code patterns that are intended to be
fixed by spirv-opt's legalization passes.
--buffer-descriptor-layout <size>:<align> Set size and alignment for buffer and acceleration structure descriptor heap resources.
--image-descriptor-layout <size>:<align> Set size and alignment for image and sampled image descriptor heap resources.
--sampler-descriptor-layout <size>:<align> Set size and alignment for sampler descriptor heap resources.
--tensor-descriptor-layout <size>:<align> Set size and alignment for tensor descriptor heap resources.
--version Display validator version information.
--target-env {vulkan1.0|vulkan1.1spv1.4|vulkan1.1|vulkan1.2|vulkan1.3|vulkan1.4
|spv1.0|spv1.1|spv1.2|spv1.3|spv1.4|spv1.5|spv1.6|opencl1.2embedded
|opencl1.2|opencl2.0embedded|opencl2.0|opencl2.1embedded|opencl2.1
|opencl2.2embedded|opencl2.2|opengl4.0|opengl4.1|opengl4.2|opengl4.3
|opengl4.5}
Use validation rules from the specified environment.
Options (25)
| Option | Description | Source |
|---|---|---|
-h, --help | Print this help. | help |
--max-struct-members | <maximum number of structure members allowed> | help |
--max-struct-depth | <maximum allowed nesting depth of structures> | help |
--max-local-variables | <maximum number of local variables allowed> | help |
--max-global-variables | <maximum number of global variables allowed> | help |
--max-switch-branches | <maximum number of branches allowed in switch statements> | help |
--max-function-args | <maximum number arguments allowed per function> | help |
--max-access-chain-indexes | <maximum number of indexes allowed to use for Access Chain instructions> | help |
--max-id-bound | <maximum value for the id bound> | help |
--relax-logical-pointer | Allow allocating an object of a pointer type and returning a pointer value from a function in logical addressing mode | help |
--relax-block-layout | Enable VK_KHR_relaxed_block_layout when checking standard uniform, storage buffer, and push constant layouts. | help |
--scalar-block-layout | Enable VK_EXT_scalar_block_layout when checking standard uniform, storage buffer, and push constant layouts. | help |
--workgroup-scalar-block-layout | Enable scalar block layout when checking Workgroup block layouts. | help |
--skip-block-layout | Skip checking standard uniform/storage buffer layout. | help |
--relax-struct-store | Allow store from one struct type to a different type with compatible layout and members. | help |
--allow-localsizeid | Allow use of the LocalSizeId decoration where it would otherwise not be allowed by the target environment. | help |
--allow-offset-texture-operand | Allow use of the Offset texture operands where it would otherwise not be allowed by the target environment. | help |
--allow-vulkan-32-bit-bitwise | Allow use of non-32 bit for the Base operand where it would otherwise not be allowed by the target environment. | help |
--before-hlsl-legalization | Allows code patterns that are intended to be fixed by spirv-opt's legalization passes. | help |
--buffer-descriptor-layout | <size>:<align> Set size and alignment for buffer and acceleration structure descriptor heap resources. | help |
--image-descriptor-layout | <size>:<align> Set size and alignment for image and sampled image descriptor heap resources. | help |
--sampler-descriptor-layout | <size>:<align> Set size and alignment for sampler descriptor heap resources. | help |
--tensor-descriptor-layout | <size>:<align> Set size and alignment for tensor descriptor heap resources. | help |
--version | Display validator version information. | help |
--target-env | {vulkan1.0|vulkan1.1spv1.4|vulkan1.1|vulkan1.2|vulkan1.3|vulkan1.4 |spv1.0|spv1.1|spv1.2|spv1.3|spv1.4|spv1.5|spv1.6|opencl1.2embedded… | help |