Skip to content

Commit

Permalink
Fix issue where PresentedThisFrame didn't work on SoftGPU, causing is…
Browse files Browse the repository at this point in the history
…sues
  • Loading branch information
hrydgard committed Oct 16, 2024
1 parent ae640f8 commit 7f097d8
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
4 changes: 0 additions & 4 deletions GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,6 @@ void GPUCommon::PSPFrame() {
GPURecord::NotifyBeginFrame();
}

bool GPUCommon::PresentedThisFrame() const {
return framebufferManager_ ? framebufferManager_->PresentedThisFrame() : true;
}

void GPUCommon::SlowRunLoop(DisplayList &list) {
const bool dumpThisFrame = dumpThisFrame_;
while (downcount > 0) {
Expand Down
2 changes: 0 additions & 2 deletions GPU/GPUCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface {
fullInfo = reportingFullInfo_;
}

bool PresentedThisFrame() const override;

protected:
void ClearCacheNextFrame() override {}

Expand Down
4 changes: 4 additions & 0 deletions GPU/GPUCommonHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ void GPUCommonHW::CopyDisplayToOutput(bool reallyDirty) {
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
}

bool GPUCommonHW::PresentedThisFrame() const {
return framebufferManager_->PresentedThisFrame();
}

void GPUCommonHW::DoState(PointerWrap &p) {
GPUCommon::DoState(p);

Expand Down
2 changes: 2 additions & 0 deletions GPU/GPUCommonHW.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class GPUCommonHW : public GPUCommon {
void FastRunLoop(DisplayList &list) override;
void ExecuteOp(u32 op, u32 diff) override;

bool PresentedThisFrame() const override;

private:
void CheckDepthUsage(VirtualFramebuffer *vfb) override;
void CheckFlushOp(int cmd, u32 diff);
Expand Down
4 changes: 4 additions & 0 deletions GPU/Software/SoftGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@ void SoftGPU::CopyDisplayToOutput(bool reallyDirty) {
MarkDirty(displayFramebuf_, displayStride_, 272, displayFormat_, SoftGPUVRAMDirty::CLEAR);
}

bool SoftGPU::PresentedThisFrame() const {
return presentation_->PresentedThisFrame();
}

void SoftGPU::MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value) {
uint32_t bytes = height * stride * (fmt == GE_FORMAT_8888 ? 4 : 2);
MarkDirty(addr, bytes, value);
Expand Down
2 changes: 2 additions & 0 deletions GPU/Software/SoftGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ class SoftGPU : public GPUCommon {

typedef void (SoftGPU::*CmdFunc)(u32 op, u32 diff);

bool PresentedThisFrame() const override;

protected:
void FastRunLoop(DisplayList &list) override;
void CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight);
Expand Down
2 changes: 1 addition & 1 deletion UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ void GameSettingsScreen::CreateToolsSettings(UI::ViewGroup *tools) {

tools->Add(new ItemHeader(ms->T("Tools")));

const bool showRetroAchievements = true;
const bool showRetroAchievements = true; // System_GetPropertyInt(SYSPROP_DEVICE_TYPE) != DEVICE_TYPE_VR;
if (showRetroAchievements) {
auto retro = tools->Add(new Choice(sy->T("RetroAchievements")));
retro->OnClick.Add([=](UI::EventParams &) -> UI::EventReturn {
Expand Down

0 comments on commit 7f097d8

Please sign in to comment.