Compare commits

..

No commits in common. "2bba6c8476ecbbbf027095db93c26961c2e2880b" and "a6d89fb2e571df50fedffab4bc56e64dedc610c1" have entirely different histories.

1 changed files with 12 additions and 11 deletions

View File

@ -1,22 +1,23 @@
use crate::gfx::{BulkBufferBuilder, Context};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct Brickmap {
pub bitmask: [u32; 16],
pub shading_table_offset: u32,
pub lod_color: u32,
}
#[derive(Debug, Default, Copy, Clone)]
pub struct BrickmapCacheEntry {
pub grid_idx: usize,
pub shading_table_offset: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
struct Brickmap {
bitmask: [u32; 16],
shading_table_offset: u32,
lod_color: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
struct BrickmapUploadElement {
// TODO: Rename struct
struct BrickmapUnpackElement {
cache_idx: u32, // TODO: Change to usize?
brickmap: Brickmap,
shading_element_count: u32,
@ -28,7 +29,7 @@ pub struct BrickmapCache {
cache: Vec<Option<BrickmapCacheEntry>>,
pub index: usize,
pub num_loaded: u32,
staged: Vec<BrickmapUploadElement>,
staged: Vec<BrickmapUnpackElement>,
max_upload_count: usize,
buffer: wgpu::Buffer,
upload_buffer: wgpu::Buffer,
@ -102,7 +103,7 @@ impl BrickmapCache {
let mut shading_elements = [0u32; 512];
shading_elements[..shading_element_count].copy_from_slice(&albedo_data);
let staged_brickmap = BrickmapUploadElement {
let staged_brickmap = BrickmapUnpackElement {
cache_idx: self.index as u32,
brickmap,
shading_element_count: shading_element_count as u32,