-
Notifications
You must be signed in to change notification settings - Fork 145
kms/surface: Call cleanup_texture_cache
for each device at end of draw
#1442
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
Conversation
Hm, I seem to be seeing some issues, seemingly related to this, with Intel surfaces on the Nvidia output suddenly turning black? I don't think it should be invalid to call |
Looks like most of the issues here are from the As noted in https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glDeleteSync.xhtml, it should be "flagged for deletion and will be deleted when it is no longer associated with any fence command and is no longer blocking any glWaitSync or glClientWaitSync command", so I don't think this should cause any observable behavior change... |
I guess it's not too much of a surprise if our code for synchronizing reads/writes between contexts still isn't quite right. It seems the |
No absolutely not, the api is intended exactly for this use-case. So there has to be something wrong with our (admittedly very new) GL synchronization code. |
Looks like it may help to change Though synchronization issues aren't consistent, so that isn't necessary the correct fix. It might make sense if In general, reading through the synchronization code, it looks like things should be synchronized properly. I still don't see obvious issues. |
That might break some multi-gpu use cases, where I am pretty sure we can end up needing to synchronize on the CPU.
In general it should. It is like expecting |
https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf
That does indeed make it sound like waiting for the work on one context to be done with So yeah, the synchronization does all look right. |
Fixes an issue where a dual GPU system would keep allocating dGPU PBOs in `cpu_copy()` every frame, but `cleanup()` was not being called, since the surface thread for the builtin output was rendered on the primary/integrated GPU, targeting the same GPU. Even if a different monitor was compositing on the dGPU, That wouldn't help since that thread has it's own `GpuManager` with it's own renderer and cache. Running cleanup at the end (or start) of each frame seems like a good idea. Not sure if it would be best to avoid additional calls, or if that's desirable/fine.
As far as I can tell, Smithay/smithay#1748 fixes the issue I've been seeing here. If people have been seeing similar behavior in other circumstances, it may fix that too. |
c8b927d
to
31ff4df
Compare
Added a commit to update |
Fixes an issue where a dual GPU system would keep allocating dGPU PBOs in
cpu_copy()
every frame, butcleanup()
was not being called, since the surface thread for the builtin output was rendered on the primary/integrated GPU, targeting the same GPU.Even if a different monitor was compositing on the dGPU, That wouldn't help since that thread has it's own
GpuManager
with it's own renderer and cache.Running cleanup at the end (or start) of each frame seems like a good idea. Not sure if it would be best to avoid additional calls, or if that's desirable/fine.