mirror of
https://github.com/stenzek/duckstation.git
synced 2026-11-17 19:44:24 +01:00
VulkanDevice: Remove unused GetRenderPassForRestarting()
This commit is contained in:
2 files changed
-45
No files matched your search
@@ -1048,48 +1048,6 @@ VkRenderPass VulkanDevice::GetSwapChainRenderPass(GPUTextureFormat format, VkAtt
|
||||
return CreateCachedRenderPass(key);
|
||||
}
|
||||
|
||||
VkRenderPass VulkanDevice::GetRenderPassForRestarting(VkRenderPass pass)
|
||||
{
|
||||
m_render_pass_cache_mutex.lock_shared();
|
||||
for (const auto& it : m_render_pass_cache)
|
||||
{
|
||||
if (it.second != pass)
|
||||
continue;
|
||||
|
||||
RenderPassCacheKey modified_key = it.first;
|
||||
for (u32 i = 0; i < MAX_RENDER_TARGETS; i++)
|
||||
{
|
||||
if (modified_key.color[i].load_op == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||
modified_key.color[i].load_op = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||
}
|
||||
|
||||
if (modified_key.depth_load_op == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||
modified_key.depth_load_op = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||
if (modified_key.stencil_load_op == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||
modified_key.stencil_load_op = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||
|
||||
if (modified_key == it.first)
|
||||
{
|
||||
m_render_pass_cache_mutex.unlock_shared();
|
||||
return pass;
|
||||
}
|
||||
|
||||
auto fit = m_render_pass_cache.find(modified_key);
|
||||
if (fit != m_render_pass_cache.end())
|
||||
{
|
||||
const VkRenderPass ret = fit->second;
|
||||
m_render_pass_cache_mutex.unlock_shared();
|
||||
return ret;
|
||||
}
|
||||
|
||||
m_render_pass_cache_mutex.unlock_shared();
|
||||
return CreateCachedRenderPass(modified_key);
|
||||
}
|
||||
|
||||
m_render_pass_cache_mutex.unlock_shared();
|
||||
return pass;
|
||||
}
|
||||
|
||||
VkCommandBuffer VulkanDevice::GetCurrentInitCommandBuffer()
|
||||
{
|
||||
CommandBuffer& res = m_frame_resources[m_current_frame];
|
||||
|
||||
@@ -184,9 +184,6 @@ public:
|
||||
GPUPipeline::RenderPassFlag render_pass_flags);
|
||||
VkRenderPass GetSwapChainRenderPass(GPUTextureFormat format, VkAttachmentLoadOp load_op);
|
||||
|
||||
// Gets a non-clearing version of the specified render pass. Slow, don't call in hot path.
|
||||
VkRenderPass GetRenderPassForRestarting(VkRenderPass pass);
|
||||
|
||||
// These command buffers are allocated per-frame. They are valid until the command buffer
|
||||
// is submitted, after that you should call these functions again.
|
||||
ALWAYS_INLINE VkCommandBuffer GetCurrentCommandBuffer() const { return m_current_command_buffer; }
|
||||
|
||||
Reference in new issue
Block a user