VideoBackends:Metal: Add config option to use presentDrawable
This commit is contained in:
parent
5a1b90c7f3
commit
a13f09433c
|
@ -94,6 +94,8 @@ const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE{
|
||||||
|
|
||||||
const Info<TriState> GFX_MTL_MANUALLY_UPLOAD_BUFFERS{
|
const Info<TriState> GFX_MTL_MANUALLY_UPLOAD_BUFFERS{
|
||||||
{System::GFX, "Settings", "ManuallyUploadBuffers"}, TriState::Auto};
|
{System::GFX, "Settings", "ManuallyUploadBuffers"}, TriState::Auto};
|
||||||
|
const Info<bool> GFX_MTL_USE_PRESENT_DRAWABLE{{System::GFX, "Settings", "MTLUsePresentDrawable"},
|
||||||
|
false};
|
||||||
|
|
||||||
const Info<bool> GFX_SW_DUMP_OBJECTS{{System::GFX, "Settings", "SWDumpObjects"}, false};
|
const Info<bool> GFX_SW_DUMP_OBJECTS{{System::GFX, "Settings", "SWDumpObjects"}, false};
|
||||||
const Info<bool> GFX_SW_DUMP_TEV_STAGES{{System::GFX, "Settings", "SWDumpTevStages"}, false};
|
const Info<bool> GFX_SW_DUMP_TEV_STAGES{{System::GFX, "Settings", "SWDumpTevStages"}, false};
|
||||||
|
|
|
@ -76,6 +76,7 @@ extern const Info<int> GFX_SHADER_PRECOMPILER_THREADS;
|
||||||
extern const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE;
|
extern const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE;
|
||||||
|
|
||||||
extern const Info<TriState> GFX_MTL_MANUALLY_UPLOAD_BUFFERS;
|
extern const Info<TriState> GFX_MTL_MANUALLY_UPLOAD_BUFFERS;
|
||||||
|
extern const Info<bool> GFX_MTL_USE_PRESENT_DRAWABLE;
|
||||||
|
|
||||||
extern const Info<bool> GFX_SW_DUMP_OBJECTS;
|
extern const Info<bool> GFX_SW_DUMP_OBJECTS;
|
||||||
extern const Info<bool> GFX_SW_DUMP_TEV_STAGES;
|
extern const Info<bool> GFX_SW_DUMP_TEV_STAGES;
|
||||||
|
|
|
@ -455,6 +455,13 @@ void Metal::Renderer::PresentBackbuffer()
|
||||||
g_state_tracker->EndRenderPass();
|
g_state_tracker->EndRenderPass();
|
||||||
if (m_drawable)
|
if (m_drawable)
|
||||||
{
|
{
|
||||||
|
// PresentDrawable refuses to allow Dolphin to present faster than the display's refresh rate
|
||||||
|
// when windowed (or fullscreen with vsync enabled, but that's more understandable).
|
||||||
|
// On the other hand, it helps Xcode's GPU captures start and stop on frame boundaries
|
||||||
|
// which is convenient. Put it here as a default-off config, which we can override in Xcode.
|
||||||
|
if (g_ActiveConfig.bUsePresentDrawable)
|
||||||
|
[g_state_tracker->GetRenderCmdBuf() presentDrawable:m_drawable];
|
||||||
|
else
|
||||||
[g_state_tracker->GetRenderCmdBuf()
|
[g_state_tracker->GetRenderCmdBuf()
|
||||||
addScheduledHandler:[drawable = std::move(m_drawable)](id) { [drawable present]; }];
|
addScheduledHandler:[drawable = std::move(m_drawable)](id) { [drawable present]; }];
|
||||||
m_bb_texture->SetMTLTexture(nullptr);
|
m_bb_texture->SetMTLTexture(nullptr);
|
||||||
|
|
|
@ -56,6 +56,7 @@ void VideoConfig::Refresh()
|
||||||
bVSync = Config::Get(Config::GFX_VSYNC);
|
bVSync = Config::Get(Config::GFX_VSYNC);
|
||||||
iAdapter = Config::Get(Config::GFX_ADAPTER);
|
iAdapter = Config::Get(Config::GFX_ADAPTER);
|
||||||
iManuallyUploadBuffers = Config::Get(Config::GFX_MTL_MANUALLY_UPLOAD_BUFFERS);
|
iManuallyUploadBuffers = Config::Get(Config::GFX_MTL_MANUALLY_UPLOAD_BUFFERS);
|
||||||
|
bUsePresentDrawable = Config::Get(Config::GFX_MTL_USE_PRESENT_DRAWABLE);
|
||||||
|
|
||||||
bWidescreenHack = Config::Get(Config::GFX_WIDESCREEN_HACK);
|
bWidescreenHack = Config::Get(Config::GFX_WIDESCREEN_HACK);
|
||||||
aspect_mode = Config::Get(Config::GFX_ASPECT_RATIO);
|
aspect_mode = Config::Get(Config::GFX_ASPECT_RATIO);
|
||||||
|
|
|
@ -157,6 +157,7 @@ struct VideoConfig final
|
||||||
|
|
||||||
// Metal only config
|
// Metal only config
|
||||||
TriState iManuallyUploadBuffers = TriState::Auto;
|
TriState iManuallyUploadBuffers = TriState::Auto;
|
||||||
|
bool bUsePresentDrawable = false;
|
||||||
|
|
||||||
// Enable API validation layers, currently only supported with Vulkan.
|
// Enable API validation layers, currently only supported with Vulkan.
|
||||||
bool bEnableValidationLayer = false;
|
bool bEnableValidationLayer = false;
|
||||||
|
|
Loading…
Reference in New Issue