From abdc97e796a3bd22ed767895cbf460ade8ebf811 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 17 Nov 2023 02:21:01 -0800 Subject: [PATCH] steamcompmtr: Fix hacky blank texture in nested --- src/steamcompmgr.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 1c19178..c4638db 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -2542,29 +2542,32 @@ paint_all(bool async) } else { - // HACK! HACK HACK HACK - // To avoid stutter when toggling the overlay on - int curLayer = frameInfo.layerCount++; - - FrameInfo_t::Layer_t *layer = &frameInfo.layers[ curLayer ]; - auto tex = vulkan_get_hacky_blank_texture(); + if ( !BIsNested() && tex != nullptr ) + { + // HACK! HACK HACK HACK + // To avoid stutter when toggling the overlay on + int curLayer = frameInfo.layerCount++; - layer->scale.x = g_nOutputWidth == tex->width() ? 1.0f : tex->width() / (float)g_nOutputWidth; - layer->scale.y = g_nOutputHeight == tex->height() ? 1.0f : tex->height() / (float)g_nOutputHeight; - layer->offset.x = 0.0f; - layer->offset.y = 0.0f; - layer->opacity = 1.0f; // BLAH - layer->zpos = g_zposOverlay; - layer->applyColorMgmt = g_ColorMgmt.pending.enabled; + FrameInfo_t::Layer_t *layer = &frameInfo.layers[ curLayer ]; - layer->colorspace = GAMESCOPE_APP_TEXTURE_COLORSPACE_LINEAR; - layer->ctm = nullptr; - layer->tex = tex; - layer->fbid = tex->fbid(); - layer->filter = GamescopeUpscaleFilter::NEAREST; - layer->blackBorder = true; + layer->scale.x = g_nOutputWidth == tex->width() ? 1.0f : tex->width() / (float)g_nOutputWidth; + layer->scale.y = g_nOutputHeight == tex->height() ? 1.0f : tex->height() / (float)g_nOutputHeight; + layer->offset.x = 0.0f; + layer->offset.y = 0.0f; + layer->opacity = 1.0f; // BLAH + layer->zpos = g_zposOverlay; + layer->applyColorMgmt = g_ColorMgmt.pending.enabled; + + layer->colorspace = GAMESCOPE_APP_TEXTURE_COLORSPACE_LINEAR; + layer->ctm = nullptr; + layer->tex = tex; + layer->fbid = tex->fbid(); + + layer->filter = GamescopeUpscaleFilter::NEAREST; + layer->blackBorder = true; + } } if (notification)