Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where PresentedThisFrame didn't work correctly on SoftGPU #19532

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading