Skip to content

Commit

Permalink
Calling IContext::wait() with an empty handle results in `vkDeviceW…
Browse files Browse the repository at this point in the history
…aitIdle()`
  • Loading branch information
corporateshark committed Sep 23, 2024
1 parent 27f58a9 commit f43dd48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lvk/LVK.h
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ class IContext {
virtual ICommandBuffer& acquireCommandBuffer() = 0;

virtual SubmitHandle submit(ICommandBuffer& commandBuffer, TextureHandle present = {}) = 0;
virtual void wait(SubmitHandle handle) = 0;
virtual void wait(SubmitHandle handle) = 0; // waiting on an empty handle results in vkDeviceWaitIdle()

[[nodiscard]] virtual Holder<BufferHandle> createBuffer(const BufferDesc& desc, Result* outResult = nullptr) = 0;
[[nodiscard]] virtual Holder<SamplerHandle> createSampler(const SamplerStateDesc& desc, Result* outResult = nullptr) = 0;
Expand Down
5 changes: 5 additions & 0 deletions lvk/vulkan/VulkanClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,11 @@ const lvk::VulkanImmediateCommands::CommandBufferWrapper& lvk::VulkanImmediateCo
void lvk::VulkanImmediateCommands::wait(const SubmitHandle handle) {
LVK_PROFILER_FUNCTION_COLOR(LVK_PROFILER_COLOR_WAIT);

if (handle.empty()) {
vkDeviceWaitIdle(device_);
return;
}

if (isReady(handle)) {
return;
}
Expand Down

0 comments on commit f43dd48

Please sign in to comment.