mirror of
https://github.com/Inori/GPCS4.git
synced 2024-05-20 05:00:52 -04:00
fix presenter bug
caused by forget to update frame index add some comments on submission and presentation loop disable GPCS4_NO_GRAPHICS again
This commit is contained in:
parent
d23511aad2
commit
863326b5cd
|
@ -4,6 +4,6 @@
|
|||
#include "GPCS4Types.h"
|
||||
#include "GPCS4Log.h"
|
||||
#include "GPCS4Decoration.h"
|
||||
#include "IntelliSenseClang.h"
|
||||
#include "IntellisenseClang.h"
|
||||
#include "UtilMath.h"
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@
|
|||
// Graphics switch
|
||||
// Define this will turn off graphics output,
|
||||
// useful when developing non-graphics parts of GPCS4
|
||||
#define GPCS4_NO_GRAPHICS
|
||||
// #define GPCS4_NO_GRAPHICS
|
||||
|
||||
|
|
|
@ -625,7 +625,7 @@ bool DataFormat::getRenderTargetChannelOrder(RenderTargetChannelOrder* outOrder)
|
|||
}
|
||||
goto LABEL_42;
|
||||
}
|
||||
v11 = 288231505728184512LL;
|
||||
v11 = 0x4000107000120C0LL;
|
||||
v12 = v5 == 4 && v6 == 5;
|
||||
v13 = v12 && v8 == 6;
|
||||
if (_bittest64(&v11, v3))
|
||||
|
|
|
@ -173,6 +173,9 @@ namespace sce
|
|||
|
||||
LOG_ASSERT(count == 1, "Currently only support 1 cmdbuff at one call.");
|
||||
|
||||
// track currently display buffer
|
||||
// so that we can find it during command buffer recording
|
||||
// and use it as render target.
|
||||
trackSwapImage(displayBufferIndex);
|
||||
|
||||
SceGpuCommand cmd = {};
|
||||
|
@ -182,6 +185,7 @@ namespace sce
|
|||
|
||||
submitPresent(cmdList, displayBufferIndex);
|
||||
|
||||
// clear resource tracker every frame
|
||||
resetResourceTracker();
|
||||
|
||||
return SCE_OK;
|
||||
|
@ -222,6 +226,10 @@ namespace sce
|
|||
// Currently I didn't find a very good place, so I place it here.
|
||||
|
||||
glfwPollEvents();
|
||||
|
||||
// TODO:
|
||||
// Execute the Gnm::DrawCommandBuffer::InitializeDefaultHardwareState command.
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,13 @@ namespace sce
|
|||
info.pSwapchains = &m_swapchain;
|
||||
info.pImageIndices = &m_imageIndex;
|
||||
info.pResults = nullptr;
|
||||
return vkQueuePresentKHR(m_device.queue, &info);
|
||||
|
||||
VkResult status = vkQueuePresentKHR(m_device.queue, &info);
|
||||
|
||||
m_frameIndex += 1;
|
||||
m_frameIndex %= m_semaphores.size();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
VkResult ScePresenter::recreateSwapChain(const PresenterDesc& desc)
|
||||
|
|
|
@ -18,6 +18,8 @@ namespace sce::vlt
|
|||
{
|
||||
auto& cmdList = submission.cmdList;
|
||||
cmdList->submit(submission.waitSync, submission.wakeSync);
|
||||
|
||||
// simulate async
|
||||
m_submitQueue.push(std::move(cmdList));
|
||||
}
|
||||
|
||||
|
@ -28,10 +30,21 @@ namespace sce::vlt
|
|||
auto& presenter = presentInfo.presenter;
|
||||
presenter->presentImage();
|
||||
|
||||
|
||||
// simulate async
|
||||
auto cmdList = m_submitQueue.front();
|
||||
m_submitQueue.pop();
|
||||
|
||||
// TODO:
|
||||
// Calling synchronize will block the CPU waiting for the submission done on GPU,
|
||||
// thus will block the submit thread, slow down the submit speed and drop FPS.
|
||||
// DXVK's solution is to use another thread dedicated for cmdlist submission
|
||||
// thus overcome the performance problem,
|
||||
// see https://github.com/doitsujin/dxvk/blob/master/src/dxvk/dxvk_queue.cpp
|
||||
//
|
||||
// This can be easily implemented, but for now, our bottleneck is not here obviously.
|
||||
// So I keep it single threaded to make debugging easier.
|
||||
|
||||
|
||||
// Wait for command buffer submit finish.
|
||||
cmdList->synchronize();
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ namespace sce
|
|||
/**
|
||||
* \brief Global GPU mode.
|
||||
*
|
||||
* Any calls from HLE or emulator to
|
||||
* Equalrant/implementation of
|
||||
* Gnm::GpuMode getGpuMode(void);
|
||||
* should be replaced by this mode.
|
||||
*
|
||||
*/
|
||||
Gnm::GpuMode mode();
|
||||
|
||||
|
|
Loading…
Reference in a new issue