From 9eeb1389f57bc4c0cfd205c7d1aaaa8fe069f81e Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Tue, 8 Nov 2011 16:56:12 +1000 Subject: [PATCH] Change the order textures are bound. Leave texture unit 0 active at the end, since the active texture unit is not restored by SG itself. Change-Id: I4970a955fea5c9342cc93c1d1b07ffbfb71e5f04 Reviewed-by: Dmytro Poplavskiy --- src/imports/multimedia/qsgvideonode_i420.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imports/multimedia/qsgvideonode_i420.cpp b/src/imports/multimedia/qsgvideonode_i420.cpp index 11135c1..e71ea6e 100644 --- a/src/imports/multimedia/qsgvideonode_i420.cpp +++ b/src/imports/multimedia/qsgvideonode_i420.cpp @@ -278,12 +278,12 @@ void QSGVideoMaterialShader_YUV420::updateState(const RenderState &state, program()->setUniformValue(m_id_uTexture, 1); program()->setUniformValue(m_id_vTexture, 2); - functions->glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, mat->idY); functions->glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, mat->idU); functions->glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, mat->idV); + functions->glActiveTexture(GL_TEXTURE0); // Finish with 0 as default texture unit + glBindTexture(GL_TEXTURE_2D, mat->idY); program()->setUniformValue(m_id_colorMatrix, mat->colorMatrix); if (state.isOpacityDirty()) { -- 2.7.4