Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bind_group_entries
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Oct 17, 2023
2 parents c5a6681 + de8a600 commit 14ff145
Show file tree
Hide file tree
Showing 357 changed files with 12,127 additions and 5,335 deletions.
3 changes: 0 additions & 3 deletions .github/example-run/minimising.ron

This file was deleted.

4 changes: 0 additions & 4 deletions .github/example-run/resizing.ron

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ jobs:
os_version: "12.0"
- device: "Samsung Galaxy S23"
os_version: "13.0"
- device: "Google Pixel 8"
os_version: "14.0"
steps:
- uses: actions/checkout@v4

Expand Down
29 changes: 26 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,16 @@ shader_format_spirv = ["bevy_internal/shader_format_spirv"]
webgl2 = ["bevy_internal/webgl"]

# Enables watching the filesystem for Bevy Asset hot-reloading
filesystem_watcher = ["bevy_internal/filesystem_watcher"]
file_watcher = ["bevy_internal/file_watcher"]

# Enables watching in memory asset providers for Bevy Asset hot-reloading
embedded_watcher = ["bevy_internal/embedded_watcher"]

[dependencies]
bevy_dylib = { path = "crates/bevy_dylib", version = "0.12.0-dev", default-features = false, optional = true }
bevy_internal = { path = "crates/bevy_internal", version = "0.12.0-dev", default-features = false }

[dev-dependencies]
anyhow = "1.0.4"
rand = "0.8.0"
ron = "0.8.0"
serde = { version = "1", features = ["derive"] }
Expand Down Expand Up @@ -612,6 +614,16 @@ description = "Illustrates bloom configuration using HDR and emissive materials"
category = "3D Rendering"
wasm = true

[[example]]
name = "deferred_rendering"
path = "examples/3d/deferred_rendering.rs"

[package.metadata.example.deferred_rendering]
name = "Deferred Rendering"
description = "Renders meshes with both forward and deferred pipelines"
category = "3D Rendering"
wasm = true

[[example]]
name = "load_gltf"
path = "examples/3d/load_gltf.rs"
Expand Down Expand Up @@ -1056,6 +1068,7 @@ wasm = true
name = "hot_asset_reloading"
path = "examples/asset/hot_asset_reloading.rs"
doc-scrape-examples = true
required-features = ["file_watcher"]

[package.metadata.example.hot_asset_reloading]
name = "Hot Reloading of Assets"
Expand All @@ -1067,7 +1080,7 @@ wasm = true
name = "asset_processing"
path = "examples/asset/processing/processing.rs"
doc-scrape-examples = true
required-features = ["filesystem_watcher"]
required-features = ["file_watcher"]

[package.metadata.example.asset_processing]
name = "Asset Processing"
Expand Down Expand Up @@ -1385,6 +1398,16 @@ description = "Illustrates creating custom system parameters with `SystemParam`"
category = "ECS (Entity Component System)"
wasm = false

[[example]]
name = "time"
path = "examples/ecs/time.rs"

[package.metadata.example.time]
name = "Time handling"
description = "Explains how Time is handled in ECS"
category = "ECS (Entity Component System)"
wasm = false

[[example]]
name = "timers"
path = "examples/ecs/timers.rs"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# [![Bevy](assets/branding/bevy_logo_light_dark_and_dimmed.svg)](https://bevyengine.org)

