mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Add parameter to prepareImage to ignore clears
Otherwise we may flush clears while clearing a render target, which is silly and undoes the layout optimizations.
This commit is contained in:
parent
2b401725dc
commit
a0cf5926d8
@ -577,7 +577,7 @@ namespace dxvk {
|
|||||||
// will indirectly emit barriers for the given render target.
|
// will indirectly emit barriers for the given render target.
|
||||||
// If there is overlap, we need to explicitly transition affected attachments.
|
// If there is overlap, we need to explicitly transition affected attachments.
|
||||||
this->spillRenderPass(true);
|
this->spillRenderPass(true);
|
||||||
this->prepareImage(m_execBarriers, imageView->image(), imageView->subresources());
|
this->prepareImage(m_execBarriers, imageView->image(), imageView->subresources(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_flags.test(DxvkContextFlag::GpRenderPassBound))
|
if (m_flags.test(DxvkContextFlag::GpRenderPassBound))
|
||||||
@ -4169,14 +4169,15 @@ namespace dxvk {
|
|||||||
void DxvkContext::prepareImage(
|
void DxvkContext::prepareImage(
|
||||||
DxvkBarrierSet& barriers,
|
DxvkBarrierSet& barriers,
|
||||||
const Rc<DxvkImage>& image,
|
const Rc<DxvkImage>& image,
|
||||||
const VkImageSubresourceRange& subresources) {
|
const VkImageSubresourceRange& subresources,
|
||||||
|
bool flushClears) {
|
||||||
// Images that can't be used as attachments are always in their
|
// Images that can't be used as attachments are always in their
|
||||||
// default layout, so we don't have to do anything in this case
|
// default layout, so we don't have to do anything in this case
|
||||||
if (!(image->info().usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)))
|
if (!(image->info().usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Flush clears if there are any since they may affect the image
|
// Flush clears if there are any since they may affect the image
|
||||||
if (!m_deferredClears.empty())
|
if (!m_deferredClears.empty() && flushClears)
|
||||||
this->spillRenderPass(false);
|
this->spillRenderPass(false);
|
||||||
|
|
||||||
// All images are in their default layout for suspended passes
|
// All images are in their default layout for suspended passes
|
||||||
|
@ -1166,7 +1166,8 @@ namespace dxvk {
|
|||||||
void prepareImage(
|
void prepareImage(
|
||||||
DxvkBarrierSet& barriers,
|
DxvkBarrierSet& barriers,
|
||||||
const Rc<DxvkImage>& image,
|
const Rc<DxvkImage>& image,
|
||||||
const VkImageSubresourceRange& subresources);
|
const VkImageSubresourceRange& subresources,
|
||||||
|
bool flushClears = true);
|
||||||
|
|
||||||
bool updateIndexBufferBinding();
|
bool updateIndexBufferBinding();
|
||||||
void updateVertexBufferBindings();
|
void updateVertexBufferBindings();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user