mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 01:33:45 +01:00
Split CopyDisplayToOutput in preparation for the next step
This commit is contained in:
1 parent
1078c27bb7
commit
f01aaeafb1
9 files changed
+23
-13
No files matched your search
@@ -661,7 +661,8 @@ void __DisplayFlip(int cyclesLate) {
|
||||
}
|
||||
}
|
||||
if (nextFrame) {
|
||||
gpu->CopyDisplayToOutput(g_displayLayoutConfigCached, fbReallyDirty);
|
||||
gpu->SetCurFramebufferDirty(fbReallyDirty);
|
||||
gpu->CopyDisplayToOutput(g_displayLayoutConfigCached);
|
||||
if (fbReallyDirty) {
|
||||
DisplayFireActualFlip();
|
||||
}
|
||||
|
||||
@@ -795,7 +795,7 @@ static int ptp_send_postoffice(int idx, const void *data, int *len) {
|
||||
}
|
||||
if (ptp_send_status == AEMU_POSTOFFICE_CLIENT_OUT_OF_MEMORY) {
|
||||
// this is pretty critical
|
||||
ERROR_LOG(Log::sceNet, "%s: critical: huge client buf %d what is going on please fix", __func__, len);
|
||||
ERROR_LOG(Log::sceNet, "%s: critical: huge client buf %d what is going on please fix", __func__, len ? *len : 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+2
-1
@@ -124,7 +124,8 @@ public:
|
||||
uint32_t GetAddrTranslation() override;
|
||||
|
||||
virtual void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) = 0;
|
||||
virtual void CopyDisplayToOutput(const DisplayLayoutConfig &config, bool reallyDirty) = 0;
|
||||
virtual void SetCurFramebufferDirty(bool dirty) = 0;
|
||||
virtual void CopyDisplayToOutput(const DisplayLayoutConfig &config) = 0;
|
||||
virtual bool PresentedThisFrame() const = 0;
|
||||
|
||||
// Invalidate any cached content sourced from the specified range.
|
||||
|
||||
+3
-2
@@ -530,7 +530,7 @@ void GPUCommonHW::PreExecuteOp(u32 op, u32 diff) {
|
||||
CheckFlushOp(op >> 24, diff);
|
||||
}
|
||||
|
||||
void GPUCommonHW::CopyDisplayToOutput(const DisplayLayoutConfig &config, bool reallyDirty) {
|
||||
void GPUCommonHW::CopyDisplayToOutput(const DisplayLayoutConfig &config) {
|
||||
drawEngineCommon_->FlushQueuedDepth();
|
||||
// Flush anything left over.
|
||||
drawEngineCommon_->Flush();
|
||||
@@ -538,7 +538,8 @@ void GPUCommonHW::CopyDisplayToOutput(const DisplayLayoutConfig &config, bool re
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
// after this, render pass is active.
|
||||
framebufferManager_->CopyDisplayToOutput(config, reallyDirty);
|
||||
framebufferManager_->CopyDisplayToOutput(config, curFramebufferDirty_);
|
||||
curFramebufferDirty_ = false;
|
||||
|
||||
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
|
||||
}
|
||||
|
||||
+4
-2
@@ -7,10 +7,11 @@
|
||||
class GPUCommonHW : public GPUCommon {
|
||||
public:
|
||||
GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||
~GPUCommonHW();
|
||||
~GPUCommonHW() override;
|
||||
|
||||
// This can fail, and if so no render pass is active.
|
||||
void CopyDisplayToOutput(const DisplayLayoutConfig &config, bool reallyDirty) override;
|
||||
void SetCurFramebufferDirty(bool dirty) override { curFramebufferDirty_ = dirty; }
|
||||
void CopyDisplayToOutput(const DisplayLayoutConfig &config) override;
|
||||
void DoState(PointerWrap &p) override;
|
||||
void DeviceLost() override;
|
||||
void DeviceRestore(Draw::DrawContext *draw) override;
|
||||
@@ -105,4 +106,5 @@ protected:
|
||||
int msaaLevel_ = 0;
|
||||
bool sawExactEqualDepth_ = false;
|
||||
ShaderManagerCommon *shaderManager_ = nullptr;
|
||||
bool curFramebufferDirty_ = false;
|
||||
};
|
||||
@@ -646,7 +646,7 @@ void SoftGPU::CopyToCurrentFboFromDisplayRam(const DisplayLayoutConfig &config,
|
||||
presentation_->CopyToOutput(config, outputFlags, config.iInternalScreenRotation, u0, v0, u1, v1);
|
||||
}
|
||||
|
||||
void SoftGPU::CopyDisplayToOutput(const DisplayLayoutConfig &config, bool reallyDirty) {
|
||||
void SoftGPU::CopyDisplayToOutput(const DisplayLayoutConfig &config) {
|
||||
drawEngine_->transformUnit.Flush(this, "output");
|
||||
// The display always shows 480x272.
|
||||
CopyToCurrentFboFromDisplayRam(config, FB_WIDTH, FB_HEIGHT);
|
||||
|
||||
@@ -137,7 +137,8 @@ public:
|
||||
void UpdateCmdInfo() override {}
|
||||
|
||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||
void CopyDisplayToOutput(const DisplayLayoutConfig &config, bool reallyDirty) override;
|
||||
void SetCurFramebufferDirty(bool dirty) override {}
|
||||
void CopyDisplayToOutput(const DisplayLayoutConfig &config) override;
|
||||
void GetStats(char *buffer, size_t bufsize) override;
|
||||
std::vector<const VirtualFramebuffer *> GetFramebufferList() const override { return std::vector<const VirtualFramebuffer *>(); }
|
||||
void InvalidateCache(u32 addr, int size, GPUInvalidationType type) override;
|
||||
|
||||
+4
-2
@@ -1690,7 +1690,8 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
|
||||
if (PSP_IsInited() && !skipBufferEffects) {
|
||||
_dbg_assert_(gpu);
|
||||
gpu->BeginHostFrame(displayLayoutConfig);
|
||||
gpu->CopyDisplayToOutput(displayLayoutConfig, true);
|
||||
gpu->SetCurFramebufferDirty(true);
|
||||
gpu->CopyDisplayToOutput(displayLayoutConfig);
|
||||
gpu->EndHostFrame();
|
||||
}
|
||||
if (gpu && gpu->PresentedThisFrame()) {
|
||||
@@ -1803,7 +1804,8 @@ ScreenRenderFlags EmuScreen::RunEmulation(ScreenRenderMode mode, bool framebuffe
|
||||
// This won't work in non-buffered, but that's fine.
|
||||
if (!framebufferBound && PSP_IsInited()) {
|
||||
// draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, clearColor }, "EmuScreen_Stepping");
|
||||
gpu->CopyDisplayToOutput(displayLayoutConfig, true);
|
||||
gpu->SetCurFramebufferDirty(true);
|
||||
gpu->CopyDisplayToOutput(displayLayoutConfig);
|
||||
framebufferBound = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,8 +268,10 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, const
|
||||
if (draw) {
|
||||
draw->BindFramebufferAsRenderTarget(nullptr, { Draw::RPAction::CLEAR, Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE }, "Headless");
|
||||
// Vulkan may get angry if we don't do a final present.
|
||||
if (gpu)
|
||||
gpu->CopyDisplayToOutput(g_Config.GetDisplayLayoutConfig(DeviceOrientation::Landscape), true);
|
||||
if (gpu) {
|
||||
gpu->SetCurFramebufferDirty(true);
|
||||
gpu->CopyDisplayToOutput(g_Config.GetDisplayLayoutConfig(DeviceOrientation::Landscape));
|
||||
}
|
||||
|
||||
draw->EndFrame();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user