Faster coalescing
This commit is contained in:
+22
-12
@@ -62,6 +62,7 @@ use crate::voxel_cache::data::CacheResponse;
|
||||
use crate::voxel_cache::data::ColorBytes;
|
||||
use crate::voxel_cache::data::DestinationElement;
|
||||
use crate::voxel_cache::data::LocationPoolElement;
|
||||
use crate::voxel_cache::data::StructurePoolElement;
|
||||
use crate::voxel_cache::producer_interface::CacheProducerInterface;
|
||||
use crate::voxel_cache::producer_interface::CacheRequest;
|
||||
|
||||
@@ -142,7 +143,8 @@ impl State
|
||||
.request_device(&wgpu::DeviceDescriptor {
|
||||
required_features: Features::IMMEDIATES
|
||||
| Features::SHADER_EARLY_DEPTH_TEST
|
||||
| Features::TIMESTAMP_QUERY,
|
||||
| Features::TIMESTAMP_QUERY
|
||||
| Features::SHADER_INT64,
|
||||
required_limits: wgpu::Limits {
|
||||
max_immediate_size: 112,
|
||||
max_storage_buffers_per_shader_stage: 16,
|
||||
@@ -161,22 +163,22 @@ impl State
|
||||
|
||||
let egui_renderer = EguiRenderer::new(&device, surface_format, &window);
|
||||
|
||||
let mut voxel_cache = VoxelCache::<4>::new(200_000, device.clone(), queue.clone());
|
||||
let mut voxel_cache = VoxelCache::<4>::new(100_000, device.clone(), queue.clone());
|
||||
let cache_interface = CacheProducerInterface::new(1024, &device);
|
||||
|
||||
let terrain_generator = TerrainGenerator::<4>::new(5, "vxls_height.tif", 0.2, "img.jpg");
|
||||
//let terrain_generator = TerrainGenerator::<4>::new(5, "vxls_height.tif", 0.2, "img.jpg");
|
||||
// let terrain_generator = TerrainGenerator::<4>::new(
|
||||
// 5,
|
||||
// "./pointe_percee/height.tif",
|
||||
// 0.2,
|
||||
// "./pointe_percee/ortho.jpg",
|
||||
// );
|
||||
// let terrain_generator = TerrainGenerator::<4>::new(
|
||||
// 5,
|
||||
// "/home/albin/Documents/vxls_maps/lapiz/height.tif",
|
||||
// 0.2,
|
||||
// "/home/albin/Documents/vxls_maps/lapiz/ortho.jpg",
|
||||
// );
|
||||
let terrain_generator = TerrainGenerator::<4>::new(
|
||||
5,
|
||||
"/home/albin/Documents/vxls_maps/lapiz/height.tif",
|
||||
0.2,
|
||||
"/home/albin/Documents/vxls_maps/lapiz/ortho.jpg",
|
||||
);
|
||||
|
||||
let mut chunk_pos_map = HashMap::new();
|
||||
let chunk_instances = (0..terrain_generator.chunk_width)
|
||||
@@ -270,7 +272,7 @@ impl State
|
||||
depth_stencil: Some(wgpu::DepthStencilState {
|
||||
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
||||
depth_write_enabled: Some(true),
|
||||
depth_compare: Some(wgpu::CompareFunction::Less),
|
||||
depth_compare: Some(wgpu::CompareFunction::LessEqual),
|
||||
stencil: wgpu::StencilState::default(),
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
}),
|
||||
@@ -645,7 +647,7 @@ impl State
|
||||
let generator = cloned_generator;
|
||||
let gen_test = SineGenerator::<4>::new(5);
|
||||
|
||||
let mut structure_nodes = vec![];
|
||||
let mut structure_nodes: Vec<StructurePoolElement<4>> = vec![];
|
||||
let mut color_nodes: Vec<[ColorBytes; 64]> = vec![];
|
||||
let mut location_nodes = vec![];
|
||||
|
||||
@@ -704,7 +706,15 @@ impl State
|
||||
};
|
||||
}
|
||||
|
||||
(node.structure, node.colors, location)
|
||||
(
|
||||
StructurePoolElement {
|
||||
occupancy_low: 0,
|
||||
occupancy_high: 0,
|
||||
pointers: node.structure,
|
||||
},
|
||||
node.colors,
|
||||
location,
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user