-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
render: properly release rendered buffers #9807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render: properly release rendered buffers #9807
Conversation
b63c4cc
to
57d9342
Compare
9e327ef
to
d7f7552
Compare
merge after #9806 (i"ll rebase this to main then) |
As long as this pr moves from syncrelease/fd signaling to wayland eventloop/waiter releasing its going to get a no from me, as mentioned earlier it means moving from as early as possible at as correct time release possible to cpu based wait in the crowded wayland eventloop which makes it always out of time. and since this isnt per se fixing anything im not settling for a potential slower approach. |
we're still using fd signaling, just not syncrelease Hyprland/src/render/Renderer.cpp Lines 2269 to 2277 in e216468
also previously we didn't release non-drmsynobj dmabuf buffers when rendering finished, |
well previously it accounted for both the release point fd and eglsync fd, it merged those and imported it. now it only accounts for the eglsync fd and ignores if the releasepoint fd is signaled, it was also previously signaling on destruction if the buffer wasnt rendered. |
hm let me rethink that, it seems we were merely merging the eglsync fd if a new appeared before it was released. can we render the same buffer multiple times before its actually dropped? what happends if the client is at 30fps on a 60hz monitor. is the same buffer supposed to be rendered multiple times and the eglsync just merged until finally dropped? |
a31912a
to
6b1f947
Compare
6b1f947
to
1e92f15
Compare
rebased to main, should be ready (btw nix compilation issue is prob from wayland-protocols dep)
edit: |
@ikalco updated w-p, a rebase on main should fix the build. |
1e92f15
to
16562fb
Compare
2bb421c
to
f27c877
Compare
generally ok by me but I'll test run it a bit tomorrow |
also can you rebase on main |
ignore that lmao, was on wrong the local branch |
aeb4395
to
eb603e4
Compare
generally works alright on my end, has anyone else tested other configs? |
besides my above comment that im not sure is even correct in -git either, was wondering what happends if the buffers for a client is slower then the rendering of the monitor. eglsync is now a local variable to endRender(), if destructed is the fd still valid if so? will it artifact if so? , on -git it might just have hidden it more being a member variable to the monitor and not destructing until the next endRender() , otherwise i got no objections |
I checked civ4 tearing and it was like 40fps and my screen is 240hz and it looked just fine? or do you mean with direct scanout |
More of a late night phone wondering, try both i guess. |
with eglsync you should dupe the fence fd |
huh? do you mean steam fps counter shows 40fps but screen looks like 240fps during DS? |
Yeah but isnt eglsync duping the EGLSyncKHR fd, storing it, and then you are duping the duped fd, and when endrender goes out of scope the fds is dead i think, no matter if its signaled or not |
as discussed on discord, this should be fine. the fd acts as a ref count for the kernel dma fence. so in the end this shouldnt be wrong. im satisfied. 👍 |
Describe your PR, what does it fix/add?
as title says, this pr intends to properly do buffer release when rendering by
renderingDoneCallback
, which can be useful for some purposes like screencopyIs there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Is it ready for merging, or does it need work?
yea