Merge pull request #18815 from hrydgard/additional-fixes

More fixes
This commit is contained in:
Henrik Rydgård 2024-02-03 00:43:38 +01:00 committed by GitHub
commit 16d1d5566b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 5 deletions

View File

@ -2,6 +2,15 @@
#include "VulkanContext.h"
#include "VulkanBarrier.h"
#include "Common/Log.h"
VulkanBarrierBatch::~VulkanBarrierBatch() {
// _dbg_assert_(imageBarriers_.empty());
if (!imageBarriers_.empty()) {
ERROR_LOG(G3D, "~VulkanBarrierBatch: %d barriers remaining", (int)imageBarriers_.size());
}
}
void VulkanBarrier::Flush(VkCommandBuffer cmd) {
if (!imageBarriers_.empty()) {
vkCmdPipelineBarrier(cmd, srcStageMask_, dstStageMask_, dependencyFlags_, 0, nullptr, 0, nullptr, (uint32_t)imageBarriers_.size(), imageBarriers_.data());

View File

@ -3,7 +3,6 @@
#include <string>
#include <vector>
#include "Common/Log.h"
#include "Common/GPU/Vulkan/VulkanLoader.h"
#include "Common/Data/Collections/FastVec.h"
#include "Common/Data/Collections/TinySet.h"
@ -12,9 +11,7 @@ class VulkanContext;
class VulkanBarrierBatch {
public:
~VulkanBarrierBatch() {
_dbg_assert_(imageBarriers_.empty());
}
~VulkanBarrierBatch();
VkImageMemoryBarrier *Add(VkImage image, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags) {
srcStageMask_ |= srcStageMask;

View File

@ -1357,11 +1357,12 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
} else if (!Core_ShouldRunBehind() && strcmp(screenManager()->topScreen()->tag(), "DevMenu") != 0) {
// Just to make sure.
if (PSP_IsInited() && !skipBufferEffects) {
_dbg_assert_(gpu);
PSP_BeginHostFrame();
gpu->CopyDisplayToOutput(true);
PSP_EndHostFrame();
}
if (!framebufferBound && !gpu->PresentedThisFrame()) {
if (!framebufferBound && (!gpu || !gpu->PresentedThisFrame())) {
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, }, "EmuScreen_Behind");
}
// Need to make sure the UI texture is available, for "darken".
@ -1439,6 +1440,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
framebufferBound = true;
// Just to make sure.
if (PSP_IsInited()) {
_dbg_assert_(gpu);
gpu->CopyDisplayToOutput(true);
}
}
@ -1458,6 +1460,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
Achievements::FrameUpdate();
}
_dbg_assert_(gpu);
if (gpu && gpu->PresentedThisFrame()) {
framebufferBound = true;
}