Some debug overlays don't make sense when not in-game, disable them. Minor feedback fixes.

This commit is contained in:
Henrik Rydgård 2023-08-11 15:51:54 +02:00
parent 2cdcc413b7
commit dc4de340b3
5 changed files with 15 additions and 7 deletions

View File

@ -1104,7 +1104,6 @@ VKContext::~VKContext() {
}
void VKContext::BeginFrame(DebugFlags debugFlags) {
// TODO: Bad dependency on g_Config here!
renderManager_.BeginFrame(debugFlags & DebugFlags::PROFILE_TIMESTAMPS, debugFlags & DebugFlags::PROFILE_SCOPES);
FrameData &frame = frame_[vulkan_->GetCurFrame()];

View File

@ -216,12 +216,16 @@ void Core_RunLoop(GraphicsContext *ctx) {
bool menuThrottle = (GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT;
// In case it was pending, we're not in game anymore.
double startTime = time_now_d();
double startTime;
if (menuThrottle) {
startTime = time_now_d();
}
NativeFrame(ctx);
if (menuThrottle) {
// Simple throttling to not burn the GPU in the menu.
// TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes.
double diffTime = time_now_d() - startTime;
int sleepTime = (int)(1000.0 / refreshRate) - (int)(diffTime * 1000.0);
if (sleepTime > 0)

View File

@ -6,6 +6,7 @@
#include "Core/HLE/sceSas.h"
#include "Core/ControlMapper.h"
#include "Core/Config.h"
#include "Core/System.h"
#include "GPU/GPU.h"
// TODO: This should be moved here or to Common, doesn't belong in /GPU
#include "GPU/Vulkan/DebugVisVulkan.h"
@ -164,12 +165,16 @@ void DrawControlMapperOverlay(UIContext *ctx, const Bounds &bounds, const Contro
}
void DrawDebugOverlay(UIContext *ctx, const Bounds &bounds, DebugOverlay overlay) {
bool inGame = GetUIState() == UISTATE_INGAME;
switch (overlay) {
case DebugOverlay::DEBUG_STATS:
DrawDebugStats(ctx, ctx->GetLayoutBounds());
if (!inGame)
DrawDebugStats(ctx, ctx->GetLayoutBounds());
break;
case DebugOverlay::FRAME_GRAPH:
DrawFrameTimes(ctx, ctx->GetLayoutBounds());
if (!inGame)
DrawFrameTimes(ctx, ctx->GetLayoutBounds());
break;
case DebugOverlay::FRAME_TIMING:
DrawFrameTiming(ctx, ctx->GetLayoutBounds());

View File

@ -1504,7 +1504,7 @@ bool EmuScreen::hasVisibleUI() {
if (g_Config.bEnableCardboardVR || g_Config.bEnableNetworkChat)
return true;
// Debug UI.
if ((DebugOverlay)g_Config.iDebugOverlay != DebugOverlay::OFF)
if ((DebugOverlay)g_Config.iDebugOverlay != DebugOverlay::OFF || g_Config.bShowDeveloperMenu)
return true;
// Exception information.

View File

@ -22,7 +22,7 @@ public:
DestroyDrawContext();
}
void SwapInterval(int interval) override {}
virtual void SwapBuffers() = 0;
virtual void SwapBuffers() = 0;
void Resize() override {}
virtual void GotBackbuffer();