VoxelCache refactor

This commit is contained in:
2026-10-04 20:15:00 +02:00
parent d9df73abab
commit b560f6afd7
14 changed files with 693 additions and 518 deletions
+4 -6
View File
@@ -82,14 +82,12 @@ RWStructuredBuffer<StructurePoolElement> structure_pool;
[[vk::binding(1, 0)]]
RWStructuredBuffer<uint32_t> attributes_pool[2];
[[vk::binding(2, 0)]]
RWStructuredBuffer<LocationPoolElement> location_pool;
[[vk::binding(3, 0)]]
RWStructuredBuffer<RequestBufferElement> request_buffer;
[[vk::binding(4, 0)]]
[[vk::binding(3, 0)]]
RWStructuredBuffer<uint32_t> usage_buffer;
[[vk::binding(5, 0)]]
[[vk::binding(4, 0)]]
RWStructuredBuffer<StructurePointer> structure_table_pointer;
[[vk::binding(6, 0)]]
[[vk::binding(5, 0)]]
RWStructuredBuffer<Atomic<uint32_t>> structure_table_request_buffer;
ByteColor fetch_color(uint32_t index, uint32_t child_index)
@@ -156,7 +154,6 @@ void ray_march_compute(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_
var voxel_cache : VoxelCache;
voxel_cache.structure_pool = structure_pool;
voxel_cache.attributes_pool = attributes_pool;
voxel_cache.location_pool = location_pool;
voxel_cache.request_buffer = request_buffer;
voxel_cache.usage_buffer = usage_buffer;
voxel_cache.structure_table_pointer = structure_table_pointer;
@@ -179,6 +176,7 @@ void ray_march_compute(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_
let hit_pos = hit.hit_pos;
let hit_normal = fetch_normal(hit.node_index, hit.child_index);
let hit_albedo = fetch_color(hit.node_index, hit.child_index).float_color;
// let hit_albedo = hit.color;
gbuffer_position.Store(location.xy, float4(hit_pos, 1.));
gbuffer_normal.Store(location.xy, float4(hit_normal, 1.));