From 515236ddafa7a1550bc9db57e5baa887ceee7f85 Mon Sep 17 00:00:00 2001 From: charlotte Date: Sun, 29 Jun 2025 13:39:51 -0700 Subject: [PATCH 01/23] wgpu 45d78e2fb4c64d16018eb82c876751d11ad23031. --- crates/bevy_render/src/batching/gpu_preprocessing.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/bevy_render/src/batching/gpu_preprocessing.rs b/crates/bevy_render/src/batching/gpu_preprocessing.rs index ea5970431a5aa..287c22068e50c 100644 --- a/crates/bevy_render/src/batching/gpu_preprocessing.rs +++ b/crates/bevy_render/src/batching/gpu_preprocessing.rs @@ -1120,8 +1120,7 @@ impl FromWorld for GpuPreprocessingSupport { device.limits().max_compute_workgroup_storage_size != 0; let downlevel_support = adapter.get_downlevel_capabilities().flags.contains( - DownlevelFlags::COMPUTE_SHADERS | - DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW + DownlevelFlags::COMPUTE_SHADERS ); let max_supported_mode = if device.limits().max_compute_workgroup_size_x == 0 From 97e1737362062a38bcedb2fd2968af3f7815b502 Mon Sep 17 00:00:00 2001 From: charlotte Date: Sun, 29 Jun 2025 13:59:14 -0700 Subject: [PATCH 02/23] Upgrade to wgpu 26 --- .../src/contrast_adaptive_sharpening/node.rs | 1 + crates/bevy_anti_aliasing/src/fxaa/node.rs | 1 + crates/bevy_anti_aliasing/src/smaa/mod.rs | 3 +++ crates/bevy_anti_aliasing/src/taa/mod.rs | 2 ++ crates/bevy_color/Cargo.toml | 2 +- crates/bevy_core_pipeline/src/bloom/mod.rs | 3 +++ crates/bevy_core_pipeline/src/dof/mod.rs | 2 ++ crates/bevy_core_pipeline/src/motion_blur/node.rs | 1 + crates/bevy_core_pipeline/src/msaa_writeback.rs | 1 + crates/bevy_core_pipeline/src/post_process/mod.rs | 1 + crates/bevy_core_pipeline/src/tonemapping/node.rs | 1 + crates/bevy_image/Cargo.toml | 2 +- crates/bevy_mesh/Cargo.toml | 2 +- crates/bevy_pbr/src/ssr/mod.rs | 1 + crates/bevy_pbr/src/volumetric_fog/render.rs | 1 + crates/bevy_reflect/Cargo.toml | 2 +- crates/bevy_render/Cargo.toml | 8 ++++---- crates/bevy_render/src/camera/camera_driver_node.rs | 1 + crates/bevy_render/src/lib.rs | 1 + crates/bevy_render/src/render_resource/pipeline_cache.rs | 2 +- crates/bevy_render/src/settings.rs | 8 ++++---- crates/bevy_render/src/texture/texture_attachment.rs | 3 +++ crates/bevy_render/src/view/window/screenshot.rs | 1 + crates/bevy_winit/Cargo.toml | 2 +- 24 files changed, 38 insertions(+), 14 deletions(-) diff --git a/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/node.rs b/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/node.rs index 663d481e887bd..070b57099707e 100644 --- a/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/node.rs +++ b/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/node.rs @@ -98,6 +98,7 @@ impl Node for CasNode { label: Some("contrast_adaptive_sharpening"), color_attachments: &[Some(RenderPassColorAttachment { view: destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], diff --git a/crates/bevy_anti_aliasing/src/fxaa/node.rs b/crates/bevy_anti_aliasing/src/fxaa/node.rs index a58f21d9a7746..8881607cba4e4 100644 --- a/crates/bevy_anti_aliasing/src/fxaa/node.rs +++ b/crates/bevy_anti_aliasing/src/fxaa/node.rs @@ -64,6 +64,7 @@ impl ViewNode for FxaaNode { label: Some("fxaa_pass"), color_attachments: &[Some(RenderPassColorAttachment { view: destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], diff --git a/crates/bevy_anti_aliasing/src/smaa/mod.rs b/crates/bevy_anti_aliasing/src/smaa/mod.rs index 3996f389d0742..a724d9922dab8 100644 --- a/crates/bevy_anti_aliasing/src/smaa/mod.rs +++ b/crates/bevy_anti_aliasing/src/smaa/mod.rs @@ -934,6 +934,7 @@ fn perform_edge_detection( label: Some("SMAA edge detection pass"), color_attachments: &[Some(RenderPassColorAttachment { view: &smaa_textures.edge_detection_color_texture.default_view, + depth_slice: None, resolve_target: None, ops: default(), })], @@ -989,6 +990,7 @@ fn perform_blending_weight_calculation( label: Some("SMAA blending weight calculation pass"), color_attachments: &[Some(RenderPassColorAttachment { view: &smaa_textures.blend_texture.default_view, + depth_slice: None, resolve_target: None, ops: default(), })], @@ -1045,6 +1047,7 @@ fn perform_neighborhood_blending( label: Some("SMAA neighborhood blending pass"), color_attachments: &[Some(RenderPassColorAttachment { view: destination, + depth_slice: None, resolve_target: None, ops: default(), })], diff --git a/crates/bevy_anti_aliasing/src/taa/mod.rs b/crates/bevy_anti_aliasing/src/taa/mod.rs index 442a268e2a393..d5f1756a5c1d7 100644 --- a/crates/bevy_anti_aliasing/src/taa/mod.rs +++ b/crates/bevy_anti_aliasing/src/taa/mod.rs @@ -208,11 +208,13 @@ impl ViewNode for TemporalAntiAliasNode { color_attachments: &[ Some(RenderPassColorAttachment { view: view_target.destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), }), Some(RenderPassColorAttachment { view: &taa_history_textures.write.default_view, + depth_slice: None, resolve_target: None, ops: Operations::default(), }), diff --git a/crates/bevy_color/Cargo.toml b/crates/bevy_color/Cargo.toml index 22ade1270900b..45e69f31a5259 100644 --- a/crates/bevy_color/Cargo.toml +++ b/crates/bevy_color/Cargo.toml @@ -20,7 +20,7 @@ serde = { version = "1.0", features = [ ], default-features = false, optional = true } thiserror = { version = "2", default-features = false } derive_more = { version = "2", default-features = false, features = ["from"] } -wgpu-types = { version = "25", default-features = false, optional = true } +wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", default-features = false, optional = true } encase = { version = "0.10", default-features = false, optional = true } [features] diff --git a/crates/bevy_core_pipeline/src/bloom/mod.rs b/crates/bevy_core_pipeline/src/bloom/mod.rs index 901275e01c224..6c65909de3316 100644 --- a/crates/bevy_core_pipeline/src/bloom/mod.rs +++ b/crates/bevy_core_pipeline/src/bloom/mod.rs @@ -184,6 +184,7 @@ impl ViewNode for BloomNode { label: Some("bloom_downsampling_first_pass"), color_attachments: &[Some(RenderPassColorAttachment { view, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], @@ -208,6 +209,7 @@ impl ViewNode for BloomNode { label: Some("bloom_downsampling_pass"), color_attachments: &[Some(RenderPassColorAttachment { view, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], @@ -232,6 +234,7 @@ impl ViewNode for BloomNode { label: Some("bloom_upsampling_pass"), color_attachments: &[Some(RenderPassColorAttachment { view, + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Load, diff --git a/crates/bevy_core_pipeline/src/dof/mod.rs b/crates/bevy_core_pipeline/src/dof/mod.rs index 7e2f52e3fc5e0..8fed4fead82f6 100644 --- a/crates/bevy_core_pipeline/src/dof/mod.rs +++ b/crates/bevy_core_pipeline/src/dof/mod.rs @@ -416,6 +416,7 @@ impl ViewNode for DepthOfFieldNode { let mut color_attachments: SmallVec<[_; 2]> = SmallVec::new(); color_attachments.push(Some(RenderPassColorAttachment { view: postprocess.destination, + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Clear(default()), @@ -436,6 +437,7 @@ impl ViewNode for DepthOfFieldNode { }; color_attachments.push(Some(RenderPassColorAttachment { view: &auxiliary_dof_texture.default_view, + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Clear(default()), diff --git a/crates/bevy_core_pipeline/src/motion_blur/node.rs b/crates/bevy_core_pipeline/src/motion_blur/node.rs index ade5f50d77466..5fb8eeebcdc02 100644 --- a/crates/bevy_core_pipeline/src/motion_blur/node.rs +++ b/crates/bevy_core_pipeline/src/motion_blur/node.rs @@ -84,6 +84,7 @@ impl ViewNode for MotionBlurNode { label: Some("motion_blur_pass"), color_attachments: &[Some(RenderPassColorAttachment { view: post_process.destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], diff --git a/crates/bevy_core_pipeline/src/msaa_writeback.rs b/crates/bevy_core_pipeline/src/msaa_writeback.rs index 5f82e105991d0..f71a9493af8fb 100644 --- a/crates/bevy_core_pipeline/src/msaa_writeback.rs +++ b/crates/bevy_core_pipeline/src/msaa_writeback.rs @@ -87,6 +87,7 @@ impl ViewNode for MsaaWritebackNode { color_attachments: &[Some(RenderPassColorAttachment { // If MSAA is enabled, then the sampled texture will always exist view: target.sampled_main_texture_view().unwrap(), + depth_slice: None, resolve_target: Some(post_process.destination), ops: Operations { load: LoadOp::Clear(LinearRgba::BLACK.into()), diff --git a/crates/bevy_core_pipeline/src/post_process/mod.rs b/crates/bevy_core_pipeline/src/post_process/mod.rs index f7d2501b416ce..6a2b2f138b020 100644 --- a/crates/bevy_core_pipeline/src/post_process/mod.rs +++ b/crates/bevy_core_pipeline/src/post_process/mod.rs @@ -390,6 +390,7 @@ impl ViewNode for PostProcessingNode { label: Some("postprocessing pass"), color_attachments: &[Some(RenderPassColorAttachment { view: post_process.destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], diff --git a/crates/bevy_core_pipeline/src/tonemapping/node.rs b/crates/bevy_core_pipeline/src/tonemapping/node.rs index 0f8f6edc49eb2..58dd673264d18 100644 --- a/crates/bevy_core_pipeline/src/tonemapping/node.rs +++ b/crates/bevy_core_pipeline/src/tonemapping/node.rs @@ -117,6 +117,7 @@ impl ViewNode for TonemappingNode { label: Some("tonemapping_pass"), color_attachments: &[Some(RenderPassColorAttachment { view: destination, + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Clear(Default::default()), // TODO shouldn't need to be cleared diff --git a/crates/bevy_image/Cargo.toml b/crates/bevy_image/Cargo.toml index 7b49b5210a2ae..52da9d1b9d951 100644 --- a/crates/bevy_image/Cargo.toml +++ b/crates/bevy_image/Cargo.toml @@ -70,7 +70,7 @@ image = { version = "0.25.2", default-features = false } # misc bitflags = { version = "2.3", features = ["serde"] } bytemuck = { version = "1.5" } -wgpu-types = { version = "25", default-features = false } +wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", default-features = false } serde = { version = "1", features = ["derive"] } thiserror = { version = "2", default-features = false } futures-lite = "2.0.1" diff --git a/crates/bevy_mesh/Cargo.toml b/crates/bevy_mesh/Cargo.toml index 7807acbb9d074..8f144188d0ce2 100644 --- a/crates/bevy_mesh/Cargo.toml +++ b/crates/bevy_mesh/Cargo.toml @@ -27,7 +27,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-fea # other bitflags = { version = "2.3", features = ["serde"] } bytemuck = { version = "1.5" } -wgpu-types = { version = "25", default-features = false } +wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", default-features = false } serde = { version = "1", default-features = false, features = [ "derive", ], optional = true } diff --git a/crates/bevy_pbr/src/ssr/mod.rs b/crates/bevy_pbr/src/ssr/mod.rs index f3d876ffde978..74a077146867b 100644 --- a/crates/bevy_pbr/src/ssr/mod.rs +++ b/crates/bevy_pbr/src/ssr/mod.rs @@ -311,6 +311,7 @@ impl ViewNode for ScreenSpaceReflectionsNode { label: Some("SSR pass"), color_attachments: &[Some(RenderPassColorAttachment { view: postprocess.destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], diff --git a/crates/bevy_pbr/src/volumetric_fog/render.rs b/crates/bevy_pbr/src/volumetric_fog/render.rs index a5cd8e56f3c1e..d65790eeceb02 100644 --- a/crates/bevy_pbr/src/volumetric_fog/render.rs +++ b/crates/bevy_pbr/src/volumetric_fog/render.rs @@ -442,6 +442,7 @@ impl ViewNode for VolumetricFogNode { label: Some("volumetric lighting pass"), color_attachments: &[Some(RenderPassColorAttachment { view: view_target.main_texture_view(), + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Load, diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml index ae3a3a856e9d9..06e68338284d2 100644 --- a/crates/bevy_reflect/Cargo.toml +++ b/crates/bevy_reflect/Cargo.toml @@ -109,7 +109,7 @@ uuid = { version = "1.13.1", default-features = false, optional = true, features "serde", ] } variadics_please = "1.1" -wgpu-types = { version = "25", features = [ +wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", features = [ "serde", ], optional = true, default-features = false } diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index a657da4f0e641..65bb457b19770 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -90,7 +90,7 @@ codespan-reporting = "0.12.0" # It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm. # When the 'atomics' feature is enabled `fragile-send-sync-non-atomic` does nothing # and Bevy instead wraps `wgpu` types to verify they are not used off their origin thread. -wgpu = { version = "25", default-features = false, features = [ +wgpu = { path = "../../../../gfx-rs/wgpu/wgpu", default-features = false, features = [ "wgsl", "dx12", "metal", @@ -99,7 +99,7 @@ wgpu = { version = "25", default-features = false, features = [ "naga-ir", "fragile-send-sync-non-atomic-wasm", ] } -naga = { version = "25", features = ["wgsl-in"] } +naga = { path = "../../../../gfx-rs/wgpu/naga", features = ["wgsl-in"] } serde = { version = "1", features = ["derive"] } bytemuck = { version = "1.5", features = ["derive", "must_cast"] } downcast-rs = { version = "2", default-features = false, features = ["std"] } @@ -125,7 +125,7 @@ wesl = { version = "0.1.2", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Omit the `glsl` feature in non-WebAssembly by default. -naga_oil = { version = "0.18", default-features = false, features = [ +naga_oil = { path = "../../../naga_oil", default-features = false, features = [ "test_shader", ] } @@ -133,7 +133,7 @@ naga_oil = { version = "0.18", default-features = false, features = [ proptest = "1" [target.'cfg(target_arch = "wasm32")'.dependencies] -naga_oil = { version = "0.18" } +naga_oil = { path = "../../../naga_oil" } js-sys = "0.3" web-sys = { version = "0.3.67", features = [ 'Blob', diff --git a/crates/bevy_render/src/camera/camera_driver_node.rs b/crates/bevy_render/src/camera/camera_driver_node.rs index 8be5a345b4c4a..065cca1a6fdfb 100644 --- a/crates/bevy_render/src/camera/camera_driver_node.rs +++ b/crates/bevy_render/src/camera/camera_driver_node.rs @@ -76,6 +76,7 @@ impl Node for CameraDriverNode { label: Some("no_camera_clear_pass"), color_attachments: &[Some(RenderPassColorAttachment { view: swap_chain_texture, + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Clear(clear_color_global.to_linear().into()), diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 526d75dccdd39..7c5428bc8eedf 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -370,6 +370,7 @@ impl Plugin for RenderPlugin { let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends, flags: settings.instance_flags, + memory_budget_thresholds: settings.instance_memory_budget_thresholds, backend_options: wgpu::BackendOptions { gl: wgpu::GlBackendOptions { gles_minor_version: settings.gles3_minor_version, diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs index ebd3229636ad5..88d334529e68a 100644 --- a/crates/bevy_render/src/render_resource/pipeline_cache.rs +++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs @@ -401,7 +401,7 @@ impl ShaderCache { render_device.create_and_validate_shader_module(module_descriptor) } // SAFETY: we are interfacing with shader code, which may contain undefined behavior, - // such as indexing out of bounds. + // such as indexing out of bounds. // The checks required are prohibitively expensive and a poor default for game engines. ValidateShader::Disabled => unsafe { render_device.create_shader_module(module_descriptor) diff --git a/crates/bevy_render/src/settings.rs b/crates/bevy_render/src/settings.rs index 715bbb35f845b..93d4a4827a370 100644 --- a/crates/bevy_render/src/settings.rs +++ b/crates/bevy_render/src/settings.rs @@ -3,7 +3,7 @@ use crate::renderer::{ }; use alloc::borrow::Cow; -use wgpu::DxcShaderModel; +use wgpu::{DxcShaderModel, MemoryBudgetThresholds}; pub use wgpu::{ Backends, Dx12Compiler, Features as WgpuFeatures, Gles3MinorVersion, InstanceFlags, Limits as WgpuLimits, MemoryHints, PowerPreference, @@ -53,6 +53,8 @@ pub struct WgpuSettings { pub instance_flags: InstanceFlags, /// This hints to the WGPU device about the preferred memory allocation strategy. pub memory_hints: MemoryHints, + /// The thresholds for device memory budget. + pub instance_memory_budget_thresholds: MemoryBudgetThresholds, } impl Default for WgpuSettings { @@ -103,15 +105,12 @@ impl Default for WgpuSettings { Dx12Compiler::StaticDxc } else { let dxc = "dxcompiler.dll"; - let dxil = "dxil.dll"; if cfg!(target_os = "windows") && std::fs::metadata(dxc).is_ok() - && std::fs::metadata(dxil).is_ok() { Dx12Compiler::DynamicDxc { dxc_path: String::from(dxc), - dxil_path: String::from(dxil), max_shader_model: DxcShaderModel::V6_7, } } else { @@ -136,6 +135,7 @@ impl Default for WgpuSettings { gles3_minor_version, instance_flags, memory_hints: MemoryHints::default(), + instance_memory_budget_thresholds:MemoryBudgetThresholds::default(), } } } diff --git a/crates/bevy_render/src/texture/texture_attachment.rs b/crates/bevy_render/src/texture/texture_attachment.rs index ac3854227ff31..17ae6ea6c957f 100644 --- a/crates/bevy_render/src/texture/texture_attachment.rs +++ b/crates/bevy_render/src/texture/texture_attachment.rs @@ -40,6 +40,7 @@ impl ColorAttachment { RenderPassColorAttachment { view: &resolve_target.default_view, + depth_slice: None, resolve_target: Some(&self.texture.default_view), ops: Operations { load: match (self.clear_color, first_call) { @@ -63,6 +64,7 @@ impl ColorAttachment { RenderPassColorAttachment { view: &self.texture.default_view, + depth_slice: None, resolve_target: None, ops: Operations { load: match (self.clear_color, first_call) { @@ -146,6 +148,7 @@ impl OutputColorAttachment { RenderPassColorAttachment { view: &self.view, + depth_slice: None, resolve_target: None, ops: Operations { load: match (clear_color, first_call) { diff --git a/crates/bevy_render/src/view/window/screenshot.rs b/crates/bevy_render/src/view/window/screenshot.rs index 9a64709f4e84c..8c778eb4fb14b 100644 --- a/crates/bevy_render/src/view/window/screenshot.rs +++ b/crates/bevy_render/src/view/window/screenshot.rs @@ -600,6 +600,7 @@ fn render_screenshot( label: Some("screenshot_to_screen_pass"), color_attachments: &[Some(wgpu::RenderPassColorAttachment { view: texture_view, + depth_slice: None, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Load, diff --git a/crates/bevy_winit/Cargo.toml b/crates/bevy_winit/Cargo.toml index 43dcc0506b8aa..8158a21702432 100644 --- a/crates/bevy_winit/Cargo.toml +++ b/crates/bevy_winit/Cargo.toml @@ -59,7 +59,7 @@ cfg-if = "1.0" raw-window-handle = "0.6" serde = { version = "1.0", features = ["derive"], optional = true } bytemuck = { version = "1.5", optional = true } -wgpu-types = { version = "25", optional = true } +wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", optional = true } accesskit = "0.19" tracing = { version = "0.1", default-features = false, features = ["std"] } From 3591ba31133208244ac315c0891d9ad38bc54812 Mon Sep 17 00:00:00 2001 From: charlotte Date: Sun, 29 Jun 2025 14:02:16 -0700 Subject: [PATCH 03/23] Meshlets. --- crates/bevy_pbr/src/meshlet/visibility_buffer_raster_node.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_pbr/src/meshlet/visibility_buffer_raster_node.rs b/crates/bevy_pbr/src/meshlet/visibility_buffer_raster_node.rs index 160097fc50070..10104e10eefd9 100644 --- a/crates/bevy_pbr/src/meshlet/visibility_buffer_raster_node.rs +++ b/crates/bevy_pbr/src/meshlet/visibility_buffer_raster_node.rs @@ -595,6 +595,7 @@ fn raster_pass( }), color_attachments: &[Some(RenderPassColorAttachment { view: dummy_render_target, + depth_slice: None, resolve_target: None, ops: Operations { load: LoadOp::Clear(LinearRgba::BLACK.into()), From cb45943753bc158a9ff9e7319e37d70c94ebaf33 Mon Sep 17 00:00:00 2001 From: charlotte Date: Thu, 10 Jul 2025 13:38:20 -0700 Subject: [PATCH 04/23] Wgpu 26 released. --- crates/bevy_color/Cargo.toml | 2 +- crates/bevy_image/Cargo.toml | 2 +- crates/bevy_mesh/Cargo.toml | 2 +- crates/bevy_reflect/Cargo.toml | 2 +- crates/bevy_render/Cargo.toml | 8 ++++---- crates/bevy_render/src/render_resource/mod.rs | 2 +- crates/bevy_render/src/renderer/mod.rs | 9 +++++++++ crates/bevy_winit/Cargo.toml | 2 +- 8 files changed, 19 insertions(+), 10 deletions(-) diff --git a/crates/bevy_color/Cargo.toml b/crates/bevy_color/Cargo.toml index 45e69f31a5259..071ffcd88b5cd 100644 --- a/crates/bevy_color/Cargo.toml +++ b/crates/bevy_color/Cargo.toml @@ -20,7 +20,7 @@ serde = { version = "1.0", features = [ ], default-features = false, optional = true } thiserror = { version = "2", default-features = false } derive_more = { version = "2", default-features = false, features = ["from"] } -wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", default-features = false, optional = true } +wgpu-types = { version= "26", default-features = false, optional = true } encase = { version = "0.10", default-features = false, optional = true } [features] diff --git a/crates/bevy_image/Cargo.toml b/crates/bevy_image/Cargo.toml index 52da9d1b9d951..43c6db0987682 100644 --- a/crates/bevy_image/Cargo.toml +++ b/crates/bevy_image/Cargo.toml @@ -70,7 +70,7 @@ image = { version = "0.25.2", default-features = false } # misc bitflags = { version = "2.3", features = ["serde"] } bytemuck = { version = "1.5" } -wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", default-features = false } +wgpu-types = { version= "26", default-features = false } serde = { version = "1", features = ["derive"] } thiserror = { version = "2", default-features = false } futures-lite = "2.0.1" diff --git a/crates/bevy_mesh/Cargo.toml b/crates/bevy_mesh/Cargo.toml index 8f144188d0ce2..8ec810a037883 100644 --- a/crates/bevy_mesh/Cargo.toml +++ b/crates/bevy_mesh/Cargo.toml @@ -27,7 +27,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-fea # other bitflags = { version = "2.3", features = ["serde"] } bytemuck = { version = "1.5" } -wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", default-features = false } +wgpu-types = { version= "26", default-features = false } serde = { version = "1", default-features = false, features = [ "derive", ], optional = true } diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml index 06e68338284d2..e00ac01885d36 100644 --- a/crates/bevy_reflect/Cargo.toml +++ b/crates/bevy_reflect/Cargo.toml @@ -109,7 +109,7 @@ uuid = { version = "1.13.1", default-features = false, optional = true, features "serde", ] } variadics_please = "1.1" -wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", features = [ +wgpu-types = { version= "26", features = [ "serde", ], optional = true, default-features = false } diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 65bb457b19770..d35f702eb9607 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -90,7 +90,7 @@ codespan-reporting = "0.12.0" # It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm. # When the 'atomics' feature is enabled `fragile-send-sync-non-atomic` does nothing # and Bevy instead wraps `wgpu` types to verify they are not used off their origin thread. -wgpu = { path = "../../../../gfx-rs/wgpu/wgpu", default-features = false, features = [ +wgpu = { version = "26", default-features = false, features = [ "wgsl", "dx12", "metal", @@ -99,7 +99,7 @@ wgpu = { path = "../../../../gfx-rs/wgpu/wgpu", default-features = false, featur "naga-ir", "fragile-send-sync-non-atomic-wasm", ] } -naga = { path = "../../../../gfx-rs/wgpu/naga", features = ["wgsl-in"] } +naga = { version = "26", features = ["wgsl-in"] } serde = { version = "1", features = ["derive"] } bytemuck = { version = "1.5", features = ["derive", "must_cast"] } downcast-rs = { version = "2", default-features = false, features = ["std"] } @@ -125,7 +125,7 @@ wesl = { version = "0.1.2", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Omit the `glsl` feature in non-WebAssembly by default. -naga_oil = { path = "../../../naga_oil", default-features = false, features = [ +naga_oil = { git = "https://github.com/tychedelia/naga_oil", branch = "wgpu-26", default-features = false, features = [ "test_shader", ] } @@ -133,7 +133,7 @@ naga_oil = { path = "../../../naga_oil", default-features = false, features = [ proptest = "1" [target.'cfg(target_arch = "wasm32")'.dependencies] -naga_oil = { path = "../../../naga_oil" } +naga_oil = { git = "https://github.com/tychedelia/naga_oil", branch = "wgpu-26" } js-sys = "0.3" web-sys = { version = "0.3.67", features = [ 'Blob', diff --git a/crates/bevy_render/src/render_resource/mod.rs b/crates/bevy_render/src/render_resource/mod.rs index 09be66e840b11..8c0f87d716dbd 100644 --- a/crates/bevy_render/src/render_resource/mod.rs +++ b/crates/bevy_render/src/render_resource/mod.rs @@ -60,7 +60,7 @@ pub use wgpu::{ TexelCopyBufferInfo, TexelCopyBufferLayout, TexelCopyTextureInfo, TextureAspect, TextureDescriptor, TextureDimension, TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures, TextureSampleType, TextureUsages, TextureView as WgpuTextureView, - TextureViewDescriptor, TextureViewDimension, Tlas, TlasInstance, TlasPackage, VertexAttribute, + TextureViewDescriptor, TextureViewDimension, Tlas, TlasInstance, VertexAttribute, VertexBufferLayout as RawVertexBufferLayout, VertexFormat, VertexState as RawVertexState, VertexStepMode, COPY_BUFFER_ALIGNMENT, }; diff --git a/crates/bevy_render/src/renderer/mod.rs b/crates/bevy_render/src/renderer/mod.rs index 5df4967757749..9eddba9122776 100644 --- a/crates/bevy_render/src/renderer/mod.rs +++ b/crates/bevy_render/src/renderer/mod.rs @@ -294,6 +294,14 @@ pub async fn initialize_renderer( max_non_sampler_bindings: limits .max_non_sampler_bindings .min(constrained_limits.max_non_sampler_bindings), + max_blas_primitive_count: limits.max_blas_primitive_count + .min(constrained_limits.max_blas_primitive_count), + max_blas_geometry_count: limits + .max_blas_geometry_count + .min(constrained_limits.max_blas_geometry_count), + max_tlas_instance_count: limits + .max_tlas_instance_count + .min(constrained_limits.max_tlas_instance_count), max_color_attachments: limits .max_color_attachments .min(constrained_limits.max_color_attachments), @@ -306,6 +314,7 @@ pub async fn initialize_renderer( max_subgroup_size: limits .max_subgroup_size .min(constrained_limits.max_subgroup_size), + max_acceleration_structures_per_shader_stage: 0, }; } diff --git a/crates/bevy_winit/Cargo.toml b/crates/bevy_winit/Cargo.toml index 8158a21702432..63336913e1920 100644 --- a/crates/bevy_winit/Cargo.toml +++ b/crates/bevy_winit/Cargo.toml @@ -59,7 +59,7 @@ cfg-if = "1.0" raw-window-handle = "0.6" serde = { version = "1.0", features = ["derive"], optional = true } bytemuck = { version = "1.5", optional = true } -wgpu-types = { path = "../../../../gfx-rs/wgpu/wgpu-types", optional = true } +wgpu-types = { version= "26", optional = true } accesskit = "0.19" tracing = { version = "0.1", default-features = false, features = ["std"] } From 9f966186ed7e6d898ebd83d13949b6ce40c16e9a Mon Sep 17 00:00:00 2001 From: charlotte Date: Thu, 10 Jul 2025 13:42:06 -0700 Subject: [PATCH 05/23] Ci. --- crates/bevy_color/Cargo.toml | 2 +- crates/bevy_image/Cargo.toml | 2 +- crates/bevy_mesh/Cargo.toml | 2 +- crates/bevy_reflect/Cargo.toml | 2 +- crates/bevy_winit/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bevy_color/Cargo.toml b/crates/bevy_color/Cargo.toml index 071ffcd88b5cd..81a9795d580e8 100644 --- a/crates/bevy_color/Cargo.toml +++ b/crates/bevy_color/Cargo.toml @@ -20,7 +20,7 @@ serde = { version = "1.0", features = [ ], default-features = false, optional = true } thiserror = { version = "2", default-features = false } derive_more = { version = "2", default-features = false, features = ["from"] } -wgpu-types = { version= "26", default-features = false, optional = true } +wgpu-types = { version = "26", default-features = false, optional = true } encase = { version = "0.10", default-features = false, optional = true } [features] diff --git a/crates/bevy_image/Cargo.toml b/crates/bevy_image/Cargo.toml index 43c6db0987682..10440c5ab0e84 100644 --- a/crates/bevy_image/Cargo.toml +++ b/crates/bevy_image/Cargo.toml @@ -70,7 +70,7 @@ image = { version = "0.25.2", default-features = false } # misc bitflags = { version = "2.3", features = ["serde"] } bytemuck = { version = "1.5" } -wgpu-types = { version= "26", default-features = false } +wgpu-types = { version = "26", default-features = false } serde = { version = "1", features = ["derive"] } thiserror = { version = "2", default-features = false } futures-lite = "2.0.1" diff --git a/crates/bevy_mesh/Cargo.toml b/crates/bevy_mesh/Cargo.toml index c6cc4465adc64..026e96f5cebf6 100644 --- a/crates/bevy_mesh/Cargo.toml +++ b/crates/bevy_mesh/Cargo.toml @@ -26,7 +26,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-fea # other bitflags = { version = "2.3", features = ["serde"] } bytemuck = { version = "1.5" } -wgpu-types = { version= "26", default-features = false } +wgpu-types = { version = "26", default-features = false } serde = { version = "1", default-features = false, features = [ "derive", ], optional = true } diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml index 7de8931b7a24a..e2fa168b0785c 100644 --- a/crates/bevy_reflect/Cargo.toml +++ b/crates/bevy_reflect/Cargo.toml @@ -109,7 +109,7 @@ uuid = { version = "1.13.1", default-features = false, optional = true, features "serde", ] } variadics_please = "1.1" -wgpu-types = { version= "26", features = [ +wgpu-types = { version = "26", features = [ "serde", ], optional = true, default-features = false } diff --git a/crates/bevy_winit/Cargo.toml b/crates/bevy_winit/Cargo.toml index a466de0aef4c4..2b820bf37e7f2 100644 --- a/crates/bevy_winit/Cargo.toml +++ b/crates/bevy_winit/Cargo.toml @@ -56,7 +56,7 @@ approx = { version = "0.5", default-features = false } cfg-if = "1.0" raw-window-handle = "0.6" bytemuck = { version = "1.5", optional = true } -wgpu-types = { version= "26", optional = true } +wgpu-types = { version = "26", optional = true } accesskit = "0.19" tracing = { version = "0.1", default-features = false, features = ["std"] } From 87b00aa74ec28f99ece1b6e29d7438c7ce8ba74f Mon Sep 17 00:00:00 2001 From: charlotte Date: Thu, 10 Jul 2025 13:47:40 -0700 Subject: [PATCH 06/23] Fix bevy_camera. --- crates/bevy_camera/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_camera/Cargo.toml b/crates/bevy_camera/Cargo.toml index 6ed3998a82165..d6cbd46667fef 100644 --- a/crates/bevy_camera/Cargo.toml +++ b/crates/bevy_camera/Cargo.toml @@ -26,7 +26,7 @@ bevy_color = { path = "../bevy_color", version = "0.17.0-dev", features = [ bevy_window = { path = "../bevy_window", version = "0.17.0-dev" } # other -wgpu-types = { version = "25", default-features = false } +wgpu-types = { version = "26", default-features = false } serde = { version = "1", default-features = false, features = ["derive"] } thiserror = { version = "2", default-features = false } downcast-rs = { version = "2", default-features = false, features = ["std"] } From 08ce3a524d161902dd3566ad70fa26ad6644aa44 Mon Sep 17 00:00:00 2001 From: charlotte Date: Thu, 10 Jul 2025 13:52:18 -0700 Subject: [PATCH 07/23] Ci. --- crates/bevy_render/src/settings.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/bevy_render/src/settings.rs b/crates/bevy_render/src/settings.rs index d9415dec4dd56..411a21ceeb0bc 100644 --- a/crates/bevy_render/src/settings.rs +++ b/crates/bevy_render/src/settings.rs @@ -3,11 +3,11 @@ use crate::renderer::{ }; use alloc::borrow::Cow; -use wgpu::{DxcShaderModel, MemoryBudgetThresholds}; pub use wgpu::{ Backends, Dx12Compiler, Features as WgpuFeatures, Gles3MinorVersion, InstanceFlags, Limits as WgpuLimits, MemoryHints, PowerPreference, }; +use wgpu::{DxcShaderModel, MemoryBudgetThresholds}; /// Configures the priority used when automatically configuring the features/limits of `wgpu`. #[derive(Clone)] @@ -110,9 +110,7 @@ impl Default for WgpuSettings { } else { let dxc = "dxcompiler.dll"; - if cfg!(target_os = "windows") - && std::fs::metadata(dxc).is_ok() - { + if cfg!(target_os = "windows") && std::fs::metadata(dxc).is_ok() { Dx12Compiler::DynamicDxc { dxc_path: String::from(dxc), max_shader_model: DxcShaderModel::V6_7, @@ -139,7 +137,7 @@ impl Default for WgpuSettings { gles3_minor_version, instance_flags, memory_hints: MemoryHints::default(), - instance_memory_budget_thresholds:MemoryBudgetThresholds::default(), + instance_memory_budget_thresholds: MemoryBudgetThresholds::default(), force_fallback_adapter: false, adapter_name: None, } From be3010cafea2f7686db9d2ac1bba341fe896b6b7 Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Thu, 10 Jul 2025 13:57:20 -0700 Subject: [PATCH 08/23] Ci. --- crates/bevy_render/src/batching/gpu_preprocessing.rs | 7 ++++--- crates/bevy_render/src/render_resource/pipeline_cache.rs | 2 +- crates/bevy_render/src/renderer/mod.rs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/bevy_render/src/batching/gpu_preprocessing.rs b/crates/bevy_render/src/batching/gpu_preprocessing.rs index cde099702bc6c..c8a0f1817e65c 100644 --- a/crates/bevy_render/src/batching/gpu_preprocessing.rs +++ b/crates/bevy_render/src/batching/gpu_preprocessing.rs @@ -1122,9 +1122,10 @@ impl FromWorld for GpuPreprocessingSupport { // `max_compute_*` limits to zero, so we arbitrarily pick one as a canary. device.limits().max_compute_workgroup_storage_size != 0; - let downlevel_support = adapter.get_downlevel_capabilities().flags.contains( - DownlevelFlags::COMPUTE_SHADERS - ); + let downlevel_support = adapter + .get_downlevel_capabilities() + .flags + .contains(DownlevelFlags::COMPUTE_SHADERS); let max_supported_mode = if device.limits().max_compute_workgroup_size_x == 0 || is_non_supported_android_device(adapter) diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs index a261af29c338a..328c5e5600edb 100644 --- a/crates/bevy_render/src/render_resource/pipeline_cache.rs +++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs @@ -404,7 +404,7 @@ impl ShaderCache { render_device.create_and_validate_shader_module(module_descriptor) } // SAFETY: we are interfacing with shader code, which may contain undefined behavior, - // such as indexing out of bounds. + // such as indexing out of bounds. // The checks required are prohibitively expensive and a poor default for game engines. ValidateShader::Disabled => unsafe { render_device.create_shader_module(module_descriptor) diff --git a/crates/bevy_render/src/renderer/mod.rs b/crates/bevy_render/src/renderer/mod.rs index 0eed8342a7606..fad8030a3bc76 100644 --- a/crates/bevy_render/src/renderer/mod.rs +++ b/crates/bevy_render/src/renderer/mod.rs @@ -322,7 +322,8 @@ pub async fn initialize_renderer( max_non_sampler_bindings: limits .max_non_sampler_bindings .min(constrained_limits.max_non_sampler_bindings), - max_blas_primitive_count: limits.max_blas_primitive_count + max_blas_primitive_count: limits + .max_blas_primitive_count .min(constrained_limits.max_blas_primitive_count), max_blas_geometry_count: limits .max_blas_geometry_count From f1be78ca85c91075f5acbdd146d6360ab68cf37e Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Thu, 10 Jul 2025 14:11:44 -0700 Subject: [PATCH 09/23] Fix solari. --- crates/bevy_solari/src/scene/binder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_solari/src/scene/binder.rs b/crates/bevy_solari/src/scene/binder.rs index f14b5dbe23b6f..ce8e75188c7d1 100644 --- a/crates/bevy_solari/src/scene/binder.rs +++ b/crates/bevy_solari/src/scene/binder.rs @@ -71,14 +71,14 @@ pub fn prepare_raytracing_scene_bindings( let mut textures = CachedBindingArray::new(); let mut samplers = Vec::new(); let mut materials = StorageBufferList::::default(); - let mut tlas = TlasPackage::new(render_device.wgpu_device().create_tlas( - &CreateTlasDescriptor { + let mut tlas = render_device + .wgpu_device() + .create_tlas(&CreateTlasDescriptor { label: Some("tlas"), flags: AccelerationStructureFlags::PREFER_FAST_TRACE, update_mode: AccelerationStructureUpdateMode::Build, max_instances: instances_query.iter().len() as u32, - }, - )); + }); let mut transforms = StorageBufferList::::default(); let mut geometry_ids = StorageBufferList::::default(); let mut material_ids = StorageBufferList::::default(); From 4b0ed4fca92982fbd5aba6f91ba746d20709244d Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Thu, 10 Jul 2025 14:15:48 -0700 Subject: [PATCH 10/23] Fix tracy. --- crates/bevy_render/src/diagnostic/tracy_gpu.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_render/src/diagnostic/tracy_gpu.rs b/crates/bevy_render/src/diagnostic/tracy_gpu.rs index 7a66db4ea6da4..c429c0ee245af 100644 --- a/crates/bevy_render/src/diagnostic/tracy_gpu.rs +++ b/crates/bevy_render/src/diagnostic/tracy_gpu.rs @@ -56,7 +56,7 @@ fn initial_timestamp(device: &RenderDevice, queue: &RenderQueue) -> i64 { // Workaround for https://github.com/gfx-rs/wgpu/issues/6406 // TODO when that bug is fixed, merge these encoders together again let mut copy_encoder = device.create_command_encoder(&CommandEncoderDescriptor::default()); - copy_encoder.copy_buffer_to_buffer(&resolve_buffer, 0, &map_buffer, 0, QUERY_SIZE as _); + copy_encoder.copy_buffer_to_buffer(&resolve_buffer, 0, &map_buffer, 0, Some(QUERY_SIZE as _)); queue.submit([timestamp_encoder.finish(), copy_encoder.finish()]); map_buffer.slice(..).map_async(MapMode::Read, |_| ()); From e8779c2f7ad0b95f9ac859b154b0a1d81f7d2970 Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Thu, 10 Jul 2025 14:31:23 -0700 Subject: [PATCH 11/23] Ci. --- examples/shader/custom_post_processing.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/shader/custom_post_processing.rs b/examples/shader/custom_post_processing.rs index 81e2b7e17b4b0..a5b1687b6ce6b 100644 --- a/examples/shader/custom_post_processing.rs +++ b/examples/shader/custom_post_processing.rs @@ -197,6 +197,7 @@ impl ViewNode for PostProcessNode { // We need to specify the post process destination view here // to make sure we write to the appropriate texture. view: post_process.destination, + depth_slice: None, resolve_target: None, ops: Operations::default(), })], From 2f1353973eec3cb3debf213867bfb69ac9b9e8d5 Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Thu, 10 Jul 2025 14:56:03 -0700 Subject: [PATCH 12/23] Wasm. --- crates/bevy_core_pipeline/src/deferred/node.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_core_pipeline/src/deferred/node.rs b/crates/bevy_core_pipeline/src/deferred/node.rs index ab87fccee6e89..a8e1b7ab8ed2a 100644 --- a/crates/bevy_core_pipeline/src/deferred/node.rs +++ b/crates/bevy_core_pipeline/src/deferred/node.rs @@ -176,6 +176,7 @@ fn run_deferred_prepass<'w>( load: bevy_render::render_resource::LoadOp::Load, store: StoreOp::Store, }, + depth_slice: None, } } #[cfg(any( From 02fd3b34ef15ecd8259f0c495c9e5e60c73d3267 Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Wed, 16 Jul 2025 12:36:04 -0700 Subject: [PATCH 13/23] Switch to upstream naga-oil. --- crates/bevy_render/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 2df66e2294d59..cc4ca4d758e51 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -127,7 +127,7 @@ wesl = { version = "0.1.2", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Omit the `glsl` feature in non-WebAssembly by default. -naga_oil = { git = "https://github.com/tychedelia/naga_oil", branch = "wgpu-26", default-features = false, features = [ +naga_oil = { git = "https://github.com/bevyengine/naga_oil", default-features = false, features = [ "test_shader", ] } @@ -135,7 +135,7 @@ naga_oil = { git = "https://github.com/tychedelia/naga_oil", branch = "wgpu-26", proptest = "1" [target.'cfg(target_arch = "wasm32")'.dependencies] -naga_oil = { git = "https://github.com/tychedelia/naga_oil", branch = "wgpu-26" } +naga_oil = { git = "https://github.com/bevyengine/naga_oil" } js-sys = "0.3" web-sys = { version = "0.3.67", features = [ 'Blob', From bc1371c9d00c938b2088bba4b21560a14fbb1fea Mon Sep 17 00:00:00 2001 From: charlotte Date: Sun, 20 Jul 2025 13:26:59 -0700 Subject: [PATCH 14/23] Remove force serial command encoding hack. --- .../bevy_render/src/renderer/graph_runner.rs | 4 --- crates/bevy_render/src/renderer/mod.rs | 35 ++----------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/crates/bevy_render/src/renderer/graph_runner.rs b/crates/bevy_render/src/renderer/graph_runner.rs index 39f05ca6a85c6..404c7ab583632 100644 --- a/crates/bevy_render/src/renderer/graph_runner.rs +++ b/crates/bevy_render/src/renderer/graph_runner.rs @@ -68,8 +68,6 @@ impl RenderGraphRunner { render_device: RenderDevice, mut diagnostics_recorder: Option, queue: &wgpu::Queue, - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - adapter: &wgpu::Adapter, world: &World, finalizer: impl FnOnce(&mut wgpu::CommandEncoder), ) -> Result, RenderGraphRunnerError> { @@ -79,8 +77,6 @@ impl RenderGraphRunner { let mut render_context = RenderContext::new( render_device, - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - adapter.get_info(), diagnostics_recorder, ); Self::run_graph(graph, None, &mut render_context, world, &[], None)?; diff --git a/crates/bevy_render/src/renderer/mod.rs b/crates/bevy_render/src/renderer/mod.rs index fad8030a3bc76..22dece67c5616 100644 --- a/crates/bevy_render/src/renderer/mod.rs +++ b/crates/bevy_render/src/renderer/mod.rs @@ -37,16 +37,12 @@ pub fn render_system(world: &mut World, state: &mut SystemState(); let render_device = world.resource::(); let render_queue = world.resource::(); - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - let render_adapter = world.resource::(); let res = RenderGraphRunner::run( graph, render_device.clone(), // TODO: is this clone really necessary? diagnostics_recorder, &render_queue.0, - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - &render_adapter.0, world, |encoder| { crate::view::screenshot::submit_screenshot_commands(world, encoder); @@ -376,8 +372,6 @@ pub struct RenderContext<'w> { render_device: RenderDevice, command_encoder: Option, command_buffer_queue: Vec>, - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - force_serial: bool, diagnostics_recorder: Option>, } @@ -385,30 +379,12 @@ impl<'w> RenderContext<'w> { /// Creates a new [`RenderContext`] from a [`RenderDevice`]. pub fn new( render_device: RenderDevice, - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - adapter_info: AdapterInfo, diagnostics_recorder: Option, ) -> Self { - // HACK: Parallel command encoding is currently bugged on AMD + Windows/Linux + Vulkan - #[cfg(any(target_os = "windows", target_os = "linux"))] - let force_serial = - adapter_info.driver.contains("AMD") && adapter_info.backend == wgpu::Backend::Vulkan; - #[cfg(not(any( - target_os = "windows", - target_os = "linux", - all(target_arch = "wasm32", target_feature = "atomics") - )))] - let force_serial = { - drop(adapter_info); - false - }; - Self { render_device, command_encoder: None, command_buffer_queue: Vec::new(), - #[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))] - force_serial, diagnostics_recorder: diagnostics_recorder.map(Arc::new), } } @@ -511,14 +487,9 @@ impl<'w> RenderContext<'w> { } QueuedCommandBuffer::Task(command_buffer_generation_task) => { let render_device = self.render_device.clone(); - if self.force_serial { - command_buffers - .push((i, command_buffer_generation_task(render_device))); - } else { - task_pool.spawn(async move { - (i, command_buffer_generation_task(render_device)) - }); - } + task_pool.spawn(async move { + (i, command_buffer_generation_task(render_device)) + }); } } } From c76fe2b88bc37f79f5761e70307e11b3daa6a33c Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 23 Jul 2025 16:57:38 -0700 Subject: [PATCH 15/23] Disable mdic on dx12. --- crates/bevy_render/src/render_phase/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/bevy_render/src/render_phase/mod.rs b/crates/bevy_render/src/render_phase/mod.rs index c58318f654578..fb9433d804e2b 100644 --- a/crates/bevy_render/src/render_phase/mod.rs +++ b/crates/bevy_render/src/render_phase/mod.rs @@ -67,12 +67,12 @@ use bevy_ecs::{ prelude::*, system::{lifetimeless::SRes, SystemParamItem}, }; +use bevy_render::renderer::RenderAdapterInfo; +pub use bevy_render_macros::ShaderLabel; use core::{fmt::Debug, hash::Hash, iter, marker::PhantomData, ops::Range, slice::SliceIndex}; use smallvec::SmallVec; use tracing::warn; -pub use bevy_render_macros::ShaderLabel; - define_label!( #[diagnostic::on_unimplemented( note = "consider annotating `{Self}` with `#[derive(ShaderLabel)]`" @@ -658,9 +658,12 @@ where let mut draw_functions = draw_functions.write(); let render_device = world.resource::(); + let render_adapter_info = world.resource::(); let multi_draw_indirect_count_supported = render_device .features() - .contains(Features::MULTI_DRAW_INDIRECT_COUNT); + .contains(Features::MULTI_DRAW_INDIRECT_COUNT) + // TODO: https://github.com/gfx-rs/wgpu/issues/7974 + && !matches!(render_adapter_info.backend, wgpu::Backend::Dx12); match self.batch_sets { BinnedRenderPhaseBatchSets::DynamicUniforms(ref batch_sets) => { From f740a124ec9b971ebe6a27d5f9ebab6934874d17 Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 23 Jul 2025 16:59:25 -0700 Subject: [PATCH 16/23] Ci. --- crates/bevy_render/src/renderer/graph_runner.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/bevy_render/src/renderer/graph_runner.rs b/crates/bevy_render/src/renderer/graph_runner.rs index 404c7ab583632..ff2e421982dc7 100644 --- a/crates/bevy_render/src/renderer/graph_runner.rs +++ b/crates/bevy_render/src/renderer/graph_runner.rs @@ -75,10 +75,7 @@ impl RenderGraphRunner { recorder.begin_frame(); } - let mut render_context = RenderContext::new( - render_device, - diagnostics_recorder, - ); + let mut render_context = RenderContext::new(render_device, diagnostics_recorder); Self::run_graph(graph, None, &mut render_context, world, &[], None)?; finalizer(render_context.command_encoder()); From 917a76184174c3c4a84097ff2c93d680bf4a84f5 Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 30 Jul 2025 20:50:06 -0700 Subject: [PATCH 17/23] Use subgroup quad ops. --- .../bevy_pbr/src/light_probe/downsample.wgsl | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/crates/bevy_pbr/src/light_probe/downsample.wgsl b/crates/bevy_pbr/src/light_probe/downsample.wgsl index 57a0615c87c1d..352d9793c798d 100644 --- a/crates/bevy_pbr/src/light_probe/downsample.wgsl +++ b/crates/bevy_pbr/src/light_probe/downsample.wgsl @@ -117,10 +117,10 @@ fn spd_downsample_mips_0_1(x: u32, y: u32, workgroup_id: vec2u, local_invocation if mips <= 1u { return; } #ifdef SUBGROUP_SUPPORT - v[0] = spd_reduce_quad(v[0], subgroup_invocation_id); - v[1] = spd_reduce_quad(v[1], subgroup_invocation_id); - v[2] = spd_reduce_quad(v[2], subgroup_invocation_id); - v[3] = spd_reduce_quad(v[3], subgroup_invocation_id); + v[0] = spd_reduce_quad(v[0]); + v[1] = spd_reduce_quad(v[1]); + v[2] = spd_reduce_quad(v[2]); + v[3] = spd_reduce_quad(v[3]); if local_invocation_index % 4u == 0u { spd_store((workgroup_id * 16u) + vec2(x / 2u, y / 2u), v[0], 1u, slice); @@ -181,7 +181,7 @@ fn spd_downsample_next_four(x: u32, y: u32, workgroup_id: vec2u, local_invocatio fn spd_downsample_mip_2(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32, subgroup_invocation_id: u32) { #ifdef SUBGROUP_SUPPORT var v = spd_load_intermediate(x, y); - v = spd_reduce_quad(v, subgroup_invocation_id); + v = spd_reduce_quad(v); if local_invocation_index % 4u == 0u { spd_store((workgroup_id * 8u) + vec2(x / 2u, y / 2u), v, base_mip, slice); spd_store_intermediate(x + (y / 2u) % 2u, y, v); @@ -204,7 +204,7 @@ fn spd_downsample_mip_3(x: u32, y: u32, workgroup_id: vec2u, local_invocation_in #ifdef SUBGROUP_SUPPORT if local_invocation_index < 64u { var v = spd_load_intermediate(x * 2u + y % 2u, y * 2u); - v = spd_reduce_quad(v, subgroup_invocation_id); + v = spd_reduce_quad(v); if local_invocation_index % 4u == 0u { spd_store((workgroup_id * 4u) + vec2(x / 2u, y / 2u), v, base_mip, slice); spd_store_intermediate(x * 2u + y / 2u, y * 2u, v); @@ -228,7 +228,7 @@ fn spd_downsample_mip_4(x: u32, y: u32, workgroup_id: vec2u, local_invocation_in #ifdef SUBGROUP_SUPPORT if local_invocation_index < 16u { var v = spd_load_intermediate(x * 4u + y, y * 4u); - v = spd_reduce_quad(v, subgroup_invocation_id); + v = spd_reduce_quad(v); if local_invocation_index % 4u == 0u { spd_store((workgroup_id * 2u) + vec2(x / 2u, y / 2u), v, base_mip, slice); spd_store_intermediate(x / 2u + y, 0u, v); @@ -252,7 +252,7 @@ fn spd_downsample_mip_5(x: u32, y: u32, workgroup_id: vec2u, local_invocation_in #ifdef SUBGROUP_SUPPORT if local_invocation_index < 4u { var v = spd_load_intermediate(local_invocation_index, 0u); - v = spd_reduce_quad(v, subgroup_invocation_id); + v = spd_reduce_quad(v); if local_invocation_index % 4u == 0u { spd_store(workgroup_id, v, base_mip, slice); } @@ -436,20 +436,12 @@ fn spd_reduce_4(v0: vec4f, v1: vec4f, v2: vec4f, v3: vec4f) -> vec4f { } #ifdef SUBGROUP_SUPPORT -fn spd_reduce_quad(v: vec4f, subgroup_invocation_id: u32) -> vec4f { - let quad = subgroup_invocation_id & (~0x3u); +fn spd_reduce_quad(v: vec4f) -> vec4f { let v0 = v; - let v1 = subgroupBroadcast(v, quad | 1u); - let v2 = subgroupBroadcast(v, quad | 2u); - let v3 = subgroupBroadcast(v, quad | 3u); + let v1 = quadSwapX(v); + let v2 = quadSwapY(v); + let v3 = quadSwapDiagonal(v); return spd_reduce_4(v0, v1, v2, v3); - - // TODO: Use subgroup quad operations once wgpu supports them - // let v0 = v; - // let v1 = quadSwapX(v); - // let v2 = quadSwapY(v); - // let v3 = quadSwapDiagonal(v); - // return spd_reduce_4(v0, v1, v2, v3); } #endif From 18ff09a2fce456175b42447ff4c7cbbfadb778f2 Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 30 Jul 2025 20:54:51 -0700 Subject: [PATCH 18/23] Upgrade bevy shader. --- crates/bevy_shader/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_shader/Cargo.toml b/crates/bevy_shader/Cargo.toml index d89bc0ec77734..09a73d4789a60 100644 --- a/crates/bevy_shader/Cargo.toml +++ b/crates/bevy_shader/Cargo.toml @@ -16,8 +16,8 @@ bevy_reflect = { path = "../bevy_reflect", version = "0.17.0-dev" } bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev" } # other -wgpu-types = { version = "25", default-features = false } -naga = { version = "25", features = ["wgsl-in"] } +wgpu-types = { version = "26", default-features = false } +naga = { version = "26", features = ["wgsl-in"] } serde = { version = "1", features = ["derive"] } thiserror = { version = "2", default-features = false } wesl = { version = "0.1.2", optional = true } From 6e00992e3eef1aefacc49f60557bdc923d12b7f5 Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 30 Jul 2025 20:58:00 -0700 Subject: [PATCH 19/23] naga_oil --- crates/bevy_shader/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_shader/Cargo.toml b/crates/bevy_shader/Cargo.toml index 09a73d4789a60..bf987668456d7 100644 --- a/crates/bevy_shader/Cargo.toml +++ b/crates/bevy_shader/Cargo.toml @@ -26,12 +26,12 @@ tracing = { version = "0.1", default-features = false, features = ["std"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Omit the `glsl` feature in non-WebAssembly by default. -naga_oil = { version = "0.18", default-features = false, features = [ +naga_oil = { git = "https://github.com/bevyengine/bevy", default-features = false, features = [ "test_shader", ] } [target.'cfg(target_arch = "wasm32")'.dependencies] -naga_oil = { version = "0.18" } +naga_oil = { git = "https://github.com/bevyengine/bevy" } [features] shader_format_glsl = ["naga/glsl-in", "naga/wgsl-out", "naga_oil/glsl"] From 227365e224215a908e7e79a83a2385107a53690e Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 30 Jul 2025 21:01:46 -0700 Subject: [PATCH 20/23] naga_oil (for real) --- crates/bevy_shader/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_shader/Cargo.toml b/crates/bevy_shader/Cargo.toml index bf987668456d7..53f040c02c3e1 100644 --- a/crates/bevy_shader/Cargo.toml +++ b/crates/bevy_shader/Cargo.toml @@ -26,12 +26,12 @@ tracing = { version = "0.1", default-features = false, features = ["std"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Omit the `glsl` feature in non-WebAssembly by default. -naga_oil = { git = "https://github.com/bevyengine/bevy", default-features = false, features = [ +naga_oil = { git = "https://github.com/bevyengine/naga_oil", default-features = false, features = [ "test_shader", ] } [target.'cfg(target_arch = "wasm32")'.dependencies] -naga_oil = { git = "https://github.com/bevyengine/bevy" } +naga_oil = { git = "https://github.com/bevyengine/naga_oil" } [features] shader_format_glsl = ["naga/glsl-in", "naga/wgsl-out", "naga_oil/glsl"] From 2487e949fb839b30073f6dd7e0c12ff2839f783a Mon Sep 17 00:00:00 2001 From: charlotte Date: Thu, 31 Jul 2025 08:54:21 -0700 Subject: [PATCH 21/23] Further cleanup downsample. --- .../bevy_pbr/src/light_probe/downsample.wgsl | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/crates/bevy_pbr/src/light_probe/downsample.wgsl b/crates/bevy_pbr/src/light_probe/downsample.wgsl index 352d9793c798d..e28c9b2f1ab72 100644 --- a/crates/bevy_pbr/src/light_probe/downsample.wgsl +++ b/crates/bevy_pbr/src/light_probe/downsample.wgsl @@ -50,22 +50,16 @@ var spd_intermediate_a: array, 16>; @workgroup_size(256, 1, 1) fn downsample_first( @builtin(workgroup_id) workgroup_id: vec3u, - @builtin(local_invocation_index) local_invocation_index: u32, -#ifdef SUBGROUP_SUPPORT - @builtin(subgroup_invocation_id) subgroup_invocation_id: u32, -#endif + @builtin(local_invocation_index) local_invocation_index: u32 ) { -#ifndef SUBGROUP_SUPPORT - let subgroup_invocation_id = 0u; -#endif let sub_xy = remap_for_wave_reduction(local_invocation_index % 64u); let x = sub_xy.x + 8u * ((local_invocation_index >> 6u) % 2u); let y = sub_xy.y + 8u * (local_invocation_index >> 7u); - spd_downsample_mips_0_1(x, y, workgroup_id.xy, local_invocation_index, constants.mips, workgroup_id.z, subgroup_invocation_id); + spd_downsample_mips_0_1(x, y, workgroup_id.xy, local_invocation_index, constants.mips, workgroup_id.z); - spd_downsample_next_four(x, y, workgroup_id.xy, local_invocation_index, 2u, constants.mips, workgroup_id.z, subgroup_invocation_id); + spd_downsample_next_four(x, y, workgroup_id.xy, local_invocation_index, 2u, constants.mips, workgroup_id.z); } // TODO: Once wgpu supports globallycoherent buffers, make it actually a single pass @@ -74,24 +68,17 @@ fn downsample_first( fn downsample_second( @builtin(workgroup_id) workgroup_id: vec3u, @builtin(local_invocation_index) local_invocation_index: u32, -#ifdef SUBGROUP_SUPPORT - @builtin(subgroup_invocation_id) subgroup_invocation_id: u32, -#endif ) { -#ifndef SUBGROUP_SUPPORT - let subgroup_invocation_id = 0u; -#endif - let sub_xy = remap_for_wave_reduction(local_invocation_index % 64u); let x = sub_xy.x + 8u * ((local_invocation_index >> 6u) % 2u); let y = sub_xy.y + 8u * (local_invocation_index >> 7u); spd_downsample_mips_6_7(x, y, constants.mips, workgroup_id.z); - spd_downsample_next_four(x, y, vec2(0u), local_invocation_index, 8u, constants.mips, workgroup_id.z, subgroup_invocation_id); + spd_downsample_next_four(x, y, vec2(0u), local_invocation_index, 8u, constants.mips, workgroup_id.z); } -fn spd_downsample_mips_0_1(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, mips: u32, slice: u32, subgroup_invocation_id: u32) { +fn spd_downsample_mips_0_1(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, mips: u32, slice: u32) { var v: array; var tex = (workgroup_id * 64u) + vec2(x * 2u, y * 2u); @@ -160,25 +147,25 @@ fn spd_downsample_mips_0_1(x: u32, y: u32, workgroup_id: vec2u, local_invocation #endif } -fn spd_downsample_next_four(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, mips: u32, slice: u32, subgroup_invocation_id: u32) { +fn spd_downsample_next_four(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, mips: u32, slice: u32) { if mips <= base_mip { return; } workgroupBarrier(); - spd_downsample_mip_2(x, y, workgroup_id, local_invocation_index, base_mip, slice, subgroup_invocation_id); + spd_downsample_mip_2(x, y, workgroup_id, local_invocation_index, base_mip, slice); if mips <= base_mip + 1u { return; } workgroupBarrier(); - spd_downsample_mip_3(x, y, workgroup_id, local_invocation_index, base_mip + 1u, slice, subgroup_invocation_id); + spd_downsample_mip_3(x, y, workgroup_id, local_invocation_index, base_mip + 1u, slice); if mips <= base_mip + 2u { return; } workgroupBarrier(); - spd_downsample_mip_4(x, y, workgroup_id, local_invocation_index, base_mip + 2u, slice, subgroup_invocation_id); + spd_downsample_mip_4(x, y, workgroup_id, local_invocation_index, base_mip + 2u, slice); if mips <= base_mip + 3u { return; } workgroupBarrier(); - spd_downsample_mip_5(x, y, workgroup_id, local_invocation_index, base_mip + 3u, slice, subgroup_invocation_id); + spd_downsample_mip_5(x, y, workgroup_id, local_invocation_index, base_mip + 3u, slice); } -fn spd_downsample_mip_2(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32, subgroup_invocation_id: u32) { +fn spd_downsample_mip_2(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32) { #ifdef SUBGROUP_SUPPORT var v = spd_load_intermediate(x, y); v = spd_reduce_quad(v); @@ -200,7 +187,7 @@ fn spd_downsample_mip_2(x: u32, y: u32, workgroup_id: vec2u, local_invocation_in #endif } -fn spd_downsample_mip_3(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32, subgroup_invocation_id: u32) { +fn spd_downsample_mip_3(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32) { #ifdef SUBGROUP_SUPPORT if local_invocation_index < 64u { var v = spd_load_intermediate(x * 2u + y % 2u, y * 2u); @@ -224,7 +211,7 @@ fn spd_downsample_mip_3(x: u32, y: u32, workgroup_id: vec2u, local_invocation_in #endif } -fn spd_downsample_mip_4(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32, subgroup_invocation_id: u32) { +fn spd_downsample_mip_4(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32) { #ifdef SUBGROUP_SUPPORT if local_invocation_index < 16u { var v = spd_load_intermediate(x * 4u + y, y * 4u); @@ -248,7 +235,7 @@ fn spd_downsample_mip_4(x: u32, y: u32, workgroup_id: vec2u, local_invocation_in #endif } -fn spd_downsample_mip_5(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32, subgroup_invocation_id: u32) { +fn spd_downsample_mip_5(x: u32, y: u32, workgroup_id: vec2u, local_invocation_index: u32, base_mip: u32, slice: u32) { #ifdef SUBGROUP_SUPPORT if local_invocation_index < 4u { var v = spd_load_intermediate(local_invocation_index, 0u); From 4b7e32caa348d2bb7f308aba8b666fa0c5bd72a1 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Thu, 31 Jul 2025 15:43:40 -0400 Subject: [PATCH 22/23] update get_capabilities --- crates/bevy_shader/src/shader_cache.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_shader/src/shader_cache.rs b/crates/bevy_shader/src/shader_cache.rs index 89926c856ce0b..5974209cb522e 100644 --- a/crates/bevy_shader/src/shader_cache.rs +++ b/crates/bevy_shader/src/shader_cache.rs @@ -506,6 +506,10 @@ fn get_capabilities(features: Features, downlevel: DownlevelFlags) -> Capabiliti Capabilities::DUAL_SOURCE_BLENDING, features.contains(Features::DUAL_SOURCE_BLENDING), ); + capabilities.set( + Capabilities::CLIP_DISTANCE, + features.contains(Features::CLIP_DISTANCES), + ); capabilities.set( Capabilities::CUBE_ARRAY_TEXTURES, downlevel.contains(DownlevelFlags::CUBE_ARRAY_TEXTURES), From eb1d47388a472a23f62a50a6f77c66f643309836 Mon Sep 17 00:00:00 2001 From: charlotte Date: Sat, 2 Aug 2025 09:38:18 -0700 Subject: [PATCH 23/23] Release naga_oil. --- crates/bevy_shader/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_shader/Cargo.toml b/crates/bevy_shader/Cargo.toml index 53f040c02c3e1..f5df411739f35 100644 --- a/crates/bevy_shader/Cargo.toml +++ b/crates/bevy_shader/Cargo.toml @@ -26,12 +26,12 @@ tracing = { version = "0.1", default-features = false, features = ["std"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Omit the `glsl` feature in non-WebAssembly by default. -naga_oil = { git = "https://github.com/bevyengine/naga_oil", default-features = false, features = [ +naga_oil = { version = "0.19", default-features = false, features = [ "test_shader", ] } [target.'cfg(target_arch = "wasm32")'.dependencies] -naga_oil = { git = "https://github.com/bevyengine/naga_oil" } +naga_oil = { version = "0.19" } [features] shader_format_glsl = ["naga/glsl-in", "naga/wgsl-out", "naga_oil/glsl"]