From 2a04d747d1467e90ca40f0975972974e06c215f7 Mon Sep 17 00:00:00 2001 From: cutealien Date: Mon, 8 May 2023 14:15:49 +0000 Subject: [PATCH] Fix: r6469 broke fixed function materials when shader materials where created but not used git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6489 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/COpenGLSLMaterialRenderer.cpp | 8 ++++++-- tests/tests-last-passed-at.txt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp index 4ef1444..6dcb369 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp @@ -573,10 +573,14 @@ void COpenGLSLMaterialRenderer::startUseProgram() void COpenGLSLMaterialRenderer::stopUseProgram() { - // Not going to reset irrGlUseProgram/extGlUseProgramObject as it shouldn't really matter + // Necessary as fixed function pipeline breaks if programs are not reset to 0 + if (Program) + Driver->extGlUseProgramObject(0); + if (Program2) + Driver->irrGlUseProgram(0); // Force reset of material to ensure OnSetMaterial will be called or we can miss - // the next UseProgram call + // the next UseProgram call as stopUseProgram can be called from anywhere Driver->DoResetRenderStates(); } diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index a998997..ebc23e5 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ Tests finished. 72 tests of 72 passed. Compiled as DEBUG -Test suite pass at GMT Sun May 07 14:26:39 2023 +Test suite pass at GMT Mon May 08 14:14:47 2023