From f555c3301e22570f5fb211705f6d95073cd521f8 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Wed, 15 Nov 2023 23:23:14 +0100 Subject: [PATCH] screencast: Make nvidia use the GLES path glGetTexImage returns a black image https://forums.developer.nvidia.com/t/glgetteximage-returns-a-black-image-when-using-a-gbm-backed-egldisplay/273253 Fixes: BUG:476602 --- src/plugins/screencast/screencastutils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/screencast/screencastutils.h b/src/plugins/screencast/screencastutils.h index 9f7c815f21..8f3d1db2f4 100644 --- a/src/plugins/screencast/screencastutils.h +++ b/src/plugins/screencast/screencastutils.h @@ -59,7 +59,9 @@ static void doGrabTexture(GLTexture *texture, spa_data *spa, spa_video_format fo } texture->bind(); - if (GLPlatform::instance()->isGLES()) { + // BUG: The nvidia driver fails to glGetTexImage + // Drop driver() == DriverNVidia some time after that's fixed + if (GLPlatform::instance()->isGLES() || GLPlatform::instance()->driver() == Driver_NVidia) { GLFramebuffer fbo(texture); GLFramebuffer::pushFramebuffer(&fbo); glReadPixels(0, 0, size.width(), size.height(), closestGLType(format), GL_UNSIGNED_BYTE, spa->data);