Skip to content

Commit

Permalink
Merge branch '1.20.x' into vk12Bindless3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
thr3343 committed Jul 27, 2024
2 parents 8565bad + 11e7a8f commit 1d84f65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/vulkanmod/vulkan/Renderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ private void submitFrame() {
Synchronization.INSTANCE.waitFences();

if ((vkResult = vkQueueSubmit(DeviceManager.getGraphicsQueue().queue(), submitInfo, inFlightFences.get(currentFrame))) != VK_SUCCESS) {
vkResetFences(device, stack.longs(inFlightFences.get(currentFrame)));
vkResetFences(device, inFlightFences.get(currentFrame));
throw new RuntimeException("Failed to submit draw command buffer: %s".formatted(VkResult.decode(vkResult)));
}

Expand Down
8 changes: 3 additions & 5 deletions src/main/java/net/vulkanmod/vulkan/Synchronization.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ public synchronized void addFence(long fence) {
}

public synchronized void waitFences() {

if (idx == 0) return;
if (idx == 0)
return;

VkDevice device = Vulkan.getVkDevice();

fences.limit(idx);

for (int i = 0; i < idx; i++) {
vkWaitForFences(device, fences.get(i), true, VUtil.UINT64_MAX);
}
vkWaitForFences(device, fences, true, VUtil.UINT64_MAX);

this.commandBuffers.forEach(CommandPool.CommandBuffer::reset);
this.commandBuffers.clear();
Expand Down

0 comments on commit 1d84f65

Please sign in to comment.