Skip to content

Commit

Permalink
update sample count so we don't invalidate every frame
Browse files Browse the repository at this point in the history
  • Loading branch information
schell committed Oct 25, 2024
1 parent c303bb6 commit 8d273b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/renderling/src/cull/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,15 +679,16 @@ impl ComputeDepthPyramid {
&mut self,
device: &wgpu::Device,
queue: &wgpu::Queue,
// slab_buffer: &wgpu::Buffer,
// indirect_draw_buffer: &wgpu::Buffer,
// indirect_draw_count: u32,
depth_texture: &Texture,
) -> Result<(), CullingError> {
let sample_count = depth_texture.texture.sample_count();
if sample_count != self.sample_count {
log::warn!("sample_count changed, invalidating");
log::warn!(
"sample_count changed from {} to {sample_count}, invalidating",
self.sample_count
);
self.compute_copy_depth.invalidate();
self.sample_count = sample_count;
}

let extent = depth_texture.texture.size();
Expand Down Expand Up @@ -729,8 +730,7 @@ mod test {
math::hex_to_vec4, prelude::*,
};
use crabslab::GrowableSlab;
use glam::{Mat4, Quat, UVec2, UVec3, UVec4, Vec2, Vec3, Vec4};
use image::GenericImageView;
use glam::{Mat4, Quat, UVec2, UVec3, Vec2, Vec3, Vec4};

#[test]
fn occlusion_culling_sanity() {
Expand Down

0 comments on commit 8d273b0

Please sign in to comment.