Remove unused push constants (#13076)

The shader code was removed in #11280, but we never cleaned up the rust
code.
This commit is contained in:
JMS55 2024-04-23 14:43:46 -07:00 committed by GitHub
parent 30b0931c8a
commit 17633c1f75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 66 deletions

View file

@ -534,18 +534,6 @@ where
PREPASS_SHADER_HANDLE 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 { let mut descriptor = RenderPipelineDescriptor {
vertex: VertexState { vertex: VertexState {
shader: vert_shader_handle, shader: vert_shader_handle,
@ -585,7 +573,7 @@ where
mask: !0, mask: !0,
alpha_to_coverage_enabled: false, alpha_to_coverage_enabled: false,
}, },
push_constant_ranges, push_constant_ranges: vec![],
label: Some("prepass_pipeline".into()), label: Some("prepass_pipeline".into()),
}; };

View file

@ -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 { Ok(RenderPipelineDescriptor {
vertex: VertexState { vertex: VertexState {
shader: MESH_SHADER_HANDLE, shader: MESH_SHADER_HANDLE,
@ -1497,7 +1485,7 @@ impl SpecializedMeshPipeline for MeshPipeline {
})], })],
}), }),
layout: bind_group_layout, layout: bind_group_layout,
push_constant_ranges, push_constant_ranges: vec![],
primitive: PrimitiveState { primitive: PrimitiveState {
front_face: FrontFace::Ccw, front_face: FrontFace::Ccw,
cull_mode: Some(Face::Back), cull_mode: Some(Face::Back),
@ -1794,12 +1782,6 @@ impl<P: PhaseItem> RenderCommand<P> for DrawMesh {
pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..)); pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..));
let batch_range = item.batch_range(); 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 { match &gpu_mesh.buffer_info {
GpuBufferInfo::Indexed { GpuBufferInfo::Indexed {
buffer, buffer,

View file

@ -517,17 +517,6 @@ impl SpecializedMeshPipeline for Mesh2dPipeline {
true => ViewTarget::TEXTURE_FORMAT_HDR, true => ViewTarget::TEXTURE_FORMAT_HDR,
false => TextureFormat::bevy_default(), 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 { Ok(RenderPipelineDescriptor {
vertex: VertexState { vertex: VertexState {
@ -547,7 +536,7 @@ impl SpecializedMeshPipeline for Mesh2dPipeline {
})], })],
}), }),
layout: vec![self.view_layout.clone(), self.mesh_layout.clone()], layout: vec![self.view_layout.clone(), self.mesh_layout.clone()],
push_constant_ranges, push_constant_ranges: vec![],
primitive: PrimitiveState { primitive: PrimitiveState {
front_face: FrontFace::Ccw, front_face: FrontFace::Ccw,
cull_mode: None, cull_mode: None,
@ -699,12 +688,6 @@ impl<P: PhaseItem> RenderCommand<P> for DrawMesh2d {
pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..)); pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..));
let batch_range = item.batch_range(); 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 { match &gpu_mesh.buffer_info {
GpuBufferInfo::Indexed { GpuBufferInfo::Indexed {
buffer, buffer,

View file

@ -17,9 +17,8 @@ use bevy::{
render_resource::{ render_resource::{
BlendState, ColorTargetState, ColorWrites, Face, FragmentState, FrontFace, BlendState, ColorTargetState, ColorWrites, Face, FragmentState, FrontFace,
MultisampleState, PipelineCache, PolygonMode, PrimitiveState, PrimitiveTopology, MultisampleState, PipelineCache, PolygonMode, PrimitiveState, PrimitiveTopology,
PushConstantRange, RenderPipelineDescriptor, ShaderStages, SpecializedRenderPipeline, RenderPipelineDescriptor, SpecializedRenderPipeline, SpecializedRenderPipelines,
SpecializedRenderPipelines, TextureFormat, VertexBufferLayout, VertexFormat, TextureFormat, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode,
VertexState, VertexStepMode,
}, },
texture::BevyDefault, texture::BevyDefault,
view::{ExtractedView, ViewTarget, VisibleEntities}, view::{ExtractedView, ViewTarget, VisibleEntities},
@ -158,18 +157,6 @@ impl SpecializedRenderPipeline for ColoredMesh2dPipeline {
false => TextureFormat::bevy_default(), 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 { RenderPipelineDescriptor {
vertex: VertexState { vertex: VertexState {
// Use our custom shader // Use our custom shader
@ -197,7 +184,7 @@ impl SpecializedRenderPipeline for ColoredMesh2dPipeline {
// Bind group 1 is the mesh uniform // Bind group 1 is the mesh uniform
self.mesh2d_pipeline.mesh_layout.clone(), self.mesh2d_pipeline.mesh_layout.clone(),
], ],
push_constant_ranges, push_constant_ranges: vec![],
primitive: PrimitiveState { primitive: PrimitiveState {
front_face: FrontFace::Ccw, front_face: FrontFace::Ccw,
cull_mode: Some(Face::Back), cull_mode: Some(Face::Back),