mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Merge pull request #17335 from hrydgard/vulkan-fast-forward-mac
Vulkan fastforward: Check the current presentation mode instead of the Vsync setting
This commit is contained in:
commit
5fef404946
@ -75,6 +75,10 @@ public:
|
||||
return (uint32_t)ShaderLanguage::HLSL_D3D11;
|
||||
}
|
||||
uint32_t GetDataFormatSupport(DataFormat fmt) const override;
|
||||
PresentationMode GetPresentationMode() const override {
|
||||
// TODO: Fix. Not yet used.
|
||||
return PresentationMode::FIFO;
|
||||
}
|
||||
|
||||
InputLayout *CreateInputLayout(const InputLayoutDesc &desc) override;
|
||||
DepthStencilState *CreateDepthStencilState(const DepthStencilStateDesc &desc) override;
|
||||
|
@ -514,6 +514,10 @@ public:
|
||||
return (uint32_t)ShaderLanguage::HLSL_D3D9;
|
||||
}
|
||||
uint32_t GetDataFormatSupport(DataFormat fmt) const override;
|
||||
PresentationMode GetPresentationMode() const override {
|
||||
// TODO: Fix. Not yet used.
|
||||
return PresentationMode::FIFO;
|
||||
}
|
||||
|
||||
ShaderModule *CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t dataSize, const char *tag) override;
|
||||
DepthStencilState *CreateDepthStencilState(const DepthStencilStateDesc &desc) override;
|
||||
|
@ -346,6 +346,11 @@ public:
|
||||
renderManager_.SetErrorCallback(callback, userdata);
|
||||
}
|
||||
|
||||
PresentationMode GetPresentationMode() const override {
|
||||
// TODO: Fix. Not yet used.
|
||||
return PresentationMode::FIFO;
|
||||
}
|
||||
|
||||
DepthStencilState *CreateDepthStencilState(const DepthStencilStateDesc &desc) override;
|
||||
BlendState *CreateBlendState(const BlendStateDesc &desc) override;
|
||||
SamplerState *CreateSamplerState(const SamplerStateDesc &desc) override;
|
||||
|
@ -398,6 +398,16 @@ public:
|
||||
}
|
||||
uint32_t GetDataFormatSupport(DataFormat fmt) const override;
|
||||
|
||||
PresentationMode GetPresentationMode() const override {
|
||||
switch (vulkan_->GetPresentMode()) {
|
||||
case VK_PRESENT_MODE_FIFO_KHR: return PresentationMode::FIFO;
|
||||
case VK_PRESENT_MODE_FIFO_RELAXED_KHR: return PresentationMode::FIFO_RELAXED;
|
||||
case VK_PRESENT_MODE_IMMEDIATE_KHR: return PresentationMode::IMMEDIATE;
|
||||
case VK_PRESENT_MODE_MAILBOX_KHR: return PresentationMode::MAILBOX;
|
||||
default: return PresentationMode::FIFO;
|
||||
}
|
||||
}
|
||||
|
||||
DepthStencilState *CreateDepthStencilState(const DepthStencilStateDesc &desc) override;
|
||||
BlendState *CreateBlendState(const BlendStateDesc &desc) override;
|
||||
InputLayout *CreateInputLayout(const InputLayoutDesc &desc) override;
|
||||
|
@ -652,6 +652,13 @@ enum class DebugFlags {
|
||||
};
|
||||
ENUM_CLASS_BITOPS(DebugFlags);
|
||||
|
||||
enum class PresentationMode {
|
||||
FIFO,
|
||||
FIFO_RELAXED,
|
||||
IMMEDIATE,
|
||||
MAILBOX,
|
||||
};
|
||||
|
||||
class DrawContext {
|
||||
public:
|
||||
virtual ~DrawContext();
|
||||
@ -666,6 +673,8 @@ public:
|
||||
virtual std::vector<std::string> GetExtensionList() const { return std::vector<std::string>(); }
|
||||
virtual std::vector<std::string> GetDeviceList() const { return std::vector<std::string>(); }
|
||||
|
||||
virtual PresentationMode GetPresentationMode() const = 0;
|
||||
|
||||
// Describes the primary shader language that this implementation prefers.
|
||||
const ShaderLanguageDesc &GetShaderLanguageDesc() {
|
||||
return shaderLanguageDesc_;
|
||||
|
@ -546,8 +546,12 @@ void __DisplayFlip(int cyclesLate) {
|
||||
bool duplicateFrames = g_Config.bRenderDuplicateFrames && g_Config.iFrameSkip == 0;
|
||||
|
||||
bool fastForwardSkipFlip = g_Config.iFastForwardMode != (int)FastForwardMode::CONTINUOUS;
|
||||
if (g_Config.bVSync && GetGPUBackend() == GPUBackend::VULKAN) {
|
||||
|
||||
bool fifo = gpu && gpu->GetDrawContext() && gpu->GetDrawContext()->GetPresentationMode() == Draw::PresentationMode::FIFO;
|
||||
|
||||
if (fifo && GetGPUBackend() == GPUBackend::VULKAN) {
|
||||
// Vulkan doesn't support the interval setting, so we force skipping the flip.
|
||||
// TODO: We'll clean this up in a more backend-independent way later.
|
||||
fastForwardSkipFlip = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user