rhi: gl: Only set WRAP_R for 3D textures

It is not clear why an OpenGL implementation would reject
(with INVALID_ENUM) the setting of GL_TEXTURE_WRAP_R
(as making it an error makes no sense and not in the spec
either), but the most likely interpretation of the
associated report is that some Adreno-based Android devices
do that.

So instead of just testing if we are >= ES 3.0, also check
the texture target before setting WRAP_R.

Pick-to: 6.7 6.6 6.5 6.2
Fixes: QTBUG-126012
Change-Id: I0fe1cd71b9fd74748f7bae78030c41ca972932b5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit f50e946012553771190addbca7deeb498ac992b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2024-06-03 12:12:14 +02:00 committed by Qt Cherry-pick Bot
parent e372ae06a5
commit 47a9acb7cf

View File

@ -4017,7 +4017,7 @@ void QRhiGles2::bindCombinedSampler(QGles2CommandBuffer *cbD, QGles2Texture *tex
f->glTexParameteri(texD->target, GL_TEXTURE_MAG_FILTER, GLint(samplerD->d.glmagfilter));
f->glTexParameteri(texD->target, GL_TEXTURE_WRAP_S, GLint(samplerD->d.glwraps));
f->glTexParameteri(texD->target, GL_TEXTURE_WRAP_T, GLint(samplerD->d.glwrapt));
if (caps.texture3D)
if (caps.texture3D && texD->target == GL_TEXTURE_3D)
f->glTexParameteri(texD->target, GL_TEXTURE_WRAP_R, GLint(samplerD->d.glwrapr));
if (caps.textureCompareMode) {
if (samplerD->d.gltexcomparefunc != GL_NEVER) {