Address feedback

This commit is contained in:
Henrik Rydgård 2023-08-14 11:01:00 +02:00
parent 50f4e4b1fd
commit 1b2cffe632
5 changed files with 15 additions and 11 deletions

View File

@ -769,13 +769,18 @@ const char *Bugs::GetBugName(uint32_t bug) {
}
const char *PresentModeToString(PresentMode presentMode) {
// All 8 possible cases, with three flags, for simplicity.
switch (presentMode) {
case (PresentMode)0: return "NONE (bad)";
case (PresentMode)0: return "NONE";
case PresentMode::FIFO: return "FIFO";
case PresentMode::IMMEDIATE: return "IMMEDIATE";
case PresentMode::MAILBOX: return "MAILBOX";
case (PresentMode)((int)PresentMode::FIFO | (int)PresentMode::MAILBOX) : return "FIFO|MAILBOX";
case (PresentMode)((int)PresentMode::FIFO | (int)PresentMode::IMMEDIATE) : return "FIFO|IMMEDIATE";
case (PresentMode)((int)PresentMode::MAILBOX | (int)PresentMode::IMMEDIATE) : return "MAILBOX|IMMEDIATE"; // Not gonna happen
case (PresentMode)((int)PresentMode::FIFO | (int)PresentMode::MAILBOX | (int)PresentMode::IMMEDIATE) : return "FIFO|MAILBOX|IMMEDIATE";
default:
return "COMBO"; // TODO: Hardcode all the combinations?
return "INVALID";
}
}

View File

@ -623,7 +623,7 @@ struct DeviceCaps {
// Presentation caps
int presentMaxInterval; // 1 on many backends
bool presentInstantModeChange; // Our VulkanContext doesn't currently support it so we mark it as such, but it can be supported with careful coding.
bool presentInstantModeChange;
PresentMode presentModesSupported;
u32 multiSampleLevelsMask; // Bit n is set if (1 << n) is a valid multisample level. Bit 0 is always set.

View File

@ -52,6 +52,7 @@ Draw::PresentMode ComputePresentMode(Draw::DrawContext *draw, int *interval) {
limit = PSP_CoreParameter().analogFpsLimit;
// For an alternative speed that is a clean factor of 60, the user probably still wants vsync.
// TODO: Should take the user's display refresh rate into account...
if (limit == 0 || (limit >= 0 && limit != 15 && limit != 30 && limit != 60)) {
wantInstant = true;
}
@ -63,8 +64,8 @@ Draw::PresentMode ComputePresentMode(Draw::DrawContext *draw, int *interval) {
wantInstant = false;
}
// If no instant modes are supported, stick to FIFO.
if (wantInstant && (draw->GetDeviceCaps().presentModesSupported & (Draw::PresentMode::MAILBOX | Draw::PresentMode::IMMEDIATE))) {
// The outer if checks that instant modes are available.
if (wantInstant) {
mode = GetBestImmediateMode(draw->GetDeviceCaps().presentModesSupported);
}
}

View File

@ -846,8 +846,8 @@ namespace MIPSComp {
case VecDo3Op::VSLT:
allowSIMD = false;
break;
default:
break;
case VecDo3Op::INVALID: // Can't happen, but to avoid compiler warnings
break;
}
u8 sregs[4], tregs[4], dregs[4];
@ -943,8 +943,8 @@ namespace MIPSComp {
ir.Write(IROp::FMovFromGPR, tempregs[i], IRTEMP_1);
ir.Write(IROp::FCvtSW, tempregs[i], tempregs[i]);
break;
default:
break;
case VecDo3Op::INVALID: // Can't happen, but to avoid compiler warnings
break;
}
}

View File

@ -165,8 +165,6 @@ bool GLDummyGraphicsContext::InitFromRenderThread(std::string *errorMessage) {
renderManager_->SetSwapFunction([&]() {
SDL_GL_SwapWindow(screen_);
});
// TODO: Support SwapInterval
return success;
}