From 756535bacc9ec43f2f468ea3e966470117ee5970 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Fri, 16 Feb 2024 19:22:49 -0700 Subject: [PATCH] Remove `naga_oil` dependency from `bevy_pbr` (#11914) # 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`. --- crates/bevy_internal/Cargo.toml | 5 +---- crates/bevy_pbr/Cargo.toml | 10 ---------- crates/bevy_render/Cargo.toml | 11 ++++++++--- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index a92f3f6ba0..f87418bca8 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -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 = [ diff --git a/crates/bevy_pbr/Cargo.toml b/crates/bevy_pbr/Cargo.toml index 3c5584ecbe..f09de42ce0 100644 --- a/crates/bevy_pbr/Cargo.toml +++ b/crates/bevy_pbr/Cargo.toml @@ -11,7 +11,6 @@ keywords = ["bevy"] [features] webgl = [] webgpu = [] -shader_format_glsl = ["naga_oil/glsl"] pbr_transmission_textures = [] [dependencies] @@ -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 diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 3274a8aeed..fefb1979b2 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -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"] } @@ -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!