Skip to content

Commit

Permalink
remove DeterministicRenderingConfig (#12811)
Browse files Browse the repository at this point in the history
# Objective

- Since #12453, `DeterministicRenderingConfig` doesn't do anything

## Solution

- Remove it

---

## Migration Guide

- Removed `DeterministicRenderingConfig`. There shouldn't be any z
fighting anymore in the rendering even without setting
`stable_sort_z_fighting`
  • Loading branch information
mockersf committed Apr 1, 2024
1 parent 9084526 commit 93fd02e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 129 deletions.
11 changes: 0 additions & 11 deletions Cargo.toml
Expand Up @@ -673,17 +673,6 @@ description = "Showcases different blend modes"
category = "3D Rendering"
wasm = true

[[example]]
name = "deterministic"
path = "examples/3d/deterministic.rs"
doc-scrape-examples = true

[package.metadata.example.deterministic]
name = "Deterministic rendering"
description = "Stop flickering from z-fighting at a performance cost"
category = "3D Rendering"
wasm = true

[[example]]
name = "lighting"
path = "examples/3d/lighting.rs"
Expand Down
14 changes: 0 additions & 14 deletions crates/bevy_render/src/deterministic.rs

This file was deleted.

4 changes: 0 additions & 4 deletions crates/bevy_render/src/lib.rs
Expand Up @@ -15,7 +15,6 @@ extern crate core;
pub mod alpha;
pub mod batching;
pub mod camera;
pub mod deterministic;
pub mod diagnostic;
pub mod extract_component;
pub mod extract_instances;
Expand Down Expand Up @@ -62,7 +61,6 @@ use bevy_window::{PrimaryWindow, RawHandleWrapper};
use globals::GlobalsPlugin;
use renderer::{RenderAdapter, RenderAdapterInfo, RenderDevice, RenderQueue};

use crate::deterministic::DeterministicRenderingConfig;
use crate::renderer::WgpuWrapper;
use crate::{
camera::CameraPlugin,
Expand Down Expand Up @@ -238,8 +236,6 @@ pub const MATHS_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(106653563
impl Plugin for RenderPlugin {
/// Initializes the renderer, sets up the [`RenderSet`] and creates the rendering sub-app.
fn build(&self, app: &mut App) {
app.init_resource::<DeterministicRenderingConfig>();

app.init_asset::<Shader>()
.init_asset_loader::<ShaderLoader>();

Expand Down
7 changes: 0 additions & 7 deletions crates/bevy_render/src/view/visibility/mod.rs
Expand Up @@ -11,7 +11,6 @@ use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_transform::{components::GlobalTransform, TransformSystem};
use bevy_utils::Parallel;

use crate::deterministic::DeterministicRenderingConfig;
use crate::{
camera::{
camera_system, Camera, CameraProjection, OrthographicProjection, PerspectiveProjection,
Expand Down Expand Up @@ -387,7 +386,6 @@ pub fn check_visibility(
&GlobalTransform,
Has<NoFrustumCulling>,
)>,
deterministic_rendering_config: Res<DeterministicRenderingConfig>,
) {
for (mut visible_entities, frustum, maybe_view_mask, camera) in &mut view_query {
if !camera.is_active {
Expand Down Expand Up @@ -446,11 +444,6 @@ pub fn check_visibility(

visible_entities.entities.clear();
thread_queues.drain_into(&mut visible_entities.entities);
if deterministic_rendering_config.stable_sort_z_fighting {
// We can use the faster unstable sort here because
// the values (`Entity`) are guaranteed to be unique.
visible_entities.entities.sort_unstable();
}
}
}

Expand Down
92 changes: 0 additions & 92 deletions examples/3d/deterministic.rs

This file was deleted.

1 change: 0 additions & 1 deletion examples/README.md
Expand Up @@ -129,7 +129,6 @@ Example | Description
[Atmospheric Fog](../examples/3d/atmospheric_fog.rs) | A scene showcasing the atmospheric fog effect
[Blend Modes](../examples/3d/blend_modes.rs) | Showcases different blend modes
[Deferred Rendering](../examples/3d/deferred_rendering.rs) | Renders meshes with both forward and deferred pipelines
[Deterministic rendering](../examples/3d/deterministic.rs) | Stop flickering from z-fighting at a performance cost
[Fog](../examples/3d/fog.rs) | A scene showcasing the distance fog effect
[Generate Custom Mesh](../examples/3d/generate_custom_mesh.rs) | Simple showcase of how to generate a custom mesh with a custom texture
[Irradiance Volumes](../examples/3d/irradiance_volumes.rs) | Demonstrates irradiance volumes
Expand Down

0 comments on commit 93fd02e

Please sign in to comment.