fix: GPU capture button not working

This commit is contained in:
Samuliak 2025-01-04 17:02:03 +01:00
parent 813c52c23c
commit 337ec6b721
No known key found for this signature in database
2 changed files with 7 additions and 10 deletions

View File

@ -188,6 +188,9 @@ MetalRenderer::MetalRenderer()
m_copyBufferToBufferPipeline = new MetalVoidVertexPipeline(this, utilityLibrary, "vertexCopyBufferToBuffer");
utilityLibrary->release();
// HACK: for some reason, this variable ends up being initialized to some garbage data, even though its declared as bool m_captureFrame = false;
m_captureFrame = false;
}
MetalRenderer::~MetalRenderer()

View File

@ -1013,16 +1013,10 @@ void MainWindow::OnDebugSetting(wxCommandEvent& event)
}
else if (event.GetId() == MAINFRAME_MENU_ID_DEBUG_GPU_CAPTURE)
{
cemu_assert_debug(g_renderer->GetType() == RendererAPI::Metal);
#if ENABLE_METAL
if (g_renderer->GetType() == RendererAPI::Metal)
{
static_cast<MetalRenderer*>(g_renderer.get())->CaptureFrame();
}
else
{
wxMessageBox(_("GPU capture is only supported on Metal."), _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
return;
}
static_cast<MetalRenderer*>(g_renderer.get())->CaptureFrame();
#endif
}
else if (event.GetId() == MAINFRAME_MENU_ID_DEBUG_AUDIO_AUX_ONLY)
@ -2272,7 +2266,7 @@ void MainWindow::RecreateMenu()
auto accurateBarriers = debugMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_VK_ACCURATE_BARRIERS, _("&Accurate barriers (Vulkan)"), wxEmptyString);
accurateBarriers->Check(GetConfig().vk_accurate_barriers);
auto gpuCapture = debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VK_ACCURATE_BARRIERS, _("&GPU capture (Metal)"), wxEmptyString);
auto gpuCapture = debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_GPU_CAPTURE, _("&GPU capture (Metal)"));
gpuCapture->Enable(m_game_launched && g_renderer->GetType() == RendererAPI::Metal);
debugMenu->AppendSeparator();