Remove unnecessary CPU side duplicate of the shading table

This commit is contained in:
Jarrod Doyle 2023-05-06 12:28:22 +01:00
parent eb6b530080
commit 4eaf55a61c
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 0 additions and 11 deletions

View File

@ -26,7 +26,6 @@ pub struct BrickmapManager {
brickmap_cache: Vec<Brickmap>, brickmap_cache: Vec<Brickmap>,
brickmap_cache_idx: usize, brickmap_cache_idx: usize,
brickmap_buffer: wgpu::Buffer, brickmap_buffer: wgpu::Buffer,
shading_table: Vec<u32>,
shading_table_buffer: wgpu::Buffer, shading_table_buffer: wgpu::Buffer,
shading_table_allocator: ShadingTableAllocator, shading_table_allocator: ShadingTableAllocator,
feedback_buffer: wgpu::Buffer, feedback_buffer: wgpu::Buffer,
@ -102,7 +101,6 @@ impl BrickmapManager {
brickmap_cache, brickmap_cache,
brickmap_cache_idx: 0, brickmap_cache_idx: 0,
brickmap_buffer, brickmap_buffer,
shading_table,
shading_table_buffer, shading_table_buffer,
shading_table_allocator, shading_table_allocator,
feedback_buffer, feedback_buffer,
@ -117,11 +115,6 @@ impl BrickmapManager {
0, 0,
bytemuck::cast_slice(&self.brickmap_cache), bytemuck::cast_slice(&self.brickmap_cache),
); );
queue.write_buffer(
&self.shading_table_buffer,
0,
bytemuck::cast_slice(&self.shading_table),
);
queue.write_buffer( queue.write_buffer(
&self.brickgrid_buffer, &self.brickgrid_buffer,
0, 0,
@ -261,10 +254,6 @@ impl BrickmapManager {
.shading_table_allocator .shading_table_allocator
.try_alloc(albedo_data.len() as u32) .try_alloc(albedo_data.len() as u32)
.unwrap() as usize; .unwrap() as usize;
self.shading_table.splice(
shading_idx..(shading_idx + albedo_data.len()),
albedo_data.clone(),
);
context.queue.write_buffer( context.queue.write_buffer(
&self.shading_table_buffer, &self.shading_table_buffer,
(shading_idx * 4) as u64, (shading_idx * 4) as u64,