Skip to content

Commit

Permalink
Use Trim CommandPool
Browse files Browse the repository at this point in the history
  • Loading branch information
thr3343 committed Oct 6, 2024
1 parent 42984ff commit 1b2e1cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/vulkanmod/render/chunk/WorldRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import net.vulkanmod.vulkan.memory.IndexBuffer;
import net.vulkanmod.vulkan.memory.IndirectBuffer;
import net.vulkanmod.vulkan.memory.MemoryTypes;
import net.vulkanmod.vulkan.queue.Queue;
import net.vulkanmod.vulkan.shader.GraphicsPipeline;
import net.vulkanmod.vulkan.texture.VTextureSelector;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -95,7 +96,8 @@ private WorldRenderer(RenderBuffers renderBuffers) {
allocateIndirectBuffers();

BlockRenderer.setBlockColors(this.minecraft.getBlockColors());

addOnAllChangedCallback(Queue::trimCmdPools);
Renderer.getInstance().addOnResizeCallback(Queue::trimCmdPools);
Renderer.getInstance().addOnResizeCallback(() -> {
if (this.indirectBuffers.length != Renderer.getFramesNum())
allocateIndirectBuffers();
Expand Down

0 comments on commit 1b2e1cc

Please sign in to comment.