From ff883058e680bfb7f81335f0bc4f87a329320fab Mon Sep 17 00:00:00 2001 From: Jackson Garner Date: Wed, 4 Jan 2023 07:13:09 -0700 Subject: [PATCH] Fix wayland capture on nvidia (#649) --- src/platform/linux/wlgrab.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platform/linux/wlgrab.cpp b/src/platform/linux/wlgrab.cpp index 31d5cfa0..486ed8e4 100644 --- a/src/platform/linux/wlgrab.cpp +++ b/src/platform/linux/wlgrab.cpp @@ -162,6 +162,12 @@ public: } gl::ctx.BindTexture(GL_TEXTURE_2D, (*rgb_opt)->tex[0]); + + int w, h; + gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); + gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &h); + BOOST_LOG(debug) << "width and height: w "sv << w << ' h ' << h; + gl::ctx.GetTextureSubImage((*rgb_opt)->tex[0], 0, 0, 0, 0, width, height, 1, GL_BGRA, GL_UNSIGNED_BYTE, img_out_base->height * img_out_base->row_pitch, img_out_base->data); gl::ctx.BindTexture(GL_TEXTURE_2D, 0); @@ -366,4 +372,4 @@ std::vector wl_display_names() { return display_names; } -} // namespace platf \ No newline at end of file +} // namespace platf