1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-29 17:52:18 +01:00

[dxvk] Introduce flushSharedImages

Fixes problems with images not being cleared prior to presentation
if the clear is the last command issued in the frame.
This commit is contained in:
Philip Rebohle 2021-05-12 15:35:28 +02:00
parent 895b19c746
commit 0f5e126735
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 17 additions and 4 deletions

View File

@ -66,10 +66,7 @@ namespace dxvk {
Rc<DxvkCommandList> DxvkContext::endRecording() {
this->spillRenderPass(true);
// Ensure that any shared images are in their
// default layout for the next submission
this->transitionRenderTargetLayouts(m_execBarriers, true);
this->flushSharedImages();
m_sdmaBarriers.recordCommands(m_cmd);
m_initBarriers.recordCommands(m_cmd);
@ -1938,6 +1935,20 @@ namespace dxvk {
}
void DxvkContext::flushSharedImages() {
for (auto i = m_deferredClears.begin(); i != m_deferredClears.end(); ) {
if (i->imageView->imageInfo().shared) {
this->performClear(i->imageView, -1, i->discardAspects, i->clearAspects, i->clearValue);
i = m_deferredClears.erase(i);
} else {
i++;
}
}
this->transitionRenderTargetLayouts(m_execBarriers, true);
}
void DxvkContext::updateBuffer(
const Rc<DxvkBuffer>& buffer,
VkDeviceSize offset,

View File

@ -1139,6 +1139,8 @@ namespace dxvk {
void flushClears(
bool useRenderPass);
void flushSharedImages();
void startRenderPass();
void spillRenderPass(bool suspend);