diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-05-11 18:33:05 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-05-12 10:19:21 +0000 |
commit | ab860d8b7f58bb68f102dfb3b3ee0b6488c811a1 (patch) | |
tree | e5be6cab4685f66ef82a77e01c4968c71609f9cd /src/qtmultimediaquicktools | |
parent | 2463a5f216de1b1e71314414dc0d43214abe55db (diff) | |
download | qtmultimedia-ab860d8b7f58bb68f102dfb3b3ee0b6488c811a1.tar.gz |
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>
Diffstat (limited to 'src/qtmultimediaquicktools')
-rw-r--r-- | src/qtmultimediaquicktools/qsgvideonode_yuv.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp index 9da1023bb..c920ba3b9 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp @@ -318,7 +318,8 @@ void QSGVideoMaterial_YUV::bind() m_frame = QVideoFrame(); } 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->glBindTexture(GL_TEXTURE_2D, m_textureIds[i]); } |