steamcompmgr: Make out of screenshot images not fatal

This shouldn't crash...
This commit is contained in:
Joshua Ashton 2023-11-07 16:19:48 +00:00
parent 1d468679da
commit 10d28b9cb3

View file

@ -2824,8 +2824,8 @@ paint_all(bool async)
std::shared_ptr<CVulkanTexture> pScreenshotTexture = vulkan_acquire_screenshot_texture(g_nOutputWidth, g_nOutputHeight, false, drmCaptureFormat);
assert( pScreenshotTexture != nullptr );
if ( pScreenshotTexture )
{
// Basically no color mgmt applied for screenshots. (aside from being able to handle HDR content with LUTs)
for ( uint32_t nInputEOTF = 0; nInputEOTF < EOTF_Count; nInputEOTF++ )
{
@ -2933,6 +2933,13 @@ paint_all(bool async)
takeScreenshot = false;
}
else
{
xwm_log.errorf( "Oh no, we ran out of screenshot images. Not actually writing a screenshot." );
XDeleteProperty( root_ctx->dpy, root_ctx->root, root_ctx->atoms.gamescopeScreenShotAtom );
takeScreenshot = false;
}
}
gpuvis_trace_end_ctx_printf( paintID, "paint_all" );
gpuvis_trace_printf( "paint_all %i layers, composite %i", (int)frameInfo.layerCount, bDoComposite );