Voxel cache rewrite
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
use wgpu::Device;
|
||||
use wgpu::Queue;
|
||||
|
||||
use crate::voxel_cache::PageList;
|
||||
use crate::voxel_cache::VoxelCache;
|
||||
use crate::voxel_cache::layout::VoxelCacheLayout;
|
||||
|
||||
pub struct VoxelGiPipeline<const N: usize>
|
||||
{
|
||||
voxel_cache: VoxelCache<N>,
|
||||
// ~~ Leaf list ~~
|
||||
// The leaf list is maintained in a sparse swap'n'pop fashion
|
||||
leaf_list: PageList,
|
||||
}
|
||||
|
||||
impl<const N: usize> VoxelGiPipeline<N>
|
||||
{
|
||||
pub fn new(device: &Device, queue: &Queue, cache_size: usize, layout: VoxelCacheLayout) -> Self
|
||||
where
|
||||
[(); N * N * N]:,
|
||||
{
|
||||
let voxel_cache = VoxelCache::new(cache_size, device.clone(), queue.clone(), &layout);
|
||||
let leaf_list = PageList::new(device, cache_size);
|
||||
|
||||
VoxelGiPipeline {
|
||||
voxel_cache,
|
||||
leaf_list,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user