Skip to content

Commit

Permalink
use StatelessTracker for acceleration structures
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Nov 15, 2024
1 parent 5a2875e commit 93c9d01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 85 deletions.
8 changes: 4 additions & 4 deletions wgpu-core/src/command/ray_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl Global {
};

let tlas = hub.tlas_s.get(entry.tlas_id).get()?;
cmd_buf_data.trackers.tlas_s.set_single(tlas.clone());
cmd_buf_data.trackers.tlas_s.insert_single(tlas.clone());

cmd_buf_data.tlas_actions.push(TlasAction {
tlas: tlas.clone(),
Expand Down Expand Up @@ -483,7 +483,7 @@ impl Global {
for package in tlas_iter {
let tlas = hub.tlas_s.get(package.tlas_id).get()?;

cmd_buf_data.trackers.tlas_s.set_single(tlas.clone());
cmd_buf_data.trackers.tlas_s.insert_single(tlas.clone());

tlas_lock_store.push((Some(package), tlas))
}
Expand Down Expand Up @@ -514,7 +514,7 @@ impl Global {
}
let blas = hub.blas_s.get(instance.blas_id).get()?;

cmd_buf_data.trackers.blas_s.set_single(blas.clone());
cmd_buf_data.trackers.blas_s.insert_single(blas.clone());

instance_buffer_staging_source.extend(tlas_instance_into_bytes(
&instance,
Expand Down Expand Up @@ -795,7 +795,7 @@ fn iter_blas<'a>(
let mut temp_buffer = Vec::new();
for entry in blas_iter {
let blas = hub.blas_s.get(entry.blas_id).get()?;
cmd_buf_data.trackers.blas_s.set_single(blas.clone());
cmd_buf_data.trackers.blas_s.insert_single(blas.clone());

cmd_buf_data.blas_actions.push(BlasAction {
blas: blas.clone(),
Expand Down
10 changes: 4 additions & 6 deletions wgpu-core/src/track/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Device <- CommandBuffer = insert(device.start, device.end, buffer.start, buffer.
mod buffer;
mod metadata;
mod range;
mod ray_tracing;
mod stateless;
mod texture;

Expand All @@ -113,7 +112,6 @@ use crate::{
use std::{fmt, ops, sync::Arc};
use thiserror::Error;

use crate::track::ray_tracing::AccelerationStructureTracker;
pub(crate) use buffer::{
BufferBindGroupState, BufferTracker, BufferUsageScope, DeviceBufferTracker,
};
Expand Down Expand Up @@ -602,8 +600,8 @@ impl DeviceTracker {
pub(crate) struct Tracker {
pub buffers: BufferTracker,
pub textures: TextureTracker,
pub blas_s: AccelerationStructureTracker<resource::Blas>,
pub tlas_s: AccelerationStructureTracker<resource::Tlas>,
pub blas_s: StatelessTracker<resource::Blas>,
pub tlas_s: StatelessTracker<resource::Tlas>,
pub views: StatelessTracker<resource::TextureView>,
pub bind_groups: StatelessTracker<binding_model::BindGroup>,
pub compute_pipelines: StatelessTracker<pipeline::ComputePipeline>,
Expand All @@ -617,8 +615,8 @@ impl Tracker {
Self {
buffers: BufferTracker::new(),
textures: TextureTracker::new(),
blas_s: AccelerationStructureTracker::new(),
tlas_s: AccelerationStructureTracker::new(),
blas_s: StatelessTracker::new(),
tlas_s: StatelessTracker::new(),
views: StatelessTracker::new(),
bind_groups: StatelessTracker::new(),
compute_pipelines: StatelessTracker::new(),
Expand Down
75 changes: 0 additions & 75 deletions wgpu-core/src/track/ray_tracing.rs

This file was deleted.

0 comments on commit 93c9d01

Please sign in to comment.