diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 682935c504..18b7eeeb3a 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -534,18 +534,6 @@ where PREPASS_SHADER_HANDLE }; - let mut push_constant_ranges = Vec::with_capacity(1); - if cfg!(all( - feature = "webgl", - target_arch = "wasm32", - not(feature = "webgpu") - )) { - push_constant_ranges.push(PushConstantRange { - stages: ShaderStages::VERTEX, - range: 0..4, - }); - } - let mut descriptor = RenderPipelineDescriptor { vertex: VertexState { shader: vert_shader_handle, @@ -585,7 +573,7 @@ where mask: !0, alpha_to_coverage_enabled: false, }, - push_constant_ranges, + push_constant_ranges: vec![], label: Some("prepass_pipeline".into()), }; diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 959c77ed68..1fd8319f4b 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -1467,18 +1467,6 @@ impl SpecializedMeshPipeline for MeshPipeline { )); } - let mut push_constant_ranges = Vec::with_capacity(1); - if cfg!(all( - feature = "webgl", - target_arch = "wasm32", - not(feature = "webgpu") - )) { - push_constant_ranges.push(PushConstantRange { - stages: ShaderStages::VERTEX, - range: 0..4, - }); - } - Ok(RenderPipelineDescriptor { vertex: VertexState { shader: MESH_SHADER_HANDLE, @@ -1497,7 +1485,7 @@ impl SpecializedMeshPipeline for MeshPipeline { })], }), layout: bind_group_layout, - push_constant_ranges, + push_constant_ranges: vec![], primitive: PrimitiveState { front_face: FrontFace::Ccw, cull_mode: Some(Face::Back), @@ -1794,12 +1782,6 @@ impl RenderCommand

for DrawMesh { pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..)); let batch_range = item.batch_range(); - #[cfg(all(feature = "webgl", target_arch = "wasm32", not(feature = "webgpu")))] - pass.set_push_constants( - ShaderStages::VERTEX, - 0, - &(batch_range.start as i32).to_le_bytes(), - ); match &gpu_mesh.buffer_info { GpuBufferInfo::Indexed { buffer, diff --git a/crates/bevy_sprite/src/mesh2d/mesh.rs b/crates/bevy_sprite/src/mesh2d/mesh.rs index 7a26b46972..90a67f7517 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh.rs +++ b/crates/bevy_sprite/src/mesh2d/mesh.rs @@ -517,17 +517,6 @@ impl SpecializedMeshPipeline for Mesh2dPipeline { true => ViewTarget::TEXTURE_FORMAT_HDR, false => TextureFormat::bevy_default(), }; - let mut push_constant_ranges = Vec::with_capacity(1); - if cfg!(all( - feature = "webgl", - target_arch = "wasm32", - not(feature = "webgpu") - )) { - push_constant_ranges.push(PushConstantRange { - stages: ShaderStages::VERTEX, - range: 0..4, - }); - } Ok(RenderPipelineDescriptor { vertex: VertexState { @@ -547,7 +536,7 @@ impl SpecializedMeshPipeline for Mesh2dPipeline { })], }), layout: vec![self.view_layout.clone(), self.mesh_layout.clone()], - push_constant_ranges, + push_constant_ranges: vec![], primitive: PrimitiveState { front_face: FrontFace::Ccw, cull_mode: None, @@ -699,12 +688,6 @@ impl RenderCommand

for DrawMesh2d { pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..)); let batch_range = item.batch_range(); - #[cfg(all(feature = "webgl", target_arch = "wasm32", not(feature = "webgpu")))] - pass.set_push_constants( - ShaderStages::VERTEX, - 0, - &(batch_range.start as i32).to_le_bytes(), - ); match &gpu_mesh.buffer_info { GpuBufferInfo::Indexed { buffer, diff --git a/examples/2d/mesh2d_manual.rs b/examples/2d/mesh2d_manual.rs index 82d6575325..b99c23a9c9 100644 --- a/examples/2d/mesh2d_manual.rs +++ b/examples/2d/mesh2d_manual.rs @@ -17,9 +17,8 @@ use bevy::{ render_resource::{ BlendState, ColorTargetState, ColorWrites, Face, FragmentState, FrontFace, MultisampleState, PipelineCache, PolygonMode, PrimitiveState, PrimitiveTopology, - PushConstantRange, RenderPipelineDescriptor, ShaderStages, SpecializedRenderPipeline, - SpecializedRenderPipelines, TextureFormat, VertexBufferLayout, VertexFormat, - VertexState, VertexStepMode, + RenderPipelineDescriptor, SpecializedRenderPipeline, SpecializedRenderPipelines, + TextureFormat, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode, }, texture::BevyDefault, view::{ExtractedView, ViewTarget, VisibleEntities}, @@ -158,18 +157,6 @@ impl SpecializedRenderPipeline for ColoredMesh2dPipeline { false => TextureFormat::bevy_default(), }; - let mut push_constant_ranges = Vec::with_capacity(1); - if cfg!(all( - feature = "webgl2", - target_arch = "wasm32", - not(feature = "webgpu") - )) { - push_constant_ranges.push(PushConstantRange { - stages: ShaderStages::VERTEX, - range: 0..4, - }); - } - RenderPipelineDescriptor { vertex: VertexState { // Use our custom shader @@ -197,7 +184,7 @@ impl SpecializedRenderPipeline for ColoredMesh2dPipeline { // Bind group 1 is the mesh uniform self.mesh2d_pipeline.mesh_layout.clone(), ], - push_constant_ranges, + push_constant_ranges: vec![], primitive: PrimitiveState { front_face: FrontFace::Ccw, cull_mode: Some(Face::Back),