rendervulkan: evict stale screenshot images, for reuse#2170
Conversation
|
Note: this PR supersedes #1896. |
|
This might conflict with taking a screenshot while in recording |
Fixes a crash that happened when cycling through more than 2 screen recording resolutions in the Steam client: pScreenshotImages would fill up and as a consequence a call to vulkan_acquire_screenshot_texture with a new resolution would return a null pointer.
I am indeed seeing a problem. When requesting screenshots in the AVIF format, the resulting files have always the expected dimensions (1280×800). However when requesting screenshots in the PNG format while a screencast is being recorded at a different resolution, the resulting files have either incorrect dimensions, or the dimensions are correct but the texture is repeated horizontally wrapping at the width of the current screencast. So the PNG screenshot is reusing the texture currently in use by the screencast. |
|
Okay, I can see what's going on with my change. When a PNG screenshot is requested while a screencast is ongoing, It seems that we would be much better off with two separate pools of textures, one for actual screenshots, and one for screencasts? |
This is in fact a separate problem: the PNG code path uses |
…ideo capture Avoids running out of textures when requesting a screenshot while a screen capture is ongoing. Both pools can hold two textures to account for concurrent requests in different formats or at different resolutions.
7c6c8a6 to
beccb1f
Compare
I pushed an additional commit that implements this (two separate texture pools, one for screenshots and one for screencasts). |
Fixes a crash that happened when cycling through more than 2 screen recording resolutions in the Steam client: pScreenshotImages would fill up and as a consequence a call to vulkan_acquire_screenshot_texture with a new resolution would return a null pointer.