Skip to content

Commit

Permalink
Merge branch 'main' into mrgvsv/reflect/nested-type-info
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile authored Jul 14, 2024
2 parents b588f43 + 9f376df commit 6dfbbb7
Show file tree
Hide file tree
Showing 353 changed files with 9,269 additions and 3,155 deletions.
3 changes: 2 additions & 1 deletion .cargo/config_fast_builds.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ rustflags = [
# rustup component add llvm-tools
# ```
linker = "rust-lld.exe"
rustdocflags = ["-Clinker=rust-lld.exe"]
rustflags = [
# Nightly
# "-Zshare-generics=y",
# "-Zshare-generics=n", # This needs to be off if you use dynamic linking on Windows.
# "-Zthreads=0",
]

Expand Down
2 changes: 1 addition & 1 deletion .github/contributing/engine_style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For more advice on contributing to the engine, see the [relevant section](../../
4. Use \`variable_name\` code blocks in comments to signify that you're referring to specific types and variables.
5. Start comments with capital letters. End them with a period if they are sentence-like.
3. Use comments to organize long and complex stretches of code that can't sensibly be refactored into separate functions.
4. When using [Bevy error codes](https://bevyengine.org/learn/errors/) include a link to the relevant error on the Bevy website in the returned error message `... See: https://bevyengine.org/learn/errors/#b0003`.
4. When using [Bevy error codes](https://bevyengine.org/learn/errors/) include a link to the relevant error on the Bevy website in the returned error message `... See: https://bevyengine.org/learn/errors/b0003`.

## Rust API guidelines

Expand Down
8 changes: 7 additions & 1 deletion .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"MD013": false
"MD013": false,
"no-inline-html": {
"allowed_elements": [
"details",
"summary"
]
}
}
24 changes: 18 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@

---

## Changelog
## Showcase

> This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section.
> This section is optional. If this PR does not include a visual change or does not add a new feature, you can delete this section.
- What changed as a result of this PR?
- If applicable, organize changes under "Added", "Changed", or "Fixed" sub-headings
- Stick to one or two sentences. If more detail is needed for a particular change, consider adding it to the "Solution" section
- If you can't summarize the work, your change may be unreasonably large / unrelated. Consider splitting your PR to make it easier to review and merge!
- Help others understand the result of this PR by showcasing your awesome work!
- If this PR adds a new feature or public API, consider adding a brief pseudo-code snippet of it in action
- If this PR includes a visual change, consider adding a screenshot, GIF, or video
- If you want, you could even include a before/after comparison!
- If the Migration Guide adequately covers the changes, you can delete this section

While a showcase should aim to be brief and digestible, you can use a toggleable section to save space on longer showcases:

<details>
<summary>Click to view showcase</summary>

```rust
println!("My super cool code.");
```

</details>

## Migration Guide

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@v1.22.9
uses: crate-ci/typos@v1.23.1
- name: Typos info
if: failure()
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
# Read the current version from Cargo.toml
current_version=$(cargo metadata --format-version 1 --no-deps | \
jq --raw-output '.packages | .[] | select(.name == "bevy").version')
# Sanity check: current version should be 0.X.Y
if ! grep -q '^0\.[0-9]\+\.[0-9]\+$' <<< "${current_version}"; then
echo "Invalid version (not in 0.X.Y format): ${current_version}"
# Sanity check: current version should be 0.X.Y-dev
if ! grep -q '^0\.[0-9]\+\.[0-9]\+-dev$' <<< "${current_version}"; then
echo "Invalid version (not in 0.X.Y-dev format): ${current_version}"
exit 1
fi
minor_version=$(sed 's/^0\.\([0-9]\+\).*/\1/' <<< "${current_version}")
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/validation-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.78
- uses: dtolnay/rust-toolchain@stable
- name: Build bevy
shell: bash
# this uses the same command as when running the example to ensure build is reused
Expand Down
61 changes: 52 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy"
version = "0.14.0-dev"
version = "0.15.0-dev"
edition = "2021"
categories = ["game-engines", "graphics", "gui", "rendering"]
description = "A refreshingly simple data-driven game engine and app framework"
Expand All @@ -10,7 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/bevyengine/bevy"
documentation = "https://docs.rs/bevy"
rust-version = "1.78.0"
rust-version = "1.79.0"

[workspace]
exclude = [
Expand Down Expand Up @@ -38,6 +38,8 @@ undocumented_unsafe_blocks = "warn"
redundant_else = "warn"
match_same_arms = "warn"
semicolon_if_nothing_returned = "warn"
redundant_closure_for_method_calls = "warn"
unwrap_or_default = "warn"

ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
Expand Down Expand Up @@ -77,6 +79,7 @@ default = [
"bevy_gizmos",
"android_shared_stdcxx",
"tonemapping_luts",
"smaa_luts",
"default_font",
"webgl2",
"sysinfo_plugin",
Expand Down Expand Up @@ -268,9 +271,6 @@ wayland = ["bevy_internal/wayland"]
# X11 display server support
x11 = ["bevy_internal/x11"]

# Enable rendering of font glyphs using subpixel accuracy
subpixel_glyph_atlas = ["bevy_internal/subpixel_glyph_atlas"]

# Enable systems that allow for automated testing on CI
bevy_ci_testing = ["bevy_internal/bevy_ci_testing"]

Expand All @@ -286,6 +286,9 @@ detailed_trace = ["bevy_internal/detailed_trace"]
# Include tonemapping Look Up Tables KTX2 files. If everything is pink, you need to enable this feature or change the `Tonemapping` method on your `Camera2dBundle` or `Camera3dBundle`.
tonemapping_luts = ["bevy_internal/tonemapping_luts", "ktx2", "zstd"]

# Include SMAA Look Up Tables KTX2 Files
smaa_luts = ["bevy_internal/smaa_luts"]

# Enable AccessKit on Unix backends (currently only works with experimental screen readers and forks.)
accesskit_unix = ["bevy_internal/accesskit_unix"]

Expand All @@ -312,6 +315,9 @@ pbr_multi_layer_material_textures = [
"bevy_internal/pbr_multi_layer_material_textures",
]

# Enable support for anisotropy texture in the `StandardMaterial`, at the risk of blowing past the global, per-shader texture limit on older/lower-end GPUs
pbr_anisotropy_texture = ["bevy_internal/pbr_anisotropy_texture"]

# Enable some limitations to be able to use WebGL2. Please refer to the [WebGL2 and WebGPU](https://github.com/bevyengine/bevy/tree/latest/examples#webgl2-and-webgpu) section of the examples README for more information on how to run Wasm builds with WebGPU.
webgl2 = ["bevy_internal/webgl"]

Expand Down Expand Up @@ -342,12 +348,15 @@ ios_simulator = ["bevy_internal/ios_simulator"]
# Enable built in global state machines
bevy_state = ["bevy_internal/bevy_state"]

# Enable function reflection
reflect_functions = ["bevy_internal/reflect_functions"]

[dependencies]
bevy_internal = { path = "crates/bevy_internal", version = "0.14.0-dev", default-features = false }
bevy_internal = { path = "crates/bevy_internal", version = "0.15.0-dev", default-features = false }

# WASM does not support dynamic linking.
[target.'cfg(not(target_family = "wasm"))'.dependencies]
bevy_dylib = { path = "crates/bevy_dylib", version = "0.14.0-dev", default-features = false, optional = true }
bevy_dylib = { path = "crates/bevy_dylib", version = "0.15.0-dev", default-features = false, optional = true }

[dev-dependencies]
rand = "0.8.0"
Expand Down Expand Up @@ -2148,6 +2157,18 @@ description = "How dynamic types are used with reflection"
category = "Reflection"
wasm = false

[[example]]
name = "function_reflection"
path = "examples/reflection/function_reflection.rs"
doc-scrape-examples = true
required-features = ["reflect_functions"]

[package.metadata.example.function_reflection]
name = "Function Reflection"
description = "Demonstrates how functions can be called dynamically using reflection"
category = "Reflection"
wasm = false

[[example]]
name = "generic_reflection"
path = "examples/reflection/generic_reflection.rs"
Expand Down Expand Up @@ -3063,7 +3084,7 @@ wasm = true

[[example]]
name = "smooth_follow"
path = "examples/math/smooth_follow.rs"
path = "examples/movement/smooth_follow.rs"
doc-scrape-examples = true

[package.metadata.example.smooth_follow]
Expand Down Expand Up @@ -3222,14 +3243,36 @@ wasm = true
name = "anisotropy"
path = "examples/3d/anisotropy.rs"
doc-scrape-examples = true
required-features = ["jpeg"]
required-features = ["jpeg", "pbr_anisotropy_texture"]

[package.metadata.example.anisotropy]
name = "Anisotropy"
description = "Displays an example model with anisotropy"
category = "3D Rendering"
wasm = false

[[example]]
name = "custom_phase_item"
path = "examples/shader/custom_phase_item.rs"
doc-scrape-examples = true

[package.metadata.example.custom_phase_item]
name = "Custom phase item"
description = "Demonstrates how to enqueue custom draw commands in a render phase"
category = "Shaders"
wasm = true

[[example]]
name = "physics_in_fixed_timestep"
path = "examples/movement/physics_in_fixed_timestep.rs"
doc-scrape-examples = true

[package.metadata.example.physics_in_fixed_timestep]
name = "Run physics in a fixed timestep"
description = "Handles input, physics, and rendering in an industry-standard way by using a fixed timestep"
category = "Movement"
wasm = true

[profile.wasm-release]
inherits = "release"
opt-level = "z"
Expand Down
20 changes: 0 additions & 20 deletions assets/shaders/circle_shader.wgsl

This file was deleted.

36 changes: 36 additions & 0 deletions assets/shaders/custom_phase_item.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// `custom_phase_item.wgsl`
//
// This shader goes with the `custom_phase_item` example. It demonstrates how to
// enqueue custom rendering logic in a `RenderPhase`.

// The GPU-side vertex structure.
struct Vertex {
// The world-space position of the vertex.
@location(0) position: vec3<f32>,
// The color of the vertex.
@location(1) color: vec3<f32>,
};

// Information passed from the vertex shader to the fragment shader.
struct VertexOutput {
// The clip-space position of the vertex.
@builtin(position) clip_position: vec4<f32>,
// The color of the vertex.
@location(0) color: vec3<f32>,
};

// The vertex shader entry point.
@vertex
fn vertex(vertex: Vertex) -> VertexOutput {
// Use an orthographic projection.
var vertex_output: VertexOutput;
vertex_output.clip_position = vec4(vertex.position.xyz, 1.0);
vertex_output.color = vertex.color;
return vertex_output;
}

// The fragment shader entry point.
@fragment
fn fragment(vertex_output: VertexOutput) -> @location(0) vec4<f32> {
return vec4(vertex_output.color, 1.0);
}
18 changes: 18 additions & 0 deletions assets/shaders/custom_ui_material.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This shader draws a circle with a given input color
#import bevy_ui::ui_vertex_output::UiVertexOutput

@group(1) @binding(0) var<uniform> color: vec4<f32>;
@group(1) @binding(1) var<uniform> slider: f32;
@group(1) @binding(2) var material_color_texture: texture_2d<f32>;
@group(1) @binding(3) var material_color_sampler: sampler;


@fragment
fn fragment(in: UiVertexOutput) -> @location(0) vec4<f32> {
if in.uv.x < slider {
let output_color = textureSample(material_color_texture, material_color_sampler, in.uv) * color;
return output_color;
} else {
return vec4(0.0);
}
}
Loading

0 comments on commit 6dfbbb7

Please sign in to comment.