Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4614,3 +4614,11 @@ description = "Gallery of Feathers Widgets"
category = "UI (User Interface)"
wasm = true
hidden = true

[patch.crates-io]
wgpu = { git = "https://github.com/MarijnS95/wgpu", branch = "instance-for-raw-display-handle" }
wgpu-types = { git = "https://github.com/MarijnS95/wgpu", branch = "instance-for-raw-display-handle" }
wgpu-hal = { git = "https://github.com/MarijnS95/wgpu", branch = "instance-for-raw-display-handle" }
wgpu-core = { git = "https://github.com/MarijnS95/wgpu", branch = "instance-for-raw-display-handle" }
wgpu-info = { git = "https://github.com/MarijnS95/wgpu", branch = "instance-for-raw-display-handle" }
wgpu-macros = { git = "https://github.com/MarijnS95/wgpu", branch = "instance-for-raw-display-handle" }
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})],
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_anti_aliasing/src/fxaa/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})],
Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_anti_aliasing/src/smaa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,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(),
})],
Expand Down Expand Up @@ -951,6 +952,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(),
})],
Expand Down Expand Up @@ -1007,6 +1009,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(),
})],
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_anti_aliasing/src/taa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,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(),
}),
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_camera/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_color/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { version = "26", default-features = false, optional = true }
encase = { version = "0.10", default-features = false, optional = true }

[features]
Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_core_pipeline/src/bloom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,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(),
})],
Expand All @@ -210,6 +211,7 @@ impl ViewNode for BloomNode {
label: Some("bloom_downsampling_pass"),
color_attachments: &[Some(RenderPassColorAttachment {
view,
depth_slice: None,
resolve_target: None,
ops: Operations::default(),
})],
Expand All @@ -234,6 +236,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,
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/src/deferred/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ fn run_deferred_prepass<'w>(
load: bevy_render::render_resource::LoadOp::Load,
store: StoreOp::Store,
},
depth_slice: None,
}
}
#[cfg(any(
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_core_pipeline/src/dof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,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()),
Expand All @@ -429,6 +430,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()),
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/src/motion_blur/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})],
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/src/msaa_writeback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/src/post_process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,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(),
})],
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/src/tonemapping/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_image/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { version = "26", default-features = false }
serde = { version = "1", features = ["derive"] }
thiserror = { version = "2", default-features = false }
futures-lite = "2.0.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_mesh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "25", default-features = false }
wgpu-types = { version = "26", default-features = false }
serde = { version = "1", default-features = false, features = [
"derive",
], optional = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_pbr/src/ssr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,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(),
})],
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_pbr/src/volumetric_fog/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,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,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { version = "26", features = [
"serde",
], optional = true, default-features = false }

Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { version = "26", default-features = false, features = [
"wgsl",
"dx12",
"metal",
Expand All @@ -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 = { 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"] }
Expand All @@ -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 = { git = "https://github.com/bevyengine/naga_oil", default-features = false, features = [
"test_shader",
] }

Expand All @@ -136,7 +136,7 @@ send_wrapper = { version = "0.6.0" }
proptest = "1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
naga_oil = { version = "0.18" }
naga_oil = { git = "https://github.com/bevyengine/naga_oil" }
js-sys = "0.3"
web-sys = { version = "0.3.67", features = [
'Blob',
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_render/src/batching/gpu_preprocessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,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 | DownlevelFlags::DEPTH_TEXTURE_AND_BUFFER_COPIES,
);

let max_supported_mode = if device.limits().max_compute_workgroup_size_x == 0
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/diagnostic/tracy_gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, |_| ());
Expand Down
9 changes: 8 additions & 1 deletion crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ use bevy_image::{CompressedImageFormatSupport, CompressedImageFormats};
use bevy_utils::prelude::default;
pub use extract_param::Extract;

use bevy_window::{PrimaryWindow, RawHandleWrapperHolder};
use bevy_window::{PrimaryWindow, RawDisplayHandleWrapper, RawHandleWrapperHolder};
use experimental::occlusion_culling::OcclusionCullingPlugin;
use globals::GlobalsPlugin;
use render_asset::{
Expand Down Expand Up @@ -355,11 +355,17 @@ impl Plugin for RenderPlugin {
.single(app.world())
.ok()
.cloned();

let display_handle = app
.world()
.get_resource::<RawDisplayHandleWrapper>().unwrap();

let settings = render_creation.clone();
let async_renderer = async move {
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,
Expand All @@ -370,6 +376,7 @@ impl Plugin for RenderPlugin {
},
noop: wgpu::NoopBackendOptions { enable: false },
},
display: Some(display_handle.0),
});

let surface = primary_window.and_then(|wrapper| {
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_render/src/render_graph/camera_driver_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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()),
Expand Down
9 changes: 6 additions & 3 deletions crates/bevy_render/src/render_phase/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]`"
Expand Down Expand Up @@ -658,9 +658,12 @@ where
let mut draw_functions = draw_functions.write();

let render_device = world.resource::<RenderDevice>();
let render_adapter_info = world.resource::<RenderAdapterInfo>();
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) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_resource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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,
};
Expand Down
9 changes: 1 addition & 8 deletions crates/bevy_render/src/renderer/graph_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,14 @@ impl RenderGraphRunner {
render_device: RenderDevice,
mut diagnostics_recorder: Option<DiagnosticsRecorder>,
queue: &wgpu::Queue,
#[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))]
adapter: &wgpu::Adapter,
world: &World,
finalizer: impl FnOnce(&mut wgpu::CommandEncoder),
) -> Result<Option<DiagnosticsRecorder>, RenderGraphRunnerError> {
if let Some(recorder) = &mut diagnostics_recorder {
recorder.begin_frame();
}

let mut render_context = RenderContext::new(
render_device,
#[cfg(not(all(target_arch = "wasm32", target_feature = "atomics")))]
adapter.get_info(),
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());

Expand Down
Loading
Loading