handle the Occluded case directly within TryGetCurrentTexture#1
Conversation
…e it does NOT require reconfiguring the surface, and it DOES require calling glfw.PollEvents -- which others would not presumably.
|
ps. this is referencing the discussion in: cogentcore#13 and the upstream change that added the Occluded status in the first place, in v29 of wgpu: gfx-rs/wgpu#9430 |
|
@oliverbestmann any chance you could take a look at this soon? resolving this would allow me to move forward with using this in cogentcore. |
|
Sorry, I'll have a look in a second. I didn't see this here at all |
|
I'll merge this for now, but I think I might be reworking this in the future. I don't like that this forces you to use glfw for your windowing/input library. |
|
Yeah, it would be best if somehow the critical underlying fuction(s) that PollEvents is calling that allow things to proceed could be called directly. But who knows what those are? And in general, this is what the metal driver in the rust wgpu code should be doing on its own, without bothering us with this level of management. Probably makes sense to wait and see what they end up deciding to do with this all, before trying to do something else. |
|
ps. @oliverbestmann are you going to commit a tag for this version? :) |
|
@oliverbestmann actually there is a real problem with this version -- you should undo it! Sorry! The problem is that the glfw.PollEvents can only be called from the main thread, but this is not a restriction for the parent TryGetCurrentTexture function, so indeed one has to handle it separately! |
|
I only discovered this in my more complex live cogentcore code, where unlike the simple examples, there are multiple goroutines handing everything. |
|
Haha, yea okay, I've reverted your commit and tagged v1.33.2. |
|
Looks like that tag didn't make it up to github? |
|
Sorry, should be there now. I'll try to add some automation soon. |
Occluded status does NOT require reconfiguring the surface, and it DOES require calling glfw.PollEvents, while other status situations (Lost, Outdated, Suboptimal, etc) DO require reconfiguring.
And the Occluded case is (currently) effectively unavoidable on mac, so this allows most code to work fine without specifically doing anything for the more complicated case of having to reconfigure.
In any case, adding the SurfaceTexture with the status is a nice addition for those other cases.