Fix texture unit bug in the YUV video node.
fe13f5bb introduced a bug which could leave the active texture unit set
to GL_TEXTURE1 or GL_TEXTURE2. When the material is done updating its
state, it needs to make sure the active texture unit is reset to 0
since other materials might assume that's the current value.
Change-Id: I64a6a0cd9fcecdf0fa483909193f70045ff0e9fe
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
@@ -318,7 +318,8 @@ void QSGVideoMaterial_YUV::bind()
|
|||||||
|
|
||||||
m_frame = QVideoFrame();
|
m_frame = QVideoFrame();
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < m_planeCount; ++i) {
|
// Go backwards to finish with GL_TEXTURE0
|
||||||
|
for (int i = m_planeCount - 1; i >= 0; --i) {
|
||||||
functions->glActiveTexture(GL_TEXTURE0 + i);
|
functions->glActiveTexture(GL_TEXTURE0 + i);
|
||||||
functions->glBindTexture(GL_TEXTURE_2D, m_textureIds[i]);
|
functions->glBindTexture(GL_TEXTURE_2D, m_textureIds[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user