Skip to content

Commit

Permalink
Update RenderRegionManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatMG393 authored Jan 4, 2025
1 parent 897691c commit c5833a4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private void uploadResults(CommandList commandList, RenderRegion region, Collect

if (storage != null) {
storage.removeVertexData(renderSectionIndex);
region.clearCachedBatchFor(pass);
}

BuiltSectionMeshParts mesh = chunkBuildOutput.getMesh(pass);
Expand All @@ -98,6 +99,7 @@ private void uploadResults(CommandList commandList, RenderRegion region, Collect
var storage = region.getStorage(DefaultTerrainRenderPasses.TRANSLUCENT);
if (storage != null) {
storage.removeIndexData(renderSectionIndex);
region.clearCachedBatchFor(DefaultTerrainRenderPasses.TRANSLUCENT);
storage.setSharedIndexUsage(renderSectionIndex, 0);
}

Expand Down Expand Up @@ -137,6 +139,7 @@ private void uploadResults(CommandList commandList, RenderRegion region, Collect
// Once invalidated the tessellation will be re-created on the next attempted use
if (bufferChanged) {
region.refreshTesselation(commandList);
region.clearAllCachedBatches();
}

// Collect the upload results
Expand Down Expand Up @@ -167,6 +170,7 @@ private void uploadResults(CommandList commandList, RenderRegion region, Collect

if (indexBufferChanged) {
region.refreshIndexedTesselation(commandList);
region.clearCachedBatchFor(DefaultTerrainRenderPasses.TRANSLUCENT);
}

profiler.pop();
Expand Down

0 comments on commit c5833a4

Please sign in to comment.