Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
5.9.4
-
None
-
TI AM335x/AM437x EVM
Description
This problem was observed with QT5.7.1 on the TI AM335x/AM437x EVM initially.
For all software-rendering application, the qwindow-compositor will display a black rectangle with the same size of the expected window. But the same application (binary) works fine on the TI AM537x EVM.
Our GPU vendor pointed out the root cause of this problem as described below:
On OpenGL ES 2 core implementation, only GL_CLAMP_TO_EDGE parameter is supported as wrap mode for NPOT (non power of two dimension) textures. However, the default parameter is GL_REPEAT.
An extension OES_texture_npot however adds the support of other GL_REPEAT and GL_MIRRORED_REPEAT to the wrap modes.
On GPU cores (AM57xx woth SGX544 for example) for which OES_texture_npot extension is supported, we get the expected output. However when this extension is not supported (AM335x/AM437x with SGX530 for example), texture remains inconsistent and black placeholder is visible instead of intended texture.
Proposed solution:
They believe that it is up to the application to check the extension string before using default repeat mode with npot textures and the proposed fix is something like:
if(textureIsNPOT(appwidth, appheight) && strstr(gles2ExtensionString, "GL_OES_texture_npot") == NULL) \{ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); }
Or just use GL_CLAMP_TO_EDGE for all cases.
We have verified the following changes at QT5.7.1 and QT5.9.4 respectively.
QT5.7.1: sample application qwindow-compositor change:
GLuint View::getTexture(GLenum *target) \{ ... if (buf.isShm()) \{ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); {color:#ff0000}glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);{color} {color:#ff0000} glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);{color} } } QT5.9.4 (11.0): src/compositor/wayland_wrapper/qwlclientbuffer.cpp: QOpenGLTexture *SharedMemoryBuffer::toOpenGlTexture(int plane) \{ ... if (m_textureDirty) \{ m_textureDirty = false; m_shmTexture->bind(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); {color:#ff0000}glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); {color} {color:#ff0000} glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); {color} }
Attachments
Issue Links
- duplicates
-
QTBUG-67418 [Wayland] black screen observed on some platforms
- Closed