Skip to content

Ugrade to wgpu version 25.0 #19563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
38779ed
Wgpu 25 compile.
tychedelia May 14, 2025
f5969d7
Split view 0 into 0,1
tychedelia Jun 9, 2025
891184e
Fmt.
tychedelia Jun 9, 2025
ddf8b8e
.
tychedelia Jun 15, 2025
793bbaf
Merge main.
tychedelia Jun 20, 2025
776b471
Clean up and add empty bind group.
tychedelia Jun 20, 2025
c3b4350
Ci.
tychedelia Jun 20, 2025
dddade5
Bump codespan.
tychedelia Jun 20, 2025
b629a65
Add missing backends.
tychedelia Jun 20, 2025
a79f15a
Fix gizmos.
tychedelia Jun 20, 2025
9dde561
Fix prepass.
tychedelia Jun 20, 2025
aab1cfb
Fix skinning.
tychedelia Jun 20, 2025
88cba3d
Migration.
tychedelia Jun 20, 2025
8ab8f27
Markdown.
tychedelia Jun 20, 2025
56296bf
Markdown.
tychedelia Jun 20, 2025
e869d43
5488 fixed upstream.
tychedelia Jun 20, 2025
9b52a0b
Bindless resources 2->3
tychedelia Jun 20, 2025
88c9492
Add new caps.
tychedelia Jun 20, 2025
c180bd7
WebGPU compliant dual source blending.
tychedelia Jun 20, 2025
92db3a9
add necessary directive.
tychedelia Jun 21, 2025
31dc04c
Merge branch 'main' into wgpu-25-2
tychedelia Jun 23, 2025
042e567
Merge branch 'main' into wgpu-25-2
tychedelia Jun 24, 2025
9495fa6
Fmt.
tychedelia Jun 24, 2025
e7f11a7
Fix lightmaps.
tychedelia Jun 24, 2025
ef83e59
Fix decal.
tychedelia Jun 24, 2025
aa7dd74
GLSL
tychedelia Jun 24, 2025
03e61f2
GLSL
tychedelia Jun 24, 2025
a6179f9
Oops.
tychedelia Jun 24, 2025
1edac8a
Merge remote-tracking branch 'origin/main' into wgpu-25-2
tychedelia Jun 24, 2025
c821f35
Fix examples
tychedelia Jun 24, 2025
a480511
ShaderStages::all() is broken in WebGPU.
tychedelia Jun 24, 2025
653c8e3
Compute.
tychedelia Jun 24, 2025
8ec9340
Fix solari.
tychedelia Jun 24, 2025
5a72ae8
Solari.
tychedelia Jun 24, 2025
31236ca
Note exported float constants.
tychedelia Jun 24, 2025
d97817b
Merge branch 'main' into wgpu-25-2
tychedelia Jun 24, 2025
1bf8e58
Merge branch 'main' into wgpu-25-2
mockersf Jun 25, 2025
a91d387
Remove unecessary solari feature.
tychedelia Jun 25, 2025
ac04ed5
Fmt.
tychedelia Jun 25, 2025
f1cce9d
Update crates/bevy_pbr/src/atmosphere/render_sky.wgsl
tychedelia Jun 26, 2025
1284668
Update crates/bevy_pbr/src/atmosphere/render_sky.wgsl
tychedelia Jun 26, 2025
7a39c20
Clarify language.
tychedelia Jun 26, 2025
d62fd53
naga_oil released.
tychedelia Jun 26, 2025
dc195db
Merge branch 'main' into wgpu-25-2
tychedelia Jun 26, 2025
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
4 changes: 2 additions & 2 deletions assets/shaders/array_texture.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
}
#import bevy_core_pipeline::tonemapping::tone_mapping

@group(2) @binding(0) var my_array_texture: texture_2d_array<f32>;
@group(2) @binding(1) var my_array_texture_sampler: sampler;
@group(3) @binding(0) var my_array_texture: texture_2d_array<f32>;
@group(3) @binding(1) var my_array_texture_sampler: sampler;

@fragment
fn fragment(
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/automatic_instancing.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
view_transformations::position_world_to_clip
}

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

