No mod in structure table

This commit is contained in:
2026-11-09 21:14:59 +01:00
parent 918eb97342
commit a39256a0f1
9 changed files with 93 additions and 47 deletions
+15 -8
View File
@@ -1,6 +1,6 @@
// import ray_cast;
import voxel_cache;
import fixed_structure_table;
// import fixed_structure_table;
import toroidal_structure_table;
import voxel_tracing;
import lod_policies;
@@ -16,6 +16,12 @@ struct PushConstants
uint32_t chunk_width;
uint32_t chunk_height;
uint32_t chunk_alt;
// Canonical table slot of the visible block's minimum corner. Computed on
// the CPU from the toroidal table's current offset.
uint32_t table_base_slot_x;
uint32_t table_base_slot_y;
uint32_t table_base_slot_z;
}
public struct VertexOutput
@@ -115,8 +121,6 @@ void gi_march(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_location:
}
}
groupshared VoxelTraceStack stacks[256];
[shader("compute")]
[numthreads(16, 16, 1)]
void ray_march_compute(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_location: SV_GroupThreadID)
@@ -137,14 +141,18 @@ void ray_march_compute(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_
ToroidalStructureTableTracer table_tracer;
table_tracer.structure_table = table_parameters;
table_tracer.extent = uint32_t3(constants.chunk_width, constants.chunk_alt, constants.chunk_width);
table_tracer.extent =
uint32_t3(constants.chunk_width, constants.chunk_alt, constants.chunk_height);
table_tracer.base_slot = uint32_t3(
constants.table_base_slot_x,
constants.table_base_slot_y,
constants.table_base_slot_z);
let ray_direction = get_ray_direction(location.xy);
Ray r;
r.origin = constants.cam_pos;
r.direction = ray_direction;
r.invDirection = 1.f / ray_direction;
PixelFootprintLod lod = PixelFootprintLod.create((100.f * 3.14f) / 180.f, 1080.f, 2.f);
@@ -154,10 +162,9 @@ void ray_march_compute(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_
tracer.lod = lod;
Hit h;
Span s;
bool hit = tracer.trace(stack_index, h, r, s);
bool hit = tracer.trace(stack_index, h, r);
ToroidalStructureTableTracer.Cursor cursor = table_tracer.begin(r, s);
ToroidalStructureTableTracer.Cursor cursor = table_tracer.begin(r);
Cell cell;
if (hit)