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
+18
View File
@@ -3,6 +3,11 @@
RWStructuredBuffer<uint32_t> count_buffer;
[[vk::binding(1, 0)]]
RWStructuredBuffer<uint32_t> index_buffer;
[[vk::binding(2, 0)]]
RWStructuredBuffer<uint32_t> compacted_buffer;
[[vk::push_constant]]
uniform uint32_t write_compact;
[[vk::binding(0, 1)]]
RWStructuredBuffer<uint32_t> reduced_buffer;
@@ -157,5 +162,18 @@ void scatter(
{
index_buffer[sum2] = thread_index * 2 + 1;
}
if (write_compact != 0)
{
if (count_buffer[thread_index * 2] != 0 && sum1 < total)
{
compacted_buffer[sum1] = count_buffer[thread_index * 2];
}
if (count_buffer[thread_index * 2 + 1] != 0 && sum2 < total)
{
compacted_buffer[sum2] = count_buffer[thread_index * 2 + 1];
}
}
}