mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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:
parent
30b0931c8a
commit
17633c1f75
4 changed files with 6 additions and 66 deletions
|
@ -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()),
|
||||
};
|
||||
|
||||
|
|
|
@ -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<P: PhaseItem> RenderCommand<P> 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,
|
||||
|
|
|
@ -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<P: PhaseItem> RenderCommand<P> 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,
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue