Skip to content

Commit

Permalink
Remove naga_oil dependency from bevy_pbr (#11914)
Browse files Browse the repository at this point in the history
# Objective

Fixes #11908

## Solution

- Remove the `naga_oil` dependency from `bevy_pbr`.
- We were doing a little dance to disable `glsl` support on not-wasm, so
incorporate that dance into `bevy_render`'s `Cargo.toml`.
  • Loading branch information
rparrett authored Feb 17, 2024
1 parent 3058c17 commit 756535b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
5 changes: 1 addition & 4 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ symphonia-vorbis = ["bevy_audio/symphonia-vorbis"]
symphonia-wav = ["bevy_audio/symphonia-wav"]

# Shader formats
shader_format_glsl = [
"bevy_render/shader_format_glsl",
"bevy_pbr?/shader_format_glsl",
]
shader_format_glsl = ["bevy_render/shader_format_glsl"]
shader_format_spirv = ["bevy_render/shader_format_spirv"]

serialize = [
Expand Down
10 changes: 0 additions & 10 deletions crates/bevy_pbr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ keywords = ["bevy"]
[features]
webgl = []
webgpu = []
shader_format_glsl = ["naga_oil/glsl"]
pbr_transmission_textures = []

[dependencies]
Expand Down Expand Up @@ -39,14 +38,5 @@ radsort = "0.1"
smallvec = "1.6"
thread_local = "1.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
naga_oil = "0.13"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Omit the `glsl` feature in non-WebAssembly by default.
naga_oil = { version = "0.13", default-features = false, features = [
"test_shader",
] }

[lints]
workspace = true
11 changes: 8 additions & 3 deletions crates/bevy_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ wgpu = { version = "0.19.1", default-features = false, features = [
"fragile-send-sync-non-atomic-wasm",
] }
naga = { version = "0.19", features = ["wgsl-in"] }
naga_oil = { version = "0.13", default-features = false, features = [
"test_shader",
] }
serde = { version = "1", features = ["derive"] }
bitflags = "2.3"
bytemuck = { version = "1.5", features = ["derive"] }
Expand All @@ -98,7 +95,15 @@ profiling = { version = "1", features = [
], optional = true }
async-channel = "2.1.0"


[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Omit the `glsl` feature in non-WebAssembly by default.
naga_oil = { version = "0.13", default-features = false, features = [
"test_shader",
] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
naga_oil = "0.13"
js-sys = "0.3"
# web-sys doesn't follow semver for the WebGPU APIs as they are unstable
# Make sure that WebGPU builds work when changing this!
Expand Down

0 comments on commit 756535b

Please sign in to comment.