mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-24 21:37:41 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a65592a64 | |||
| 989768aa46 |
@@ -7,6 +7,7 @@
|
|||||||
# Build directory
|
# Build directory
|
||||||
/[Bb]uild*/
|
/[Bb]uild*/
|
||||||
doc-build/
|
doc-build/
|
||||||
|
out/
|
||||||
AppDir/
|
AppDir/
|
||||||
uruntime
|
uruntime
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,21 @@ u32 HardwareComposer::ComposeLocked(f32* out_speed_scale, Display& display,
|
|||||||
// Set default speed limit to 100%.
|
// Set default speed limit to 100%.
|
||||||
*out_speed_scale = 1.0f;
|
*out_speed_scale = 1.0f;
|
||||||
|
|
||||||
|
// If no layers are visible, skip the logic. Acquiring and holding buffers here would
|
||||||
|
// consume the producer's queue without ever presenting.
|
||||||
|
bool any_visible = false;
|
||||||
|
for (auto& layer : display.stack.layers) {
|
||||||
|
if (layer->visible) {
|
||||||
|
any_visible = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!any_visible) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for the previous composite, bounding the number of in-flight composites.
|
||||||
nvdisp.WaitForComposite();
|
nvdisp.WaitForComposite();
|
||||||
this->ReleaseFramebuffersLocked(display);
|
|
||||||
|
|
||||||
// Determine the number of vsync periods to wait before composing again.
|
// Determine the number of vsync periods to wait before composing again.
|
||||||
std::optional<s32> swap_interval{};
|
std::optional<s32> swap_interval{};
|
||||||
@@ -152,6 +165,13 @@ u32 HardwareComposer::ComposeLocked(f32* out_speed_scale, Display& display,
|
|||||||
// Advance by 1 frame (60 FPS compositing)
|
// Advance by 1 frame (60 FPS compositing)
|
||||||
m_frame_number += 1;
|
m_frame_number += 1;
|
||||||
|
|
||||||
|
// Release framebuffers once the frame has been handed to the compositor. This happens
|
||||||
|
// within the same vsync period as the acquire (release_frame_number is checked against
|
||||||
|
// the advanced counter), so the producer gets its buffers back immediately instead of
|
||||||
|
// losing a queue slot for a whole frame.
|
||||||
|
// TODO: support release fences; releasing before the composite has finished can tear.
|
||||||
|
this->ReleaseFramebuffersLocked(display);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user