Skip to content

Commit

Permalink
ecere/gfx/drivers/GL: Automatically flushing matrices before switchin…
Browse files Browse the repository at this point in the history
…g shaders

- Matrix stacks get mixed up otherwise resulting in confusion
  • Loading branch information
jerstlouis committed Jan 25, 2022
1 parent f298ea9 commit 5a88997
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ecere/src/gfx/drivers/gl3/shaders.ec
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ public:
if(!glCaps_shaders) return false;

if(activeShader != this)
{
GLFlushMatrices(); // Must flush matrices before switching shader otherwise the matrix stacks may get mixed up
activeShader = this;
}

result = true;
if(activeState != state || !shader)
Expand Down

0 comments on commit 5a88997

Please sign in to comment.