add opengl implementation and link to ui

This commit is contained in:
KojoZero 2026-03-12 04:42:14 -07:00
parent 8694533891
commit 367a38bdea
3 changed files with 8 additions and 3 deletions

View File

@ -320,10 +320,10 @@
<item>
<widget class="QCheckBox" name="toggle_skip_duplicate_frames">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skips presenting duplicated frames in 30fps games. This allows external frame generation tools to work correctly in 30fps games. This does not boost performance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This detects and skips the presentation of frames that are not unique. It also allows external frame generation tools to work correctly with 30fps games. Works in OpenGL and Vulkan.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Skip Duplicate Frame Display</string>
<string>Skip Presenting Duplicate Frames</string>
</property>
</widget>
</item>

View File

@ -196,6 +196,7 @@ void RendererOpenGL::PrepareRendertarget() {
void RendererOpenGL::RenderToMailbox(const Layout::FramebufferLayout& layout,
std::unique_ptr<Frontend::TextureMailbox>& mailbox,
bool flipped) {
if ((Core::PerfStats::game_frames_updated && Settings::values.use_skip_duplicate_frames.GetValue()) || !Settings::values.use_skip_duplicate_frames.GetValue()){
Frontend::Frame* frame;
{
@ -241,6 +242,9 @@ void RendererOpenGL::RenderToMailbox(const Layout::FramebufferLayout& layout,
glFlush();
mailbox->ReleaseRenderFrame(frame);
}
Core::PerfStats::game_frames_updated = false;
}
}
/**

View File

@ -236,7 +236,8 @@ void RendererVulkan::PrepareDraw(Frame* frame, const Layout::FramebufferLayout&
void RendererVulkan::RenderToWindow(PresentWindow& window, const Layout::FramebufferLayout& layout,
bool flipped) {
if (Core::PerfStats::game_frames_updated){
if ((Core::PerfStats::game_frames_updated && Settings::values.use_skip_duplicate_frames.GetValue()) || !Settings::values.use_skip_duplicate_frames.GetValue()){
Frame* frame = window.GetRenderFrame();
if (layout.width != frame->width || layout.height != frame->height) {