diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-03-29 21:56:28 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-29 21:56:28 +1000 |
| commit | 377615b06fd61717edb39b51964e611fd2da8cdc (patch) | |
| tree | b95d2e759189c90cc598f311dcf4da69e3668c22 /Source/Core/VideoBackends/Vulkan/Renderer.cpp | |
| parent | f3fadd730218429a5f6472283d16d30d7e276f8d (diff) | |
| parent | 604ab67c7f28dc03a82ee7aa1bcc487d39ea6f8c (diff) | |
Merge pull request #7905 from stenzek/vulkan-cleanup
Vulkan: Simplify command buffer fence tracking
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/Renderer.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/Renderer.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp index 8b560be15d..fc07c4ce41 100644 --- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp +++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp @@ -304,7 +304,6 @@ void Renderer::PresentBackbuffer() { // End drawing to backbuffer StateTracker::GetInstance()->EndRenderPass(); - PerfQuery::GetInstance()->FlushQueries(); // Transition the backbuffer to PRESENT_SRC to ensure all commands drawing // to it have finished before present. @@ -315,7 +314,7 @@ void Renderer::PresentBackbuffer() // Because this final command buffer is rendering to the swap chain, we need to wait for // the available semaphore to be signaled before executing the buffer. This final submission // can happen off-thread in the background while we're preparing the next frame. - g_command_buffer_mgr->SubmitCommandBuffer(true, m_swap_chain->GetSwapChain(), + g_command_buffer_mgr->SubmitCommandBuffer(true, false, m_swap_chain->GetSwapChain(), m_swap_chain->GetCurrentImageIndex()); // New cmdbuffer, so invalidate state. @@ -325,13 +324,8 @@ void Renderer::PresentBackbuffer() void Renderer::ExecuteCommandBuffer(bool submit_off_thread, bool wait_for_completion) { StateTracker::GetInstance()->EndRenderPass(); - PerfQuery::GetInstance()->FlushQueries(); - // If we're waiting for completion, don't bother waking the worker thread. - const VkFence pending_fence = g_command_buffer_mgr->GetCurrentCommandBufferFence(); - g_command_buffer_mgr->SubmitCommandBuffer(submit_off_thread && wait_for_completion); - if (wait_for_completion) - g_command_buffer_mgr->WaitForFence(pending_fence); + g_command_buffer_mgr->SubmitCommandBuffer(submit_off_thread, wait_for_completion); StateTracker::GetInstance()->InvalidateCachedState(); } @@ -550,10 +544,6 @@ void Renderer::UnbindTexture(const AbstractTexture* texture) void Renderer::ResetSamplerStates() { - // Ensure none of the sampler objects are in use. - // This assumes that none of the samplers are in use on the command list currently being recorded. - g_command_buffer_mgr->WaitForGPUIdle(); - // Invalidate all sampler states, next draw will re-initialize them. for (u32 i = 0; i < m_sampler_states.size(); i++) { |