struct Vertex {
@builtin(instance_index) instance_index: u32,
Expand Down
10 changes: 5 additions & 5 deletions assets/shaders/bindless_material.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ struct MaterialBindings {
}

#ifdef BINDLESS
@group(2) @binding(0) var<storage> materials: array<MaterialBindings>;
@group(2) @binding(10) var<storage> material_color: binding_array<Color>;
@group(3) @binding(0) var<storage> materials: array<MaterialBindings>;
@group(3) @binding(10) var<storage> material_color: binding_array<Color>;
#else // BINDLESS
@group(2) @binding(0) var<uniform> material_color: Color;
@group(2) @binding(1) var material_color_texture: texture_2d<f32>;
@group(2) @binding(2) var material_color_sampler: sampler;
@group(3) @binding(0) var<uniform> material_color: Color;
@group(3) @binding(1) var material_color_texture: texture_2d<f32>;
@group(3) @binding(2) var material_color_sampler: sampler;
#endif // BINDLESS

@fragment
Expand Down
6 changes: 3 additions & 3 deletions assets/shaders/cubemap_unlit.wgsl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#import bevy_pbr::forward_io::VertexOutput

#ifdef CUBEMAP_ARRAY
@group(2) @binding(0) var base_color_texture: texture_cube_array<f32>;
@group(3) @binding(0) var base_color_texture: texture_cube_array<f32>;
#else
@group(2) @binding(0) var base_color_texture: texture_cube<f32>;
@group(3) @binding(0) var base_color_texture: texture_cube<f32>;
#endif

@group(2) @binding(1) var base_color_sampler: sampler;
@group(3) @binding(1) var base_color_sampler: sampler;

@fragment
fn fragment(
Expand Down
6 changes: 3 additions & 3 deletions assets/shaders/custom_material.frag
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ layout(location = 0) in vec2 v_Uv;

layout(location = 0) out vec4 o_Target;

layout(set = 2, binding = 0) uniform vec4 CustomMaterial_color;
layout(set = 3, binding = 0) uniform vec4 CustomMaterial_color;

layout(set = 2, binding = 1) uniform texture2D CustomMaterial_texture;
layout(set = 2, binding = 2) uniform sampler CustomMaterial_sampler;
layout(set = 3, binding = 1) uniform texture2D CustomMaterial_texture;
layout(set = 3, binding = 2) uniform sampler CustomMaterial_sampler;

// wgsl modules can be imported and used in glsl
// FIXME - this doesn't work any more ...
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/custom_material.vert
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ struct Mesh {
};

#ifdef PER_OBJECT_BUFFER_BATCH_SIZE
layout(set = 1, binding = 0) uniform Mesh Meshes[#{PER_OBJECT_BUFFER_BATCH_SIZE}];
layout(set = 2, binding = 0) uniform Mesh Meshes[#{PER_OBJECT_BUFFER_BATCH_SIZE}];
#else
layout(set = 1, binding = 0) readonly buffer _Meshes {
layout(set = 2, binding = 0) readonly buffer _Meshes {
Mesh Meshes[];
};
#endif // PER_OBJECT_BUFFER_BATCH_SIZE
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/custom_material.wesl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct CustomMaterial {
time: vec4<f32>,
}

@group(2) @binding(0) var<uniform> material: CustomMaterial;
@group(3) @binding(0) var<uniform> material: CustomMaterial;

@fragment
fn fragment(
Expand Down
6 changes: 3 additions & 3 deletions assets/shaders/custom_material.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// we can import items from shader modules in the assets folder with a quoted path
#import "shaders/custom_material_import.wgsl"::COLOR_MULTIPLIER

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

@fragment
fn fragment(
Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/custom_material_screenspace_texture.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
utils::coords_to_viewport_uv,
}

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

@fragment
fn fragment(
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/custom_vertex_attribute.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
struct CustomMaterial {
color: vec4<f32>,
};
@group(2) @binding(0) var<uniform> material: CustomMaterial;
@group(3) @binding(0) var<uniform> material: CustomMaterial;

struct Vertex {
@builtin(instance_index) instance_index: u32,
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/extended_material.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct MyExtendedMaterial {
quantize_steps: u32,
}

@group(2) @binding(100)
@group(3) @binding(100)
var<uniform> my_extended_material: MyExtendedMaterial;

@fragment
Expand Down
10 changes: 5 additions & 5 deletions assets/shaders/extended_material_bindless.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ struct ExampleBindlessExtendedMaterial {

// The indices of the bindless resources in the bindless resource arrays, for
// the `ExampleBindlessExtension` fields.
@group(2) @binding(100) var<storage> example_extended_material_indices:
@group(3) @binding(100) var<storage> example_extended_material_indices:
array<ExampleBindlessExtendedMaterialIndices>;
// An array that holds the `ExampleBindlessExtendedMaterial` plain old data,
// indexed by `ExampleBindlessExtendedMaterialIndices.material`.
@group(2) @binding(101) var<storage> example_extended_material:
@group(3) @binding(101) var<storage> example_extended_material:
array<ExampleBindlessExtendedMaterial>;

#else // BINDLESS

// In non-bindless mode, we simply use a uniform for the plain old data.
@group(2) @binding(50) var<uniform> example_extended_material: ExampleBindlessExtendedMaterial;
@group(2) @binding(51) var modulate_texture: texture_2d<f32>;
@group(2) @binding(52) var modulate_sampler: sampler;
@group(3) @binding(50) var<uniform> example_extended_material: ExampleBindlessExtendedMaterial;
@group(3) @binding(51) var modulate_texture: texture_2d<f32>;
@group(3) @binding(52) var modulate_sampler: sampler;

#endif // BINDLESS

Expand Down
24 changes: 12 additions & 12 deletions assets/shaders/fallback_image_test.wgsl
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#import bevy_pbr::forward_io::VertexOutput

@group(2) @binding(0) var test_texture_1d: texture_1d<f32>;
@group(2) @binding(1) var test_texture_1d_sampler: sampler;
@group(3) @binding(0) var test_texture_1d: texture_1d<f32>;
@group(3) @binding(1) var test_texture_1d_sampler: sampler;

@group(2) @binding(2) var test_texture_2d: texture_2d<f32>;
@group(2) @binding(3) var test_texture_2d_sampler: sampler;
@group(3) @binding(2) var test_texture_2d: texture_2d<f32>;
@group(3) @binding(3) var test_texture_2d_sampler: sampler;

@group(2) @binding(4) var test_texture_2d_array: texture_2d_array<f32>;
@group(2) @binding(5) var test_texture_2d_array_sampler: sampler;
@group(3) @binding(4) var test_texture_2d_array: texture_2d_array<f32>;
@group(3) @binding(5) var test_texture_2d_array_sampler: sampler;

@group(2) @binding(6) var test_texture_cube: texture_cube<f32>;
@group(2) @binding(7) var test_texture_cube_sampler: sampler;
@group(3) @binding(6) var test_texture_cube: texture_cube<f32>;
@group(3) @binding(7) var test_texture_cube_sampler: sampler;

@group(2) @binding(8) var test_texture_cube_array: texture_cube_array<f32>;
@group(2) @binding(9) var test_texture_cube_array_sampler: sampler;
@group(3) @binding(8) var test_texture_cube_array: texture_cube_array<f32>;
@group(3) @binding(9) var test_texture_cube_array_sampler: sampler;

@group(2) @binding(10) var test_texture_3d: texture_3d<f32>;
@group(2) @binding(11) var test_texture_3d_sampler: sampler;
@group(3) @binding(10) var test_texture_3d: texture_3d<f32>;
@group(3) @binding(11) var test_texture_3d_sampler: sampler;

@fragment
fn fragment(in: VertexOutput) {}
2 changes: 1 addition & 1 deletion assets/shaders/irradiance_volume_voxel_visualization.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct VoxelVisualizationIrradianceVolumeInfo {
intensity: f32,
}

@group(2) @binding(100)
@group(3) @binding(100)
var<uniform> irradiance_volume_info: VoxelVisualizationIrradianceVolumeInfo;

@fragment
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/line_material.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct LineMaterial {
color: vec4<f32>,
};

@group(2) @binding(0) var<uniform> material: LineMaterial;
@group(3) @binding(0) var<uniform> material: LineMaterial;

@fragment
fn fragment(
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/shader_defs.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct CustomMaterial {
color: vec4<f32>,
};

@group(2) @binding(0) var<uniform> material: CustomMaterial;
@group(3) @binding(0) var<uniform> material: CustomMaterial;

@fragment
fn fragment(
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/show_prepass.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct ShowPrepassSettings {
padding_1: u32,
padding_2: u32,
}
@group(2) @binding(0) var<uniform> settings: ShowPrepassSettings;
@group(3) @binding(0) var<uniform> settings: ShowPrepassSettings;

@fragment
fn fragment(
Expand Down
2 changes: 1 addition & 1 deletion assets/shaders/storage_buffer.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
view_transformations::position_world_to_clip
}

@group(2) @binding(0) var<storage, read> colors: array<vec4<f32>, 5>;
@group(3) @binding(0) var<storage, read> colors: array<vec4<f32>, 5>;

struct Vertex {
@builtin(instance_index) instance_index: u32,
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,7 +1,7 @@
#import bevy_pbr::forward_io::VertexOutput

@group(2) @binding(0) var textures: binding_array<texture_2d<f32>>;
@group(2) @binding(1) var nearest_sampler: sampler;
@group(3) @binding(0) var textures: binding_array<texture_2d<f32>>;
@group(3) @binding(1) var nearest_sampler: sampler;
// We can also have array of samplers
// var samplers: binding_array<sampler>;

Expand Down
6 changes: 3 additions & 3 deletions assets/shaders/water_material.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ struct WaterSettings {

@group(0) @binding(1) var<uniform> globals: Globals;

@group(2) @binding(100) var water_normals_texture: texture_2d<f32>;
@group(2) @binding(101) var water_normals_sampler: sampler;
@group(2) @binding(102) var<uniform> water_settings: WaterSettings;
@group(3) @binding(100) var water_normals_texture: texture_2d<f32>;
@group(3) @binding(101) var water_normals_sampler: sampler;
@group(3) @binding(102) var<uniform> water_settings: WaterSettings;

// Samples a single octave of noise and returns the resulting normal.
fn sample_noise_octave(uv: vec2<f32>, strength: f32) -> vec3<f32> {
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 = "24", default-features = false, optional = true }
wgpu-types = { version = "25", default-features = false, optional = true }
encase = { version = "0.10", default-features = false, optional = true }

[features]
Expand Down
6 changes: 2 additions & 4 deletions crates/bevy_gizmos/src/pipeline_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ impl SpecializedRenderPipeline for LineGizmoPipeline {
.mesh_pipeline
.get_view_layout(key.view_key.into())
.clone();

let layout = vec![view_layout, self.uniform_layout.clone()];
let layout = vec![view_layout.main_layout.clone(), self.uniform_layout.clone()];

let fragment_entry_point = match key.line_style {
GizmoLineStyle::Solid => "fragment_solid",
Expand Down Expand Up @@ -220,8 +219,7 @@ impl SpecializedRenderPipeline for LineJointGizmoPipeline {
.mesh_pipeline
.get_view_layout(key.view_key.into())
.clone();

let layout = vec![view_layout, self.uniform_layout.clone()];
let layout = vec![view_layout.main_layout.clone(), self.uniform_layout.clone()];

if key.joints == GizmoLineJoint::None {
error!("There is no entry point for line joints with GizmoLineJoints::None. Please consider aborting the drawing process before reaching this stage.");
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 @@ -63,7 +63,7 @@ image = { version = "0.25.2", default-features = false }
# misc
bitflags = { version = "2.3", features = ["serde"] }
bytemuck = { version = "1.5" }
wgpu-types = { version = "24", default-features = false }
wgpu-types = { version = "25", 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 @@ -27,7 +27,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 = "24", default-features = false }
wgpu-types = { version = "25", default-features = false }
serde = { version = "1", default-features = false, features = [
"derive",
], optional = true }
Expand Down
8 changes: 6 additions & 2 deletions crates/bevy_pbr/src/atmosphere/render_sky.wgsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
enable dual_source_blending;

#import bevy_pbr::atmosphere::{
types::{Atmosphere, AtmosphereSettings},
bindings::{atmosphere, view, atmosphere_transforms},
Expand All @@ -19,9 +21,11 @@
#endif

struct RenderSkyOutput {
@location(0) inscattering: vec4<f32>,
#ifdef DUAL_SOURCE_BLENDING
@location(0) @second_blend_source transmittance: vec4<f32>,
@location(0) @blend_src(0) inscattering: vec4<f32>,
@location(0) @blend_src(1) transmittance: vec4<f32>,
#else
@location(0) inscattering: vec4<f32>,
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/decal/forward_decal.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
#import bevy_render::maths::project_onto

@group(2) @binding(200)
@group(3) @binding(200)
var<uniform> inv_depth_fade_factor: f32;

struct ForwardDecalInformation {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/deferred/deferred_lighting.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct PbrDeferredLightingDepthId {
_webgl2_padding_2: f32,
#endif
}
@group(1) @binding(0)
@group(2) @binding(0)
var<uniform> depth_id: PbrDeferredLightingDepthId;

@vertex
Expand Down
Loading