mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-06-08 03:13:52 +00:00
VK: Split FrameBufferVK::acquire into swap-chain acquire + markDirty(). (#3694)
This commit is contained in:
committed by
GitHub
parent
b2a7d94d57
commit
58faaadf1c
@@ -3049,7 +3049,7 @@ VK_IMPORT_DEVICE
|
||||
setShaderUniform(_flags, _regIndex, _val, _numRegs);
|
||||
}
|
||||
|
||||
void setFrameBuffer(FrameBufferHandle _fbh, bool _acquire = true)
|
||||
void setFrameBuffer(FrameBufferHandle _fbh)
|
||||
{
|
||||
BGFX_PROFILER_SCOPE("RendererContextVK::setFrameBuffer()", kColorFrame);
|
||||
|
||||
@@ -3115,24 +3115,15 @@ VK_IMPORT_DEVICE
|
||||
, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
|
||||
);
|
||||
}
|
||||
|
||||
newFrameBuffer.acquire(m_commandBuffer);
|
||||
}
|
||||
|
||||
if (_acquire)
|
||||
else
|
||||
{
|
||||
int64_t start = bx::getHPCounter();
|
||||
|
||||
newFrameBuffer.acquire(m_commandBuffer);
|
||||
|
||||
const int64_t now = bx::getHPCounter();
|
||||
|
||||
if (NULL != newFrameBuffer.m_nwh)
|
||||
{
|
||||
m_presentElapsed += now - start;
|
||||
}
|
||||
m_presentElapsed += bx::getHPCounter() - start;
|
||||
}
|
||||
|
||||
newFrameBuffer.markDirty();
|
||||
m_fbh = _fbh;
|
||||
}
|
||||
|
||||
@@ -8543,18 +8534,12 @@ retry:
|
||||
|
||||
bool FrameBufferVK::acquire(VkCommandBuffer _commandBuffer)
|
||||
{
|
||||
BX_ASSERT(NULL != m_nwh, "FrameBufferVK::acquire is only valid for swap-chain framebuffers.");
|
||||
BGFX_PROFILER_SCOPE("FrameBufferVK::acquire", kColorFrame);
|
||||
|
||||
bool acquired = true;
|
||||
|
||||
if (NULL != m_nwh)
|
||||
{
|
||||
acquired = m_swapChain.acquire(_commandBuffer);
|
||||
m_needPresent = m_swapChain.m_needPresent;
|
||||
m_currentFramebuffer = m_swapChain.m_backBufferFrameBuffer[m_swapChain.m_backBufferColorIdx];
|
||||
}
|
||||
|
||||
m_needResolve = true;
|
||||
const bool acquired = m_swapChain.acquire(_commandBuffer);
|
||||
m_needPresent = m_swapChain.m_needPresent;
|
||||
m_currentFramebuffer = m_swapChain.m_backBufferFrameBuffer[m_swapChain.m_backBufferColorIdx];
|
||||
|
||||
return acquired;
|
||||
}
|
||||
|
||||
@@ -909,6 +909,8 @@ VK_DESTROY_FUNC(DescriptorSet);
|
||||
bool acquire(VkCommandBuffer _commandBuffer);
|
||||
void present();
|
||||
|
||||
void markDirty() { m_needResolve = true; }
|
||||
|
||||
bool isRenderable() const;
|
||||
|
||||
TextureHandle m_texture[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
|
||||
|
||||
Reference in New Issue
Block a user