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
This commit is contained in:
Alessandro Astone 2023-11-15 23:23:14 +01:00
parent 491a5b386b
commit f555c3301e

View file

@ -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);