From 47a9acb7cf06df344192120a5ed7708644b83441 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 3 Jun 2024 12:12:14 +0200 Subject: [PATCH] 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 (cherry picked from commit f50e946012553771190addbca7deeb498ac992b3) Reviewed-by: Qt Cherry-pick Bot --- src/gui/rhi/qrhigles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index dcaa87a5ff7..7e886a5d002 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -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) {