Revert "Remove useless texture size queries for every frame in display_ram_t"

This reverts commit ebe01ce20b.

Looks like this commit undos the fix for #453, see also PRs #649 and #884.

This also adds a comment so hopefully it doesn't get removed again in
the future (or a proper fix is found).
This commit is contained in:
Kelvie Wong 2024-01-24 15:13:49 -08:00 committed by Cameron Gutman
commit 3f31400e7f
2 changed files with 15 additions and 1 deletions

View file

@ -182,6 +182,13 @@ namespace wl {
}
gl::ctx.BindTexture(GL_TEXTURE_2D, (*rgb_opt)->tex[0]);
// Don't remove these lines, see https://github.com/LizardByte/Sunshine/issues/453
int w, h;
gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
BOOST_LOG(debug) << "width and height: w "sv << w << " h "sv << h;
gl::ctx.GetTextureSubImage((*rgb_opt)->tex[0], 0, 0, 0, 0, width, height, 1, GL_BGRA, GL_UNSIGNED_BYTE, img_out->height * img_out->row_pitch, img_out->data);
gl::ctx.BindTexture(GL_TEXTURE_2D, 0);