diff --git a/generated/gpu_buffer_lod_element_buffer_untextured_3d_geometry_buffer.h b/generated/gpu_buffer_lod_element_buffer_untextured_3d_geometry_buffer.h index 110f5cb1e..d9b8eff9c 100644 --- a/generated/gpu_buffer_lod_element_buffer_untextured_3d_geometry_buffer.h +++ b/generated/gpu_buffer_lod_element_buffer_untextured_3d_geometry_buffer.h @@ -1,4 +1,4 @@ -// src/engine/render.cpp:1040:0 +// src/engine/render.cpp:1041:0 link_internal void @@ -39,6 +39,7 @@ SyncGpuBuffersAsync(engine_resources *Engine, lod_element_buffer *Meshes) untextured_3d_geometry_buffer *Mesh = AtomicReplaceMesh( Meshes, MeshBit, 0, u64_MAX ); if (Mesh && Mesh->At) { + Handles->Flags |= GpuHandles_UpdatePending; PushReallocateBuffersCommand(&Engine->Stdlib.Plat.RenderQ, Handles, Mesh); Result = True; } diff --git a/src/engine/editor.cpp b/src/engine/editor.cpp index a5ce13c7e..e420efee8 100644 --- a/src/engine/editor.cpp +++ b/src/engine/editor.cpp @@ -684,7 +684,7 @@ DoSelectonModification( engine_resources *Engine, if (Intersect(PlaneN, SelectionState->ClickedP[0], MouseRay->Origin, MouseRay->Dir, &tRay)) { v3 PlaneIntersect = MouseRay->Origin + (MouseRay->Dir*tRay); - DEBUG_HighlightVoxel(Engine, PlaneIntersect, RED); + /* DEBUG_HighlightVoxel(Engine, PlaneIntersect, RED); */ if (Input->LMB.Pressed) { SelectionState->ClickedP[1] = PlaneIntersect; @@ -698,8 +698,8 @@ DoSelectonModification( engine_resources *Engine, Result = ModifySelectionAABB(&SelectionAABB, V3i(UpdateVector), SelectionState->ClickedFace, SelectionMode); { - DEBUG_HighlightVoxel(Engine, SelectionState->ClickedP[0], RED); - DEBUG_HighlightVoxel(Engine, SelectionState->ClickedP[1], BLUE); + /* DEBUG_HighlightVoxel(Engine, SelectionState->ClickedP[0], RED); */ + /* DEBUG_HighlightVoxel(Engine, SelectionState->ClickedP[1], BLUE); */ DEBUG_DrawSimSpaceVectorAt(Engine, SelectionState->ClickedP[0], UpdateVector, GREEN); } @@ -1037,7 +1037,7 @@ CheckForChangesAndUpdate_ThenRenderToPreviewTexture(engine_resources *Engine, br AllocateWorldChunk(Chunk, {}, RequiredLayerDim, Editor->Memory); } - if (UpdateVoxels) + if (LengthSq(Chunk->Dim) > 0 && UpdateVoxels) { /* Info("Detected changes to settings, updating voxels. ReallocChunk(%b) SettingsChanged(%b)", ReallocChunk, SettingsChanged); */ diff --git a/src/engine/render.cpp b/src/engine/render.cpp index e1e92cd2a..4c8dfeaa2 100644 --- a/src/engine/render.cpp +++ b/src/engine/render.cpp @@ -979,6 +979,7 @@ poof( (buffer_t.name) *Mesh = AtomicReplaceMesh( Meshes, MeshBit, 0, u64_MAX ); if (Mesh && Mesh->At) { + Handles->Flags |= GpuHandles_UpdatePending; PushReallocateBuffersCommand(&Engine->Stdlib.Plat.RenderQ, Handles, Mesh); Result = True; } diff --git a/src/engine/world_chunk.cpp b/src/engine/world_chunk.cpp index 2b3574c87..6152155b5 100644 --- a/src/engine/world_chunk.cpp +++ b/src/engine/world_chunk.cpp @@ -3492,6 +3492,7 @@ QueueChunkForMeshRebuild(work_queue *Queue, world_chunk *Chunk, chunk_init_flags TIMED_FUNCTION(); Assert(Chunk->Flags & Chunk_VoxelsInitialized); + Assert(LengthSq(Chunk->Dim) > 0); // TODO(Jesse): Which of these is true?! /* Assert((Chunk->Flags & Chunk_Queued) == 0); */