FIX: #2446 qtbase: QOpenGL shader crash on Windows with several buggy GPU drivers

Julien Maille requested to merge nefast/qtbase:kde/5.15 into kde/5.15

Problem reported in FreeCAD bug tracker:
Bug fixed in Qt 5.15.11:
The patch for Qt6 needs a small tweak to work on Qt5 (confirmed)

From 72dd23cf Mon Sep 17 00:00:00 2001
From: Laszlo Agocs
Date: Fri, 02 Sep 2022 14:11:18 +0200
Subject: [PATCH] Defer creating the special shaders in the texture blitter

Port of the 5.15 change. It is not strictly required for Qt 6 since the
immediate problem of failing to compile some of the shaders with some
drivers will pop up much more rarely in practice, because neither
Multimedia nor the backing store compositor for
QOpenGLWidget/QQuickWidget use QOpenGLTextureBlitter in 6.4 and newer.

To maintain the internal behavior between 5 and 6, the patch is
nonetheless ported to Qt 6. It also has a performance benefit for
the users of the blitter, because now the special shader variants
(for rectangle or external textures) are only created when needed.

Task-number: QTBUG-101396
Change-Id: I1cf4bec0c74045f4b6f94765563254026bf0b7d8
Reviewed-by: Qt CI Bot
Reviewed-by: Andy Nichols

Edited by Julien Maille

Merge request reports