mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Vulkan: Optimize away a barrier in case of no depth buffer
This commit is contained in:
parent
78c0be3d8a
commit
60f350056c
@ -17,6 +17,7 @@ public:
|
||||
|
||||
bool empty() const { return imageBarriers_.empty(); }
|
||||
|
||||
// TODO: Replace this with TransitionImage.
|
||||
VkImageMemoryBarrier *Add(VkImage image, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags) {
|
||||
srcStageMask_ |= srcStageMask;
|
||||
dstStageMask_ |= dstStageMask;
|
||||
|
@ -958,7 +958,6 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c
|
||||
}
|
||||
|
||||
// Write-after-write hazards. Fixed flicker in God of War on ARM (before we added another fix that removed these).
|
||||
// These aren't so common so not bothering to combine the barrier with the pretransition one.
|
||||
if (step.render.framebuffer) {
|
||||
int n = 0;
|
||||
int stage = 0;
|
||||
@ -995,8 +994,8 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c
|
||||
}
|
||||
}
|
||||
|
||||
// This reads the layout of the color and depth images, and chooses a render pass using them that
|
||||
// will transition to the desired final layout.
|
||||
// This chooses a render pass according to the load/store attachment state. We no longer transition
|
||||
// image layouts as part of the passes.
|
||||
//
|
||||
// NOTE: Unconditionally flushes recordBarrier_.
|
||||
VKRRenderPass *renderPass = PerformBindFramebufferAsRenderTarget(step, cmd);
|
||||
@ -1282,7 +1281,9 @@ VKRRenderPass *VulkanQueueRunner::PerformBindFramebufferAsRenderTarget(const VKR
|
||||
}
|
||||
|
||||
recordBarrier_.TransitionColorImageAuto(&fb->color, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||
if (fb->depth.image) { // } && RenderPassTypeHasDepth(step.render.renderPassType)) {
|
||||
|
||||
// If the render pass doesn't touch depth, we can avoid a layout transition of the depth buffer.
|
||||
if (fb->depth.image && RenderPassTypeHasDepth(step.render.renderPassType)) {
|
||||
recordBarrier_.TransitionDepthStencilImageAuto(&fb->depth, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user