Skip to content

Commit

Permalink
steamcompmtr: Fix hacky blank texture in nested
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Nov 21, 2023
1 parent f1646ee commit abdc97e
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
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++;

FrameInfo_t::Layer_t *layer = &frameInfo.layers[ curLayer ];
FrameInfo_t::Layer_t *layer = &frameInfo.layers[ curLayer ];

auto tex = vulkan_get_hacky_blank_texture();

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->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->colorspace = GAMESCOPE_APP_TEXTURE_COLORSPACE_LINEAR;
layer->ctm = nullptr;
layer->tex = tex;
layer->fbid = tex->fbid();

layer->filter = GamescopeUpscaleFilter::NEAREST;
layer->blackBorder = true;
layer->filter = GamescopeUpscaleFilter::NEAREST;
layer->blackBorder = true;
}
}

if (notification)
Expand Down

0 comments on commit abdc97e

Please sign in to comment.