Skip to content

Instantly share code, notes, and snippets.

@pcwalton
pcwalton / BevyGPUDrivenReleaseNotes.md
Created April 10, 2025 04:10
Bevy GPU-driven release notes

GPU-Driven Rendering

Over the years, the trend in real-time rendering has increasingly been to move work from the CPU to the GPU. One of the latest developments in this area has been GPU-driven rendering, in which the GPU takes a representation of the scene and essentially works out what to draw on its own. While Bevy 0.15 had some support for GPU-driven rendering for meshlets only, Bevy 0.16 features comprehensive support for this technique, including for skinned meshes. This dramatically reduces the amount of CPU time that the renderer needs for larger scenes. It's automatically enabled on platforms that support it; unless your application hooks into the rendering pipeline, upgrading to Bevy 0.16 will automatically enable GPU-driven rendering for your meshes.

To explain how GPU-driven rendering operates, it's easiest to first describe how CPU-driven rendering works:

  1. The CPU determines the objects that are visible, via frustum culling and perhaps occlusion culling.

  2. For each such object:

@pcwalton
pcwalton / BevyFeatures.md
Created January 16, 2025 18:26
Bevy rendering features

Bevy Features

  • wgpu-based renderer
    • Direct3D 12
    • Vulkan
    • OpenGL
    • Metal
    • WebGPU
    • WebGL 2
  • Multithreaded rendering
diff --git a/Cargo.toml b/Cargo.toml
index 7729047..393959d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,7 +39,7 @@ name = "ui"
required-features = ["render"]
[dependencies]
-bevy = { version = "0.14.0", default-features = false, features = [
+bevy = { version = "0.15.0-dev", default-features = false, features = [
diff --git a/examples/tools/scene_viewer/scene_viewer_plugin.rs b/examples/tools/scene_viewer/scene_viewer_plugin.rs
index 2ff6af494..52597c1bb 100644
--- a/examples/tools/scene_viewer/scene_viewer_plugin.rs
+++ b/examples/tools/scene_viewer/scene_viewer_plugin.rs
@@ -72,6 +72,7 @@ impl Plugin for SceneViewerPlugin {
Update,
(
update_lights,
+ update_materials,
camera_tracker,
diff --git a/crates/bevy_pbr/src/extended_material.rs b/crates/bevy_pbr/src/extended_material.rs
index a5c46ea6f..39ad33faf 100644
--- a/crates/bevy_pbr/src/extended_material.rs
+++ b/crates/bevy_pbr/src/extended_material.rs
@@ -1,3 +1,5 @@
+use std::marker::PhantomData;
+
use bevy_asset::{Asset, Handle};
use bevy_reflect::{impl_type_path, Reflect};
use bevy_render::{
diff --git a/crates/bevy_pbr/src/meshlet/from_mesh.rs b/crates/bevy_pbr/src/meshlet/from_mesh.rs
index 36af9c445..c6f8c6cff 100644
--- a/crates/bevy_pbr/src/meshlet/from_mesh.rs
+++ b/crates/bevy_pbr/src/meshlet/from_mesh.rs
@@ -23,14 +23,14 @@ impl MeshletMesh {
if mesh.primitive_topology() != PrimitiveTopology::TriangleList {
return Err(MeshToMeshletMeshConversionError::WrongMeshPrimitiveTopology);
}
- let vertex_buffer_layout = &mesh.get_mesh_vertex_buffer_layout();
- if vertex_buffer_layout.attribute_ids()
diff --git a/crates/bevy_pbr/src/meshlet/material_draw_prepare.rs b/crates/bevy_pbr/src/meshlet/material_draw_prepare.rs
index 1fee72d69..fb723a0d5 100644
--- a/crates/bevy_pbr/src/meshlet/material_draw_prepare.rs
+++ b/crates/bevy_pbr/src/meshlet/material_draw_prepare.rs
@@ -9,11 +9,11 @@ use bevy_core_pipeline::{
use bevy_derive::{Deref, DerefMut};
use bevy_render::{
camera::TemporalJitter,
- mesh::{InnerMeshVertexBufferLayout, Mesh, MeshVertexBufferLayout},
+ mesh::{Mesh, MeshVertexBufferLayout, MeshVertexBufferLayoutRef, MeshVertexBufferLayouts},
diff --git a/crates/bevy_pbr/src/light_probe/environment_map.wgsl b/crates/bevy_pbr/src/light_probe/environment_map.wgsl
index 7a6d660e5..2c8390f83 100644
--- a/crates/bevy_pbr/src/light_probe/environment_map.wgsl
+++ b/crates/bevy_pbr/src/light_probe/environment_map.wgsl
@@ -30,10 +30,7 @@ fn compute_radiances(
var radiances: EnvironmentMapRadiances;
// Search for a reflection probe that contains the fragment.
- var query_result = query_light_probe(
- light_probes.reflection_probes,
commit acdae9ee7d92c7bfbbe2d560a3e00039ce5a3380
Author: Patrick Walton <[email protected]>
Date: Mon Feb 5 18:10:52 2024 -0800
wip
diff --git a/crates/bevy_transform/Cargo.toml b/crates/bevy_transform/Cargo.toml
index 8e5e93718..cde746d06 100644
--- a/crates/bevy_transform/Cargo.toml
+++ b/crates/bevy_transform/Cargo.toml
diff --git a/crates/bevy_transform/src/systems.rs b/crates/bevy_transform/src/systems.rs
index 8f6bac916..53c6d707e 100644
--- a/crates/bevy_transform/src/systems.rs
+++ b/crates/bevy_transform/src/systems.rs
@@ -54,8 +54,13 @@ pub fn propagate_transforms(
mut orphaned: RemovedComponents<Parent>,
transform_query: Query<(Ref<Transform>, &mut GlobalTransform, Option<&Children>), With<Parent>>,
parent_query: Query<(Entity, Ref<Parent>)>,
+ any_changes: Query<Entity, Or<(Changed<Transform>, Changed<Parent>, Changed<Children>)>>,
mut orphaned_entities: Local<Vec<Entity>>,