file structure
This commit is contained in:
parent
2d22de28b9
commit
4d95a873b0
@ -25,7 +25,7 @@ fn voxel_vec_3d(data: Vec<Vec<Vec<Voxel>>>) -> Voxel {
|
|||||||
return data[X][Y][Z];
|
return data[X][Y][Z];
|
||||||
}
|
}
|
||||||
|
|
||||||
fn criterion_benchmark(c: &mut Criterion) {
|
fn voxel_map_benchmark(c: &mut Criterion) {
|
||||||
let vec_1d = vec![Voxel { r: 0, g: 0, b: 0 }; MAP_WIDTH * MAP_HEIGHT * MAP_DEPTH];
|
let vec_1d = vec![Voxel { r: 0, g: 0, b: 0 }; MAP_WIDTH * MAP_HEIGHT * MAP_DEPTH];
|
||||||
let vec_3d = vec![vec![vec![Voxel { r: 0, g: 0, b: 0 }; MAP_DEPTH]; MAP_HEIGHT]; MAP_WIDTH];
|
let vec_3d = vec![vec![vec![Voxel { r: 0, g: 0, b: 0 }; MAP_DEPTH]; MAP_HEIGHT]; MAP_WIDTH];
|
||||||
|
|
||||||
@ -33,5 +33,5 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("voxels in 3d vector", |b| b.iter(|| voxel_vec_3d(black_box(vec_3d.clone()))));
|
c.bench_function("voxels in 3d vector", |b| b.iter(|| voxel_vec_3d(black_box(vec_3d.clone()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
criterion_group!(benches, criterion_benchmark);
|
criterion_group!(benches, voxel_map_benchmark);
|
||||||
criterion_main!(benches);
|
criterion_main!(benches);
|
@ -41,7 +41,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
|
|||||||
// Load the shaders from disk
|
// Load the shaders from disk
|
||||||
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(include_str!("shader.wgsl"))),
|
source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(include_str!("../shaders/shader.wgsl"))),
|
||||||
});
|
});
|
||||||
|
|
||||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||||
|
Loading…
Reference in New Issue
Block a user