1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +01:00

[dxvk] Only mark render targets as used on draw calls

This commit is contained in:
Philip Rebohle 2018-09-13 12:00:49 +02:00
parent 9e3914b368
commit d86b5361f0
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 9 additions and 7 deletions

View File

@ -397,7 +397,7 @@ namespace dxvk {
const Rc<DxvkImageView>& imageView,
VkImageAspectFlags clearAspects,
const VkClearValue& clearValue) {
this->updateFramebuffer();
this->updateFramebuffer(false);
// Prepare attachment ops
DxvkColorAttachmentOps colorOp;
@ -1639,7 +1639,7 @@ namespace dxvk {
VkOffset3D offset,
VkExtent3D extent,
VkClearValue value) {
this->updateFramebuffer();
this->updateFramebuffer(false);
// Find out if the render target view is currently bound,
// so that we can avoid spilling the render pass if it is.
@ -2234,7 +2234,7 @@ namespace dxvk {
}
void DxvkContext::updateFramebuffer() {
void DxvkContext::updateFramebuffer(bool isDraw) {
if (m_flags.test(DxvkContextFlag::GpDirtyFramebuffer)) {
m_flags.clr(DxvkContextFlag::GpDirtyFramebuffer);
@ -2253,8 +2253,10 @@ namespace dxvk {
: VkComponentMapping();
}
for (uint32_t i = 0; i < fb->numAttachments(); i++)
fb->getAttachment(i).view->setRtBindingFrameId(m_device->getCurrentFrameId());
if (isDraw) {
for (uint32_t i = 0; i < fb->numAttachments(); i++)
fb->getAttachment(i).view->setRtBindingFrameId(m_device->getCurrentFrameId());
}
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
}
@ -2397,7 +2399,7 @@ namespace dxvk {
void DxvkContext::commitGraphicsState() {
this->updateFramebuffer();
this->updateFramebuffer(true);
this->startRenderPass();
this->updateGraphicsPipeline();
this->updateIndexBufferBinding();

View File

@ -713,7 +713,7 @@ namespace dxvk {
VkDescriptorSet set,
const DxvkPipelineLayout* layout);
void updateFramebuffer();
void updateFramebuffer(bool isDraw);
void updateIndexBufferBinding();
void updateVertexBufferBindings();