diff options
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h | 3 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h index aa4085f1..7430ee9a 100644 --- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h @@ -295,7 +295,8 @@ public: VulkanDynamicAllocation AllocateDynamicSpace(Uint32 SizeInBytes, Uint32 Alignment); - void ResetRenderTargets(); + virtual void ResetRenderTargets() override final; + Int64 GetContextFrameNumber() const { return m_ContextFrameNumber; } GenerateMipsVkHelper& GetGenerateMipsHelper() { return *m_GenerateMipsHelper; } diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 135b5844..165f3bdd 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -1407,8 +1407,16 @@ void DeviceContextVkImpl::CopyTexture(const CopyTextureAttribs& CopyAttribs) { TDeviceContextBase::CopyTexture(CopyAttribs); - auto* pSrcTexVk = ValidatedCast<TextureVkImpl>(CopyAttribs.pSrcTexture); - auto* pDstTexVk = ValidatedCast<TextureVkImpl>(CopyAttribs.pDstTexture); + auto* pSrcTexVk = ValidatedCast<TextureVkImpl>(CopyAttribs.pSrcTexture); + auto* pDstTexVk = ValidatedCast<TextureVkImpl>(CopyAttribs.pDstTexture); + + // We must unbind the textures from framebuffer because + // we will transition their states. If we later try to commit + // them as render targets (e.g. from SetPipelineState()), a + // state mismatch error will occur. + UnbindTextureFromFramebuffer(pSrcTexVk, true); + UnbindTextureFromFramebuffer(pDstTexVk, true); + const auto& SrcTexDesc = pSrcTexVk->GetDesc(); const auto& DstTexDesc = pDstTexVk->GetDesc(); auto* pSrcBox = CopyAttribs.pSrcBox; |