[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/bevyengine/bevy#license)
[![Crates.io](https://img.shields.io/crates/v/bevy.svg)](https://crates.io/crates/bevy)
[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/bevyengine/bevy#license)
[![Crates.io](https://img.shields.io/crates/d/bevy.svg)](https://crates.io/crates/bevy)
[![Rust](https://github.com/bevyengine/bevy/workflows/CI/badge.svg)](https://github.com/bevyengine/bevy/actions)
![iOS cron CI](https://github.com/bevyengine/bevy/workflows/iOS%20cron%20CI/badge.svg)
[![Downloads](https://img.shields.io/crates/d/bevy.svg)](https://crates.io/crates/bevy)
[![Docs](https://docs.rs/bevy/badge.svg)](https://docs.rs/bevy/latest/bevy/)
[![CI](https://github.com/bevyengine/bevy/workflows/CI/badge.svg)](https://github.com/bevyengine/bevy/actions)
[![Discord](https://img.shields.io/discord/691052431525675048.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/bevy)

## What is Bevy?
Expand Down
122 changes: 0 additions & 122 deletions assets/models/monkey/Monkey.gltf

This file was deleted.

110 changes: 110 additions & 0 deletions assets/models/torus/torus.gltf

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/shaders/animate_shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The time since startup data is in the globals binding which is part of the mesh_view_bindings import
#import bevy_pbr::mesh_view_bindings globals
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

fn oklab_to_linear_srgb(c: vec3<f32>) -> vec3<f32> {
let L = c.x;
Expand All @@ -23,7 +23,7 @@ fn oklab_to_linear_srgb(c: vec3<f32>) -> vec3<f32> {
}

@fragment
fn fragment(in: MeshVertexOutput) -> @location(0) vec4<f32> {
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
let speed = 2.0;
// The globals binding contains various global values like time
// which is the time since startup in seconds
Expand Down
8 changes: 4 additions & 4 deletions assets/shaders/array_texture.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput
#import bevy_pbr::mesh_view_bindings view
#import bevy_pbr::pbr_types STANDARD_MATERIAL_FLAGS_DOUBLE_SIDED_BIT
#import bevy_pbr::pbr_types STANDARD_MATERIAL_FLAGS_DOUBLE_SIDED_BIT, PbrInput, pbr_input_new
#import bevy_core_pipeline::tonemapping tone_mapping
#import bevy_pbr::pbr_functions as fns

Expand All @@ -10,13 +10,13 @@
@fragment
fn fragment(
@builtin(front_facing) is_front: bool,
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
let layer = i32(mesh.world_position.x) & 0x3;

// Prepare a 'processed' StandardMaterial by sampling all textures to resolve
// the material members
var pbr_input: fns::PbrInput = fns::pbr_input_new();
var pbr_input: PbrInput = pbr_input_new();

pbr_input.material.base_color = textureSample(my_array_texture, my_array_texture_sampler, mesh.uv, layer);
#ifdef VERTEX_COLORS
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/cubemap_unlit.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

#ifdef CUBEMAP_ARRAY
@group(1) @binding(0) var base_color_texture: texture_cube_array<f32>;
Expand All @@ -10,7 +10,7 @@

@fragment
fn fragment(
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
let fragment_position_view_lh = mesh.world_position.xyz * vec3<f32>(1.0, 1.0, -1.0);
return textureSample(
Expand Down
8 changes: 5 additions & 3 deletions assets/shaders/custom_material.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput
// we can import items from shader modules in the assets folder with a quoted path
#import "shaders/custom_material_import.wgsl" COLOR_MULTIPLIER

struct CustomMaterial {
color: vec4<f32>,
Expand All @@ -10,7 +12,7 @@ struct CustomMaterial {

@fragment
fn fragment(
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
return material.color * textureSample(base_color_texture, base_color_sampler, mesh.uv);
return material.color * textureSample(base_color_texture, base_color_sampler, mesh.uv) * COLOR_MULTIPLIER;
}
2 changes: 2 additions & 0 deletions assets/shaders/custom_material_import.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// this is made available to the importing module
const COLOR_MULTIPLIER: vec4<f32> = vec4<f32>(1.0, 1.0, 1.0, 0.5);
4 changes: 2 additions & 2 deletions assets/shaders/custom_material_screenspace_texture.wgsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#import bevy_pbr::mesh_view_bindings view
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput
#import bevy_pbr::utils coords_to_viewport_uv

@group(1) @binding(0) var texture: texture_2d<f32>;
@group(1) @binding(1) var texture_sampler: sampler;

@fragment
fn fragment(
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
let viewport_uv = coords_to_viewport_uv(mesh.position.xy, view.viewport);
let color = textureSample(texture, texture_sampler, viewport_uv);
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/fallback_image_test.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import bevy_pbr::mesh_view_bindings
#import bevy_pbr::mesh_bindings
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

@group(1) @binding(0) var test_texture_1d: texture_1d<f32>;
@group(1) @binding(1) var test_texture_1d_sampler: sampler;
Expand All @@ -21,4 +21,4 @@
@group(1) @binding(11) var test_texture_3d_sampler: sampler;

@fragment
fn fragment(in: MeshVertexOutput) {}
fn fragment(in: VertexOutput) {}
4 changes: 2 additions & 2 deletions assets/shaders/line_material.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

struct LineMaterial {
color: vec4<f32>,
Expand All @@ -8,7 +8,7 @@ struct LineMaterial {

@fragment
fn fragment(
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
return material.color;
}
4 changes: 2 additions & 2 deletions assets/shaders/shader_defs.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

struct CustomMaterial {
color: vec4<f32>,
Expand All @@ -8,7 +8,7 @@ struct CustomMaterial {

@fragment
fn fragment(
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
#ifdef IS_RED
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/show_prepass.wgsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import bevy_pbr::mesh_types
#import bevy_pbr::mesh_view_bindings globals
#import bevy_pbr::prepass_utils
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

struct ShowPrepassSettings {
show_depth: u32,
Expand All @@ -17,7 +17,7 @@ fn fragment(
#ifdef MULTISAMPLED
@builtin(sample_index) sample_index: u32,
#endif
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
#ifndef MULTISAMPLED
let sample_index = 0u;
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/texture_binding_array.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput

@group(1) @binding(0) var textures: binding_array<texture_2d<f32>>;
@group(1) @binding(1) var nearest_sampler: sampler;
Expand All @@ -7,7 +7,7 @@

@fragment
fn fragment(
mesh: MeshVertexOutput,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
// Select the texture to sample from using non-uniform uv coordinates
let coords = clamp(vec2<u32>(mesh.uv * 4.0), vec2<u32>(0u), vec2<u32>(3u));
Expand Down
8 changes: 4 additions & 4 deletions assets/shaders/tonemapping_test_patterns.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import bevy_pbr::mesh_view_bindings
#import bevy_pbr::mesh_bindings
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::forward_io VertexOutput
#import bevy_pbr::utils PI

#ifdef TONEMAP_IN_SHADER
Expand All @@ -9,8 +9,8 @@

// Sweep across hues on y axis with value from 0.0 to +15EV across x axis
// quantized into 24 steps for both axis.
fn color_sweep(uv: vec2<f32>) -> vec3<f32> {
var uv = uv;
fn color_sweep(uv_input: vec2<f32>) -> vec3<f32> {
var uv = uv_input;
let steps = 24.0;
uv.y = uv.y * (1.0 + 1.0 / steps);
let ratio = 2.0;
Expand Down Expand Up @@ -43,7 +43,7 @@ fn continuous_hue(uv: vec2<f32>) -> vec3<f32> {

@fragment
fn fragment(
in: MeshVertexOutput,
in: VertexOutput,
) -> @location(0) vec4<f32> {
var uv = in.uv;
var out = vec3(0.0);
Expand Down
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/iteration/iter_frag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
for mut data in self.1.iter_mut(&mut self.0) {
data.0 *= 2.0;
Expand Down
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/iteration/iter_frag_foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1.for_each_mut(&mut self.0, |mut data| {
data.0 *= 2.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1.for_each_mut(&mut self.0, |mut data| {
data.0 *= 2.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1.for_each_mut(&mut self.0, |mut data| {
data.0 .0 *= 2.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1.for_each_mut(&mut self.0, |mut data| {
data.0 .0 *= 2.0;
Expand Down
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/iteration/iter_frag_sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
for mut data in self.1.iter_mut(&mut self.0) {
data.0 *= 2.0;
Expand Down
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/iteration/iter_frag_wide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
for mut data in self.1.iter_mut(&mut self.0) {
data.0 .0 *= 2.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
for mut data in self.1.iter_mut(&mut self.0) {
data.0 .0 *= 2.0;
Expand Down
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/iteration/iter_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
for (velocity, mut position) in self.1.iter_mut(&mut self.0) {
position.0 += velocity.0;
Expand Down
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/iteration/iter_simple_foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1
.for_each_mut(&mut self.0, |(velocity, mut position)| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1
.for_each_mut(&mut self.0, |(velocity, mut position)| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl<'w> Benchmark<'w> {
Self(world, query)
}

#[inline(never)]
pub fn run(&mut self) {
self.1.for_each_mut(&mut self.0, |mut item| {
item.1 .0 += item.0 .0;
Expand Down
Loading

0 comments on commit 14ff145

Please sign in to comment.