You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,193 +54,195 @@ the usage instructions the backend and nightly Rust version are referred to as "
54
54
55
55
## Usage
56
56
57
+
All the following arguments for the `build` and `install` commands can also be set in the shader crate's `Cargo.toml`
58
+
file. In general usage that would be the recommended way to set config. See `crates/shader-crate-template/Cargo.toml`
59
+
for an example.
60
+
57
61
````
58
-
Commands:
59
-
install Install rust-gpu compiler artifacts
60
-
build Compile a shader crate to SPIR-V
61
-
toml Compile a shader crate according to the `cargo gpu build` parameters found in the given toml file
62
-
show Show some useful values
63
-
help Print this message or the help of the given subcommand(s)
62
+
Commands:
63
+
install Install rust-gpu compiler artifacts
64
+
build Compile a shader crate to SPIR-V
65
+
show Show some useful values
66
+
help Print this message or the help of the given subcommand(s)
64
67
65
-
Options:
66
-
-h, --help
67
-
Print help
68
+
Options:
69
+
-h, --help
70
+
Print help
68
71
69
-
-V, --version
70
-
Print version
72
+
-V, --version
73
+
Print version
71
74
72
75
73
76
* Install
77
+
Install rust-gpu compiler artifacts
74
78
75
-
Install rust-gpu compiler artifacts
76
-
77
-
Usage: cargo-gpu install [OPTIONS]
79
+
Usage: cargo-gpu install [OPTIONS]
78
80
79
-
Options:
80
-
--shader-crate <SHADER_CRATE>
81
-
Directory containing the shader crate to compile
81
+
Options:
82
+
--shader-crate <SHADER_CRATE>
83
+
Directory containing the shader crate to compile
82
84
83
-
[default: ./]
85
+
[default: ./]
84
86
85
-
--spirv-builder-source <SPIRV_BUILDER_SOURCE>
86
-
Source of `spirv-builder` dependency Eg: "https://github.com/Rust-GPU/rust-gpu"
87
+
--spirv-builder-source <SPIRV_BUILDER_SOURCE>
88
+
Source of `spirv-builder` dependency Eg: "https://github.com/Rust-GPU/rust-gpu"
87
89
88
-
--spirv-builder-version <SPIRV_BUILDER_VERSION>
89
-
Version of `spirv-builder` dependency.
90
-
* If `--spirv-builder-source` is not set, then this is assumed to be a crates.io semantic
91
-
version such as "0.9.0".
92
-
* If `--spirv-builder-source` is set, then this is assumed to be a Git "commitsh", such
93
-
as a Git commit hash or a Git tag, therefore anything that `git checkout` can resolve.
90
+
--spirv-builder-version <SPIRV_BUILDER_VERSION>
91
+
Version of `spirv-builder` dependency.
92
+
* If `--spirv-builder-source` is not set, then this is assumed to be a crates.io semantic
93
+
version such as "0.9.0".
94
+
* If `--spirv-builder-source` is set, then this is assumed to be a Git "commitsh", such
95
+
as a Git commit hash or a Git tag, therefore anything that `git checkout` can resolve.
94
96
95
-
--rust-toolchain <RUST_TOOLCHAIN>
96
-
Rust toolchain channel to use to build `spirv-builder`.
97
+
--rust-toolchain <RUST_TOOLCHAIN>
98
+
Rust toolchain channel to use to build `spirv-builder`.
97
99
98
-
This must be compatible with the `spirv_builder` argument as defined in the `rust-gpu` repo.
100
+
This must be compatible with the `spirv_builder` argument as defined in the `rust-gpu` repo.
99
101
100
-
--force-spirv-cli-rebuild
101
-
Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt
102
+
--force-spirv-cli-rebuild
103
+
Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt
102
104
103
-
--auto-install-rust-toolchain
104
-
Assume "yes" to "Install Rust toolchain: [y/n]" prompt
105
+
--auto-install-rust-toolchain
106
+
Assume "yes" to "Install Rust toolchain: [y/n]" prompt
105
107
106
-
-h, --help
107
-
Print help (see a summary with '-h')
108
+
-h, --help
109
+
Print help (see a summary with '-h')
108
110
109
111
110
112
* Build
113
+
Compile a shader crate to SPIR-V
111
114
112
-
Compile a shader crate to SPIR-V
113
-
114
-
Usage: cargo-gpu build [OPTIONS]
115
-
116
-
Options:
117
-
--shader-crate <SHADER_CRATE>
118
-
Directory containing the shader crate to compile
115
+
Usage: cargo-gpu build [OPTIONS]
119
116
120
-
[default: ./]
117
+
Options:
118
+
--shader-crate <SHADER_CRATE>
119
+
Directory containing the shader crate to compile
121
120
122
-
--spirv-builder-source <SPIRV_BUILDER_SOURCE>
123
-
Source of `spirv-builder` dependency Eg: "https://github.com/Rust-GPU/rust-gpu"
121
+
[default: ./]
124
122
125
-
--spirv-builder-version <SPIRV_BUILDER_VERSION>
126
-
Version of `spirv-builder` dependency.
127
-
* If `--spirv-builder-source` is not set, then this is assumed to be a crates.io semantic
128
-
version such as "0.9.0".
129
-
* If `--spirv-builder-source` is set, then this is assumed to be a Git "commitsh", such
130
-
as a Git commit hash or a Git tag, therefore anything that `git checkout` can resolve.
123
+
--spirv-builder-source <SPIRV_BUILDER_SOURCE>
124
+
Source of `spirv-builder` dependency Eg: "https://github.com/Rust-GPU/rust-gpu"
131
125
132
-
--rust-toolchain <RUST_TOOLCHAIN>
133
-
Rust toolchain channel to use to build `spirv-builder`.
126
+
--spirv-builder-version <SPIRV_BUILDER_VERSION>
127
+
Version of `spirv-builder` dependency.
128
+
* If `--spirv-builder-source` is not set, then this is assumed to be a crates.io semantic
129
+
version such as "0.9.0".
130
+
* If `--spirv-builder-source` is set, then this is assumed to be a Git "commitsh", such
131
+
as a Git commit hash or a Git tag, therefore anything that `git checkout` can resolve.
134
132
135
-
This must be compatible with the `spirv_builder` argument as defined in the `rust-gpu` repo.
133
+
--rust-toolchain <RUST_TOOLCHAIN>
134
+
Rust toolchain channel to use to build `spirv-builder`.
136
135
137
-
--force-spirv-cli-rebuild
138
-
Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt
136
+
This must be compatible with the `spirv_builder` argument as defined in the `rust-gpu` repo.
139
137
140
-
--auto-install-rust-toolchain
141
-
Assume "yes" to "Install Rust toolchain: [y/n]" prompt
138
+
--force-spirv-cli-rebuild
139
+
Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt
142
140
143
-
--shader-target <SHADER_TARGET>
144
-
Shader target
141
+
--auto-install-rust-toolchain
142
+
Assume "yes" to "Install Rust toolchain: [y/n]" prompt
145
143
146
-
[default: spirv-unknown-vulkan1.2]
144
+
-o, --output-dir <OUTPUT_DIR>
145
+
Path to the output directory for the compiled shaders
147
146
148
-
--no-default-features
149
-
Set cargo default-features
147
+
[default: ./]
150
148
151
-
--features <FEATURES>
152
-
Set cargo features
149
+
--no-default-features
150
+
Set cargo default-features
153
151
154
-
-o, --output-dir <OUTPUT_DIR>
155
-
Path to the output directory for the compiled shaders
152
+
--features <FEATURES>
153
+
Set cargo features
156
154
157
-
[default: ./]
155
+
--target <TARGET>
156
+
`rust-gpu` compile target
158
157
159
-
-h, --help
160
-
Print help (see a summary with '-h')
158
+
[default: spirv-unknown-vulkan1.2]
161
159
160
+
--shader-target <SHADER_TARGET>
161
+
Shader target
162
162
163
-
* Toml
163
+
[default: spirv-unknown-vulkan1.2]
164
164
165
-
Compile a shader crate according to the `cargo gpu build` parameters found in the given toml file
165
+
--deny-warnings
166
+
Treat warnings as errors during compilation
166
167
167
-
Usage: cargo-gpu toml [PATH]
168
+
--debug
169
+
Compile shaders in debug mode
168
170
169
-
Arguments:
170
-
[PATH]
171
-
Path to a workspace or package Cargo.toml file.
171
+
--capability <CAPABILITY>
172
+
Enables the provided SPIR-V capabilities. See: `impl core::str::FromStr for spirv_builder::Capability`
172
173
173
-
Must include a [[workspace | package].metadata.rust-gpu.build] section where
174
-
arguments to `cargo gpu build` are listed.
174
+
--extension <EXTENSION>
175
+
Enables the provided SPIR-V extensions. See <https://github.com/KhronosGroup/SPIRV-Registry> for all extensions
175
176
176
-
Path arguments like `output-dir` and `shader-manifest` must be relative to
177
-
the location of the Cargo.toml file.
177
+
--multimodule
178
+
Compile one .spv file per entry point
178
179
179
-
Example:
180
+
--spirv-metadata <SPIRV_METADATA>
181
+
Set the level of metadata included in the SPIR-V binary
180
182
181
-
```toml
182
-
[package.metadata.rust-gpu.build.spirv-builder]
183
-
git = "https://github.com/Rust-GPU/rust-gpu.git"
184
-
rev = "0da80f8"
183
+
[default: none]
185
184
186
-
[package.metadata.rust-gpu.build]
187
-
output-dir = "shaders"
188
-
shader-manifest = "shaders/manifest.json"
189
-
```
185
+
--relax-struct-store
186
+
Allow store from one struct type to a different type with compatible layout and members
190
187
191
-
Calling `cargo gpu toml {path/to/Cargo.toml}` with a Cargo.toml that
192
-
contains the example above would compile the crate and place the compiled
193
-
`.spv` files and manifest in a directory "shaders".
188
+
--relax-logical-pointer
189
+
Allow allocating an object of a pointer type and returning a pointer value from a function in logical addressing mode
194
190
195
-
[default: ./Cargo.toml]
191
+
--relax-block-layout
192
+
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
196
193
197
-
Options:
198
-
-h, --help
199
-
Print help (see a summary with '-h')
194
+
--uniform-buffer-standard-layout
195
+
Enable `VK_KHR_uniform_buffer_standard_layout` when checking standard uniform buffer layouts
200
196
197
+
--scalar-block-layout
198
+
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
201
199
202
-
* Show
203
-
204
-
Show some useful values
200
+
--skip-block-layout
201
+
Skip checking standard uniform / storage buffer layout. Overrides any --relax-block-layout or --scalar-block-layout option
205
202
206
-
Usage: cargo-gpu show <COMMAND>
203
+
--preserve-bindings
204
+
Preserve unused descriptor bindings. Useful for reflection
207
205
208
-
Commands:
209
-
cache-directory Displays the location of the cache directory
210
-
spirv-source The source location of spirv-std
211
-
help Print this message or the help of the given subcommand(s)
206
+
-h, --help
207
+
Print help (see a summary with '-h')
212
208
213
-
Options:
214
-
-h, --help
215
-
Print help
216
209
210
+
* Show
211
+
Show some useful values
217
212
218
-
* Cache-directory
219
-
220
-
Displays the location of the cache directory
213
+
Usage: cargo-gpu show <COMMAND>
221
214
222
-
Usage: cargo-gpu show cache-directory
215
+
Commands:
216
+
cache-directory Displays the location of the cache directory
217
+
spirv-source The source location of spirv-std
218
+
help Print this message or the help of the given subcommand(s)
223
219
224
-
Options:
225
-
-h, --help
226
-
Print help
220
+
Options:
221
+
-h, --help
222
+
Print help
227
223
228
224
229
-
* Spirv-source
225
+
* Cache-directory
226
+
Displays the location of the cache directory
230
227
231
-
The source location of spirv-std
228
+
Usage: cargo-gpu show cache-directory
232
229
233
-
Usage: cargo-gpu show spirv-source [OPTIONS]
230
+
Options:
231
+
-h, --help
232
+
Print help
234
233
235
-
Options:
236
-
--shader-crate <SHADER_CRATE>
237
-
The location of the shader-crate to inspect to determine its spirv-std dependency
238
234
239
-
[default: ./]
235
+
* Spirv-source
236
+
The source location of spirv-std
240
237
241
-
-h, --help
242
-
Print help
238
+
Usage: cargo-gpu show spirv-source [OPTIONS]
243
239
240
+
Options:
241
+
--shader-crate <SHADER_CRATE>
242
+
The location of the shader-crate to inspect to determine its spirv-std dependency
0 commit comments