renderer: skip ds commits if buffer didn't change (#9556)
this fixes direct scanout glitches by ensuring that attemptDirectScanout doesn't try to recommit the same buffer to AQ which would cause a pageflip event and the backendRelease to release the same buffer too early
This commit is contained in:
parent
f15b49e0fd
commit
d30cc19d25
5 changed files with 54 additions and 61 deletions
|
|
@ -26,9 +26,14 @@ bool IHLBuffer::locked() {
|
|||
return nLocks > 0;
|
||||
}
|
||||
|
||||
void IHLBuffer::unlockOnBufferRelease(WP<CWLSurfaceResource> surf) {
|
||||
hlEvents.backendRelease = events.backendRelease.registerListener([this](std::any data) {
|
||||
unlock();
|
||||
void IHLBuffer::onBackendRelease(const std::function<void()>& fn) {
|
||||
if (hlEvents.backendRelease) {
|
||||
hlEvents.backendRelease->emit(nullptr);
|
||||
Debug::log(LOG, "backendRelease emitted early");
|
||||
}
|
||||
|
||||
hlEvents.backendRelease = events.backendRelease.registerListener([this, fn](std::any) {
|
||||
fn();
|
||||
hlEvents.backendRelease.reset();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class IHLBuffer : public Aquamarine::IBuffer {
|
|||
virtual void unlock();
|
||||
virtual bool locked();
|
||||
|
||||
void unlockOnBufferRelease(WP<CWLSurfaceResource> surf /* optional */);
|
||||
void onBackendRelease(const std::function<void()>& fn);
|
||||
|
||||
SP<CTexture> texture;
|
||||
bool opaque = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue