Misc cleanup (#11134)
Re-exports a few types/functions I need that have no reason to be private, and some minor code quality changes.
This commit is contained in:
parent
786abbf3f5
commit
3d3a065820
@ -4,7 +4,7 @@ use crate::{
|
|||||||
prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass},
|
prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass},
|
||||||
skybox::{SkyboxBindGroup, SkyboxPipelineId},
|
skybox::{SkyboxBindGroup, SkyboxPipelineId},
|
||||||
};
|
};
|
||||||
use bevy_ecs::{prelude::*, query::QueryItem};
|
use bevy_ecs::{prelude::World, query::QueryItem};
|
||||||
use bevy_render::{
|
use bevy_render::{
|
||||||
camera::ExtractedCamera,
|
camera::ExtractedCamera,
|
||||||
render_graph::{NodeRunError, RenderGraphContext, ViewNode},
|
render_graph::{NodeRunError, RenderGraphContext, ViewNode},
|
||||||
|
|||||||
@ -418,7 +418,7 @@ pub fn prepare_deferred_lighting_pipelines(
|
|||||||
Option<&DebandDither>,
|
Option<&DebandDither>,
|
||||||
Option<&EnvironmentMapLight>,
|
Option<&EnvironmentMapLight>,
|
||||||
Option<&ShadowFilteringMethod>,
|
Option<&ShadowFilteringMethod>,
|
||||||
Option<&ScreenSpaceAmbientOcclusionSettings>,
|
Has<ScreenSpaceAmbientOcclusionSettings>,
|
||||||
(
|
(
|
||||||
Has<NormalPrepass>,
|
Has<NormalPrepass>,
|
||||||
Has<DepthPrepass>,
|
Has<DepthPrepass>,
|
||||||
@ -480,7 +480,7 @@ pub fn prepare_deferred_lighting_pipelines(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ssao.is_some() {
|
if ssao {
|
||||||
view_key |= MeshPipelineKey::SCREEN_SPACE_AMBIENT_OCCLUSION;
|
view_key |= MeshPipelineKey::SCREEN_SPACE_AMBIENT_OCCLUSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ use bevy_render::{
|
|||||||
renderer::RenderDevice,
|
renderer::RenderDevice,
|
||||||
view::{InheritedVisibility, RenderLayers, ViewVisibility, VisibleEntities},
|
view::{InheritedVisibility, RenderLayers, ViewVisibility, VisibleEntities},
|
||||||
};
|
};
|
||||||
use bevy_transform::{components::GlobalTransform, prelude::Transform};
|
use bevy_transform::components::{GlobalTransform, Transform};
|
||||||
use bevy_utils::{tracing::warn, HashMap};
|
use bevy_utils::{tracing::warn, HashMap};
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|||||||
@ -416,7 +416,7 @@ const fn alpha_mode_pipeline_key(alpha_mode: AlphaMode) -> MeshPipelineKey {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn tonemapping_pipeline_key(tonemapping: Tonemapping) -> MeshPipelineKey {
|
pub const fn tonemapping_pipeline_key(tonemapping: Tonemapping) -> MeshPipelineKey {
|
||||||
match tonemapping {
|
match tonemapping {
|
||||||
Tonemapping::None => MeshPipelineKey::TONEMAP_METHOD_NONE,
|
Tonemapping::None => MeshPipelineKey::TONEMAP_METHOD_NONE,
|
||||||
Tonemapping::Reinhard => MeshPipelineKey::TONEMAP_METHOD_REINHARD,
|
Tonemapping::Reinhard => MeshPipelineKey::TONEMAP_METHOD_REINHARD,
|
||||||
@ -431,7 +431,7 @@ const fn tonemapping_pipeline_key(tonemapping: Tonemapping) -> MeshPipelineKey {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn screen_space_specular_transmission_pipeline_key(
|
pub const fn screen_space_specular_transmission_pipeline_key(
|
||||||
screen_space_transmissive_blur_quality: ScreenSpaceTransmissionQuality,
|
screen_space_transmissive_blur_quality: ScreenSpaceTransmissionQuality,
|
||||||
) -> MeshPipelineKey {
|
) -> MeshPipelineKey {
|
||||||
match screen_space_transmissive_blur_quality {
|
match screen_space_transmissive_blur_quality {
|
||||||
@ -472,7 +472,7 @@ pub fn queue_material_meshes<M: Material>(
|
|||||||
Option<&DebandDither>,
|
Option<&DebandDither>,
|
||||||
Option<&EnvironmentMapLight>,
|
Option<&EnvironmentMapLight>,
|
||||||
Option<&ShadowFilteringMethod>,
|
Option<&ShadowFilteringMethod>,
|
||||||
Option<&ScreenSpaceAmbientOcclusionSettings>,
|
Has<ScreenSpaceAmbientOcclusionSettings>,
|
||||||
(
|
(
|
||||||
Has<NormalPrepass>,
|
Has<NormalPrepass>,
|
||||||
Has<DepthPrepass>,
|
Has<DepthPrepass>,
|
||||||
@ -480,7 +480,7 @@ pub fn queue_material_meshes<M: Material>(
|
|||||||
Has<DeferredPrepass>,
|
Has<DeferredPrepass>,
|
||||||
),
|
),
|
||||||
Option<&Camera3d>,
|
Option<&Camera3d>,
|
||||||
Option<&TemporalJitter>,
|
Has<TemporalJitter>,
|
||||||
Option<&Projection>,
|
Option<&Projection>,
|
||||||
&mut RenderPhase<Opaque3d>,
|
&mut RenderPhase<Opaque3d>,
|
||||||
&mut RenderPhase<AlphaMask3d>,
|
&mut RenderPhase<AlphaMask3d>,
|
||||||
@ -532,7 +532,7 @@ pub fn queue_material_meshes<M: Material>(
|
|||||||
view_key |= MeshPipelineKey::DEFERRED_PREPASS;
|
view_key |= MeshPipelineKey::DEFERRED_PREPASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if temporal_jitter.is_some() {
|
if temporal_jitter {
|
||||||
view_key |= MeshPipelineKey::TEMPORAL_JITTER;
|
view_key |= MeshPipelineKey::TEMPORAL_JITTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,7 +570,7 @@ pub fn queue_material_meshes<M: Material>(
|
|||||||
view_key |= MeshPipelineKey::DEBAND_DITHER;
|
view_key |= MeshPipelineKey::DEBAND_DITHER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ssao.is_some() {
|
if ssao {
|
||||||
view_key |= MeshPipelineKey::SCREEN_SPACE_AMBIENT_OCCLUSION;
|
view_key |= MeshPipelineKey::SCREEN_SPACE_AMBIENT_OCCLUSION;
|
||||||
}
|
}
|
||||||
if let Some(camera_3d) = camera_3d {
|
if let Some(camera_3d) = camera_3d {
|
||||||
|
|||||||
@ -272,9 +272,9 @@ pub fn extract_meshes(
|
|||||||
transform,
|
transform,
|
||||||
previous_transform,
|
previous_transform,
|
||||||
handle,
|
handle,
|
||||||
not_receiver,
|
not_shadow_receiver,
|
||||||
transmitted_receiver,
|
transmitted_receiver,
|
||||||
not_caster,
|
not_shadow_caster,
|
||||||
no_automatic_batching,
|
no_automatic_batching,
|
||||||
)| {
|
)| {
|
||||||
if !view_visibility.get() {
|
if !view_visibility.get() {
|
||||||
@ -282,7 +282,7 @@ pub fn extract_meshes(
|
|||||||
}
|
}
|
||||||
let transform = transform.affine();
|
let transform = transform.affine();
|
||||||
let previous_transform = previous_transform.map(|t| t.0).unwrap_or(transform);
|
let previous_transform = previous_transform.map(|t| t.0).unwrap_or(transform);
|
||||||
let mut flags = if not_receiver {
|
let mut flags = if not_shadow_receiver {
|
||||||
MeshFlags::empty()
|
MeshFlags::empty()
|
||||||
} else {
|
} else {
|
||||||
MeshFlags::SHADOW_RECEIVER
|
MeshFlags::SHADOW_RECEIVER
|
||||||
@ -305,7 +305,7 @@ pub fn extract_meshes(
|
|||||||
RenderMeshInstance {
|
RenderMeshInstance {
|
||||||
mesh_asset_id: handle.id(),
|
mesh_asset_id: handle.id(),
|
||||||
transforms,
|
transforms,
|
||||||
shadow_caster: !not_caster,
|
shadow_caster: !not_shadow_caster,
|
||||||
material_bind_group_id: MaterialBindGroupId::default(),
|
material_bind_group_id: MaterialBindGroupId::default(),
|
||||||
automatic_batching: !no_automatic_batching,
|
automatic_batching: !no_automatic_batching,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use bevy_core_pipeline::{
|
|||||||
};
|
};
|
||||||
use bevy_ecs::{
|
use bevy_ecs::{
|
||||||
prelude::{Bundle, Component, Entity},
|
prelude::{Bundle, Component, Entity},
|
||||||
query::{QueryItem, With},
|
query::{Has, QueryItem, With},
|
||||||
reflect::ReflectComponent,
|
reflect::ReflectComponent,
|
||||||
schedule::IntoSystemConfigs,
|
schedule::IntoSystemConfigs,
|
||||||
system::{Commands, Query, Res, ResMut, Resource},
|
system::{Commands, Query, Res, ResMut, Resource},
|
||||||
@ -612,7 +612,7 @@ fn prepare_ssao_pipelines(
|
|||||||
views: Query<(
|
views: Query<(
|
||||||
Entity,
|
Entity,
|
||||||
&ScreenSpaceAmbientOcclusionSettings,
|
&ScreenSpaceAmbientOcclusionSettings,
|
||||||
Option<&TemporalJitter>,
|
Has<TemporalJitter>,
|
||||||
)>,
|
)>,
|
||||||
) {
|
) {
|
||||||
for (entity, ssao_settings, temporal_jitter) in &views {
|
for (entity, ssao_settings, temporal_jitter) in &views {
|
||||||
@ -621,7 +621,7 @@ fn prepare_ssao_pipelines(
|
|||||||
&pipeline,
|
&pipeline,
|
||||||
SsaoPipelineKey {
|
SsaoPipelineKey {
|
||||||
ssao_settings: ssao_settings.clone(),
|
ssao_settings: ssao_settings.clone(),
|
||||||
temporal_jitter: temporal_jitter.is_some(),
|
temporal_jitter,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -32,23 +32,24 @@ pub use uniform_buffer::*;
|
|||||||
|
|
||||||
// TODO: decide where re-exports should go
|
// TODO: decide where re-exports should go
|
||||||
pub use wgpu::{
|
pub use wgpu::{
|
||||||
util::BufferInitDescriptor, AdapterInfo as WgpuAdapterInfo, AddressMode, BindGroupDescriptor,
|
util::{BufferInitDescriptor, DrawIndexedIndirect},
|
||||||
BindGroupEntry, BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingResource, BindingType,
|
AdapterInfo as WgpuAdapterInfo, AddressMode, BindGroupDescriptor, BindGroupEntry,
|
||||||
BlendComponent, BlendFactor, BlendOperation, BlendState, BufferAddress, BufferAsyncError,
|
BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingResource, BindingType, BlendComponent,
|
||||||
BufferBinding, BufferBindingType, BufferDescriptor, BufferSize, BufferUsages, ColorTargetState,
|
BlendFactor, BlendOperation, BlendState, BufferAddress, BufferAsyncError, BufferBinding,
|
||||||
ColorWrites, CommandEncoder, CommandEncoderDescriptor, CompareFunction, ComputePass,
|
BufferBindingType, BufferDescriptor, BufferSize, BufferUsages, ColorTargetState, ColorWrites,
|
||||||
ComputePassDescriptor, ComputePipelineDescriptor as RawComputePipelineDescriptor,
|
CommandEncoder, CommandEncoderDescriptor, CompareFunction, ComputePass, ComputePassDescriptor,
|
||||||
DepthBiasState, DepthStencilState, Extent3d, Face, Features as WgpuFeatures, FilterMode,
|
ComputePipelineDescriptor as RawComputePipelineDescriptor, DepthBiasState, DepthStencilState,
|
||||||
FragmentState as RawFragmentState, FrontFace, ImageCopyBuffer, ImageCopyBufferBase,
|
Extent3d, Face, Features as WgpuFeatures, FilterMode, FragmentState as RawFragmentState,
|
||||||
ImageCopyTexture, ImageCopyTextureBase, ImageDataLayout, ImageSubresourceRange, IndexFormat,
|
FrontFace, ImageCopyBuffer, ImageCopyBufferBase, ImageCopyTexture, ImageCopyTextureBase,
|
||||||
Limits as WgpuLimits, LoadOp, Maintain, MapMode, MultisampleState, Operations, Origin3d,
|
ImageDataLayout, ImageSubresourceRange, IndexFormat, Limits as WgpuLimits, LoadOp, Maintain,
|
||||||
PipelineLayout, PipelineLayoutDescriptor, PolygonMode, PrimitiveState, PrimitiveTopology,
|
MapMode, MultisampleState, Operations, Origin3d, PipelineLayout, PipelineLayoutDescriptor,
|
||||||
PushConstantRange, RenderPassColorAttachment, RenderPassDepthStencilAttachment,
|
PolygonMode, PrimitiveState, PrimitiveTopology, PushConstantRange, RenderPassColorAttachment,
|
||||||
RenderPassDescriptor, RenderPipelineDescriptor as RawRenderPipelineDescriptor,
|
RenderPassDepthStencilAttachment, RenderPassDescriptor,
|
||||||
SamplerBindingType, SamplerDescriptor, ShaderModule, ShaderModuleDescriptor, ShaderSource,
|
RenderPipelineDescriptor as RawRenderPipelineDescriptor, SamplerBindingType, SamplerDescriptor,
|
||||||
ShaderStages, StencilFaceState, StencilOperation, StencilState, StorageTextureAccess, StoreOp,
|
ShaderModule, ShaderModuleDescriptor, ShaderSource, ShaderStages, StencilFaceState,
|
||||||
TextureAspect, TextureDescriptor, TextureDimension, TextureFormat, TextureSampleType,
|
StencilOperation, StencilState, StorageTextureAccess, StoreOp, TextureAspect,
|
||||||
TextureUsages, TextureViewDescriptor, TextureViewDimension, VertexAttribute,
|
TextureDescriptor, TextureDimension, TextureFormat, TextureSampleType, TextureUsages,
|
||||||
|
TextureViewDescriptor, TextureViewDimension, VertexAttribute,
|
||||||
VertexBufferLayout as RawVertexBufferLayout, VertexFormat, VertexState as RawVertexState,
|
VertexBufferLayout as RawVertexBufferLayout, VertexFormat, VertexState as RawVertexState,
|
||||||
VertexStepMode,
|
VertexStepMode,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user