Skip to content

Commit ae85d1f

Browse files
committed
Merge branch 'main' into par-mesh-collection
2 parents a3aa5a7 + b8d756d commit ae85d1f

File tree

399 files changed

+10010
-3431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+10010
-3431
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ updates:
1111
patterns:
1212
- "*wgpu*"
1313
- "naga*"
14+
accesskit:
15+
patterns:
16+
- "accesskit*"
1417
- package-ecosystem: github-actions
1518
directory: /
1619
schedule:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ jobs:
367367
with:
368368
persist-credentials: false
369369
- name: Check for typos
370-
uses: crate-ci/typos@5c19779cb52ea50e151f5a10333ccd269227b5ae # v1.41.0
370+
uses: crate-ci/typos@bb4666ad77b539a6b4ce4eda7ebb6de553704021 # v1.42.0
371371
- name: Typos info
372372
if: failure()
373373
run: |

.github/workflows/post-release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ jobs:
5252
--exclude errors \
5353
--exclude bevy_mobile_example \
5454
--exclude build-wasm-example \
55-
--exclude no_std_library
55+
--exclude no_std_library \
56+
--exclude export-content \
57+
--exclude auto_register_static
58+
--exclude mipmap_generator \
59+
--exclude caldera_hotel \
60+
--exclude bistro
5661
5762
- name: Create PR
5863
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0

.github/workflows/security-static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
45+
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
4646
with:
4747
languages: ${{ matrix.language }}
4848
build-mode: ${{ matrix.build-mode }}
@@ -70,7 +70,7 @@ jobs:
7070
exit 1
7171
7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
73+
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
7474
with:
7575
category: "/language:${{matrix.language}}"
7676

Cargo.toml

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy"
3-
version = "0.18.0-dev"
3+
version = "0.19.0-dev"
44
edition = "2024"
55
categories = ["game-engines", "graphics", "gui", "rendering"]
66
description = "A refreshingly simple data-driven game engine and app framework"
@@ -178,7 +178,7 @@ audio = ["bevy_audio", "vorbis"]
178178
# COLLECTION: Features used to compose Bevy scenes.
179179
scene = ["bevy_scene"]
180180

181-
# COLLECTION: Enables picking functionality
181+
# COLLECTION: Enables picking functionality.
182182
picking = ["bevy_picking", "mesh_picking", "sprite_picking", "ui_picking"]
183183

184184
# COLLECTION: The core pieces that most apps need. This serves as a baseline feature set for other higher level feature collections (such as "2d" and "3d"). It is also useful as a baseline feature set for scenarios like headless apps that require no rendering (ex: command line tools, servers, etc).
@@ -217,6 +217,7 @@ common_api = [
217217
"bevy_image",
218218
"bevy_mesh",
219219
"bevy_shader",
220+
"bevy_material",
220221
"bevy_text",
221222
"hdr",
222223
"png",
@@ -272,7 +273,7 @@ ui_bevy_render = [
272273
"bevy_ui_render",
273274
]
274275

275-
# COLLECTION: Recommended defaults for no_std applications
276+
# COLLECTION: Recommended defaults for no_std applications.
276277
default_no_std = ["libm", "critical-section", "bevy_color", "bevy_state"]
277278

278279
# Provides an implementation for picking meshes
@@ -374,6 +375,9 @@ bevy_light = ["bevy_internal/bevy_light"]
374375
# Provides shaders usable through asset handles.
375376
bevy_shader = ["bevy_internal/bevy_shader"]
376377

378+
# Provides materials.
379+
bevy_material = ["bevy_internal/bevy_material"]
380+
377381
# Adds support for gizmos
378382
bevy_gizmos = ["bevy_internal/bevy_gizmos"]
379383

@@ -716,12 +720,12 @@ hotpatching = ["bevy_internal/hotpatching"]
716720
debug = ["bevy_internal/debug"]
717721

718722
[dependencies]
719-
bevy_internal = { path = "crates/bevy_internal", version = "0.18.0-dev", default-features = false }
723+
bevy_internal = { path = "crates/bevy_internal", version = "0.19.0-dev", default-features = false }
720724
tracing = { version = "0.1", default-features = false, optional = true }
721725

722726
# Wasm does not support dynamic linking.
723727
[target.'cfg(not(target_family = "wasm"))'.dependencies]
724-
bevy_dylib = { path = "crates/bevy_dylib", version = "0.18.0-dev", default-features = false, optional = true }
728+
bevy_dylib = { path = "crates/bevy_dylib", version = "0.19.0-dev", default-features = false, optional = true }
725729

726730
[dev-dependencies]
727731
rand = "0.9.0"
@@ -732,14 +736,14 @@ serde = { version = "1", features = ["derive"] }
732736
serde_json = "1.0.140"
733737
bytemuck = "1"
734738
# The following explicit dependencies are needed for proc macros to work inside of examples as they are part of the bevy crate itself.
735-
bevy_animation = { path = "crates/bevy_animation", version = "0.18.0-dev", default-features = false }
736-
bevy_asset = { path = "crates/bevy_asset", version = "0.18.0-dev", default-features = false }
737-
bevy_ecs = { path = "crates/bevy_ecs", version = "0.18.0-dev", default-features = false }
738-
bevy_gizmos = { path = "crates/bevy_gizmos", version = "0.18.0-dev", default-features = false }
739-
bevy_image = { path = "crates/bevy_image", version = "0.18.0-dev", default-features = false }
740-
bevy_reflect = { path = "crates/bevy_reflect", version = "0.18.0-dev", default-features = false }
741-
bevy_render = { path = "crates/bevy_render", version = "0.18.0-dev", default-features = false }
742-
bevy_state = { path = "crates/bevy_state", version = "0.18.0-dev", default-features = false }
739+
bevy_animation = { path = "crates/bevy_animation", version = "0.19.0-dev", default-features = false }
740+
bevy_asset = { path = "crates/bevy_asset", version = "0.19.0-dev", default-features = false }
741+
bevy_ecs = { path = "crates/bevy_ecs", version = "0.19.0-dev", default-features = false }
742+
bevy_gizmos = { path = "crates/bevy_gizmos", version = "0.19.0-dev", default-features = false }
743+
bevy_image = { path = "crates/bevy_image", version = "0.19.0-dev", default-features = false }
744+
bevy_reflect = { path = "crates/bevy_reflect", version = "0.19.0-dev", default-features = false }
745+
bevy_render = { path = "crates/bevy_render", version = "0.19.0-dev", default-features = false }
746+
bevy_state = { path = "crates/bevy_state", version = "0.19.0-dev", default-features = false }
743747
# Needed to poll Task examples
744748
futures-lite = "2.0.1"
745749
futures-timer = { version = "3", features = ["wasm-bindgen", "gloo-timers"] }
@@ -748,7 +752,7 @@ argh = "0.1.12"
748752
thiserror = "2.0"
749753
event-listener = "5.3.0"
750754
anyhow = "1"
751-
accesskit = "0.21"
755+
accesskit = "0.22"
752756
nonmax = "0.5"
753757
gltf = "1.4"
754758

@@ -1250,6 +1254,19 @@ description = "Showcases different blend modes"
12501254
category = "3D Rendering"
12511255
wasm = true
12521256

1257+
[[example]]
1258+
name = "contact_shadows"
1259+
path = "examples/3d/contact_shadows.rs"
1260+
# Causes an ICE on docs.rs
1261+
doc-scrape-examples = false
1262+
required-features = ["bluenoise_texture"]
1263+
1264+
[package.metadata.example.contact_shadows]
1265+
name = "Contact Shadows"
1266+
description = "Showcases how contact shadows add shadow detail"
1267+
category = "3D Rendering"
1268+
wasm = true
1269+
12531270
[[example]]
12541271
name = "lighting"
12551272
path = "examples/3d/lighting.rs"
@@ -3180,6 +3197,17 @@ description = "A very simple compute shader that writes to a buffer that is read
31803197
category = "Shaders"
31813198
wasm = false
31823199

3200+
[[example]]
3201+
name = "compute_mesh"
3202+
path = "examples/shader_advanced/compute_mesh.rs"
3203+
doc-scrape-examples = true
3204+
3205+
[package.metadata.example.compute_mesh]
3206+
name = "Compute Shader Mesh"
3207+
description = "A compute shader that generates a mesh that is controlled by a Handle"
3208+
category = "Shaders"
3209+
wasm = false
3210+
31833211
[[example]]
31843212
name = "array_texture"
31853213
path = "examples/shader/array_texture.rs"
@@ -3860,6 +3888,18 @@ description = "Demonstrates how to display text with strikethrough and underline
38603888
category = "UI (User Interface)"
38613889
wasm = true
38623890

3891+
[[example]]
3892+
name = "generic_font_families"
3893+
path = "examples/ui/generic_font_families.rs"
3894+
# Causes an ICE on docs.rs
3895+
doc-scrape-examples = false
3896+
3897+
[package.metadata.example.generic_font_families]
3898+
name = "Generic Font Families"
3899+
description = "Demonstrates how to use generic font families"
3900+
category = "UI (User Interface)"
3901+
wasm = true
3902+
38633903
[[example]]
38643904
name = "text"
38653905
path = "examples/ui/text.rs"
@@ -4499,7 +4539,7 @@ doc-scrape-examples = false
44994539
name = "glTF extension AnimationGraph"
45004540
description = "Uses glTF data to build an AnimationGraph via extension processing"
45014541
category = "glTF"
4502-
wasm = true
4542+
wasm = false
45034543

45044544
[[example]]
45054545
name = "gltf_extension_mesh_2d"
@@ -4511,7 +4551,7 @@ doc-scrape-examples = false
45114551
name = "glTF extension processing to build Mesh2ds from glTF data"
45124552
description = "Uses glTF extension data to convert incoming Mesh3d/MeshMaterial3d assets to 2d"
45134553
category = "glTF"
4514-
wasm = true
4554+
wasm = false
45154555

45164556
[[example]]
45174557
name = "query_gltf_primitives"
@@ -4662,6 +4702,7 @@ name = "ssr"
46624702
path = "examples/3d/ssr.rs"
46634703
# Causes an ICE on docs.rs
46644704
doc-scrape-examples = false
4705+
required-features = ["bluenoise_texture"]
46654706

46664707
[package.metadata.example.ssr]
46674708
name = "Screen Space Reflections"
@@ -5081,25 +5122,25 @@ wasm = true
50815122

50825123
[[example]]
50835124
name = "directional_navigation"
5084-
path = "examples/ui/directional_navigation.rs"
5125+
path = "examples/ui/navigation/directional_navigation.rs"
50855126
# Causes an ICE on docs.rs
50865127
doc-scrape-examples = false
50875128

50885129
[package.metadata.example.directional_navigation]
50895130
name = "Directional Navigation"
5090-
description = "Demonstration of Directional Navigation between UI elements"
5131+
description = "Demonstration of automatic directional navigation based on UI element positions"
50915132
category = "UI (User Interface)"
50925133
wasm = true
50935134

50945135
[[example]]
5095-
name = "auto_directional_navigation"
5096-
path = "examples/ui/auto_directional_navigation.rs"
5136+
name = "directional_navigation_overrides"
5137+
path = "examples/ui/navigation/directional_navigation_overrides.rs"
50975138
# Causes an ICE on docs.rs
50985139
doc-scrape-examples = false
50995140

5100-
[package.metadata.example.auto_directional_navigation]
5101-
name = "Automatic Directional Navigation"
5102-
description = "Demonstration of automatic directional navigation graph generation based on UI element positions"
5141+
[package.metadata.example.directional_navigation_overrides]
5142+
name = "Directional Navigation Overrides"
5143+
description = "Demonstration of automatic directional navigation between UI elements with manual overrides"
51035144
category = "UI (User Interface)"
51045145
wasm = true
51055146

@@ -5243,6 +5284,17 @@ description = "Demonstrates use of core scrollbar in Bevy UI"
52435284
category = "UI (User Interface)"
52445285
wasm = true
52455286

5287+
[[example]]
5288+
name = "system_fonts"
5289+
path = "examples/ui/system_fonts.rs"
5290+
doc-scrape-examples = true
5291+
5292+
[package.metadata.example.system_fonts]
5293+
name = "system_fonts"
5294+
description = "Demonstrates how to use system fonts"
5295+
category = "UI (User Interface)"
5296+
wasm = true
5297+
52465298
[[example]]
52475299
name = "feathers"
52485300
path = "examples/ui/feathers.rs"

assets/shaders/compute_mesh.wgsl

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// This shader is used for the compute_mesh example
2+
// The actual work it does is not important for the example and
3+
// has been hardcoded to return a cube mesh
4+
5+
// `vertex_start` is the starting offset of the mesh data in the *vertex_data* storage buffer
6+
// `index_start` is the starting offset of the index data in the *index_data* storage buffer
7+
struct DataRanges {
8+
vertex_start: u32,
9+
vertex_end: u32,
10+
index_start: u32,
11+
index_end: u32,
12+
}
13+
14+
@group(0) @binding(0) var<uniform> data_range: DataRanges;
15+
@group(0) @binding(1) var<storage, read_write> vertex_data: array<f32>;
16+
@group(0) @binding(2) var<storage, read_write> index_data: array<u32>;
17+
18+
@compute @workgroup_size(1)
19+
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
20+
// this loop is iterating over the full list of (position, normal, uv)
21+
// data what we have in `vertices`.
22+
// `192` is used because arrayLength on const arrays doesn't work
23+
for (var i = 0u; i < 192; i++) {
24+
// The vertex_data buffer is bigger than just the mesh we're
25+
// processing because Bevy stores meshes in the mesh_allocator
26+
// which allocates slabs that each can contain multiple meshes.
27+
// This buffer is one slab, and data_range.vertex_start is the
28+
// starting offset for the mesh we care about.
29+
// So the 0 starting value in the for loop is added to
30+
// data_range.vertex_start which means we start writing at the
31+
// correct offset.
32+
//
33+
// The "end" of the available space to write into is known by us
34+
// ahead of time in this example, so we know this has enough space,
35+
// but you may wish to also check to make sure you are not writing
36+
// past the end of the range *because you should not write past the
37+
// end of the range ever*. Doing this can overwrite a different
38+
// mesh's data.
39+
vertex_data[i + data_range.vertex_start] = vertices[i];
40+
}
41+
// `36` is the length of the `indices` array
42+
for (var i = 0u; i < 36; i++) {
43+
// This is doing the same as the vertex_data offset described above
44+
index_data[i + data_range.index_start] = u32(indices[i]);
45+
}
46+
}
47+
48+
// hardcoded compute shader data.
49+
// half_size is half the size of the cube
50+
const half_size = vec3(1.5);
51+
const min = -half_size;
52+
const max = half_size;
53+
54+
// Suppose Y-up right hand, and camera look from +Z to -Z
55+
const vertices = array(
56+
// xyz, normal.xyz, uv.xy
57+
// Front
58+
min.x, min.y, max.z, 0.0, 0.0, 1.0, 0.0, 0.0,
59+
max.x, min.y, max.z, 0.0, 0.0, 1.0, 1.0, 0.0,
60+
max.x, max.y, max.z, 0.0, 0.0, 1.0, 1.0, 1.0,
61+
min.x, max.y, max.z, 0.0, 0.0, 1.0, 0.0, 1.0,
62+
// Back
63+
min.x, max.y, min.z, 0.0, 0.0, -1.0, 1.0, 0.0,
64+
max.x, max.y, min.z, 0.0, 0.0, -1.0, 0.0, 0.0,
65+
max.x, min.y, min.z, 0.0, 0.0, -1.0, 0.0, 1.0,
66+
min.x, min.y, min.z, 0.0, 0.0, -1.0, 1.0, 1.0,
67+
// Right
68+
max.x, min.y, min.z, 1.0, 0.0, 0.0, 0.0, 0.0,
69+
max.x, max.y, min.z, 1.0, 0.0, 0.0, 1.0, 0.0,
70+
max.x, max.y, max.z, 1.0, 0.0, 0.0, 1.0, 1.0,
71+
max.x, min.y, max.z, 1.0, 0.0, 0.0, 0.0, 1.0,
72+
// Left
73+
min.x, min.y, max.z, -1.0, 0.0, 0.0, 1.0, 0.0,
74+
min.x, max.y, max.z, -1.0, 0.0, 0.0, 0.0, 0.0,
75+
min.x, max.y, min.z, -1.0, 0.0, 0.0, 0.0, 1.0,
76+
min.x, min.y, min.z, -1.0, 0.0, 0.0, 1.0, 1.0,
77+
// Top
78+
max.x, max.y, min.z, 0.0, 1.0, 0.0, 1.0, 0.0,
79+
min.x, max.y, min.z, 0.0, 1.0, 0.0, 0.0, 0.0,
80+
min.x, max.y, max.z, 0.0, 1.0, 0.0, 0.0, 1.0,
81+
max.x, max.y, max.z, 0.0, 1.0, 0.0, 1.0, 1.0,
82+
// Bottom
83+
max.x, min.y, max.z, 0.0, -1.0, 0.0, 0.0, 0.0,
84+
min.x, min.y, max.z, 0.0, -1.0, 0.0, 1.0, 0.0,
85+
min.x, min.y, min.z, 0.0, -1.0, 0.0, 1.0, 1.0,
86+
max.x, min.y, min.z, 0.0, -1.0, 0.0, 0.0, 1.0
87+
);
88+
89+
const indices = array(
90+
0, 1, 2, 2, 3, 0, // front
91+
4, 5, 6, 6, 7, 4, // back
92+
8, 9, 10, 10, 11, 8, // right
93+
12, 13, 14, 14, 15, 12, // left
94+
16, 17, 18, 18, 19, 16, // top
95+
20, 21, 22, 22, 23, 20, // bottom
96+
);

benches/benches/bevy_ecs/world/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ criterion_group!(
2929
world_query_iter,
3030
world_query_for_each,
3131
world_spawn,
32+
world_spawn_batch,
3233
world_despawn,
3334
world_despawn_recursive,
3435
query_get,

0 commit comments

Comments
 (0)