Skip to content

Commit 5a88997

Browse files
committed
ecere/gfx/drivers/GL: Automatically flushing matrices before switching shaders
- Matrix stacks get mixed up otherwise resulting in confusion
1 parent f298ea9 commit 5a88997

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ecere/src/gfx/drivers/gl3/shaders.ec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ public:
313313
if(!glCaps_shaders) return false;
314314

315315
if(activeShader != this)
316+
{
317+
GLFlushMatrices(); // Must flush matrices before switching shader otherwise the matrix stacks may get mixed up
316318
activeShader = this;
319+
}
317320

318321
result = true;
319322
if(activeState != state || !shader)

0 commit comments

Comments
 (0)