diff --git a/sunshine/platform/linux/graphics.cpp b/sunshine/platform/linux/graphics.cpp index 732b43ca..2204274a 100644 --- a/sunshine/platform/linux/graphics.cpp +++ b/sunshine/platform/linux/graphics.cpp @@ -640,7 +640,9 @@ std::optional sws_t::make(int in_width, int in_height, int out_width, int } void sws_t::load_ram(platf::img_t &img) { - gl::ctx.BindTexture(GL_TEXTURE_2D, tex[0]); + loaded_texture = tex[0]; + + gl::ctx.BindTexture(GL_TEXTURE_2D, loaded_texture); gl::ctx.TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, img.width, img.height, GL_BGRA, GL_UNSIGNED_BYTE, img.data); } diff --git a/sunshine/platform/linux/graphics.h b/sunshine/platform/linux/graphics.h index 98d55a50..7c9bfcfe 100644 --- a/sunshine/platform/linux/graphics.h +++ b/sunshine/platform/linux/graphics.h @@ -12,9 +12,10 @@ #include "sunshine/platform/common.h" #include "sunshine/utility.h" -#define SUNSHINE_STRINGIFY(x) #x -#define gl_drain_errors_helper(x) gl::drain_errors("line " SUNSHINE_STRINGIFY(x)) -#define gl_drain_errors gl_drain_errors_helper(__LINE__) +#define SUNSHINE_STRINGIFY_HELPER(x) #x +#define SUNSHINE_STRINGIFY(x) SUNSHINE_STRINGIFY_HELPER(x) +#define gl_drain_errors_helper(x) gl::drain_errors(x) +#define gl_drain_errors gl_drain_errors_helper(__FILE__ ":" SUNSHINE_STRINGIFY(__LINE__)) extern "C" int close(int __fd); diff --git a/sunshine/platform/linux/kmsgrab.cpp b/sunshine/platform/linux/kmsgrab.cpp index f512bb2b..55e953f6 100644 --- a/sunshine/platform/linux/kmsgrab.cpp +++ b/sunshine/platform/linux/kmsgrab.cpp @@ -452,7 +452,7 @@ public: fb_fd.el, img_width, img_height, - 0, + offset, pitch, }); @@ -530,7 +530,6 @@ public: } int dummy_img(platf::img_t *img) override { - snapshot(img, 1s, false); return 0; }