File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -33,3 +33,32 @@ raw-window-handle = "0.6.2"
3333winit = "0.30.0"
3434cfg-if = "1.0.0"
3535anyhow = "1.0.98"
36+
37+ {% if integration_type == "spirv-builder" -%}
38+ # Optimize build scripts, copied from rust-gpu's repo
39+ # Enable incremental by default in release mode.
40+ [profile.release]
41+ incremental = true
42+ # HACK(eddyb) this is the default but without explicitly specifying it, Cargo
43+ # will treat the identical settings in `[profile.release.build-override]` below
44+ # as different sets of `rustc` flags and will not reuse artifacts between them.
45+ codegen-units = 256
46+
47+ # Compile build-dependencies in release mode with the same settings
48+ # as regular dependencies (including the incremental enabled above).
49+ [profile.release.build-override]
50+ opt-level = 3
51+ incremental = true
52+ codegen-units = 256
53+
54+ # HACK(eddyb) reduce the number of linker exports and/or imports, by avoiding
55+ # inter-CGU linkage, to stay under the 64Ki MSVC limit for `rustc_codegen_spirv`
56+ # when building it in "debug mode" (only relevant to CI for now, realistically),
57+ # i.e. working around this issue: https://github.com/rust-lang/rust/issues/53014.
58+ [profile.dev]
59+ # HACK(eddyb) fewer inter-crate exports/imports (not just inter-CGU), but sadly
60+ # not configurable w/o breaking `Cargo.toml` parsing from non-nightly Cargo.
61+ #
62+ # rustflags = ["-Zshare-generics=off"]
63+ codegen-units = 1
64+ {% endif -%}
You can’t perform that action at this time.
0 commit comments