- fixed render state management.

There are effectively two states - the one in the backend and a local one in the drawer for the render list which is supposed to eliminate some of the more costly repeated calls.
This higher level state was cached globally, which did not work anymore because the real render state could be changed elsewhere without this code realizing it.
All this means that the render list drawer must create a new state cache for each call and also must apply its current pending render state before leaving to ensure that everything is properly reset.
This commit is contained in:
Christoph Oelckers 2020-06-12 22:32:49 +02:00
parent aa67875792
commit 67b1963e7c
7 changed files with 20 additions and 55 deletions

View file

@ -1643,8 +1643,6 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
k3 = (float)sintable[sext->roll&2047] * (1.f/16384.f);
}
int prevClamp = GLInterface.GetClamp();
GLInterface.SetClamp(0);
VSMatrix imat = 0;
imat.scale(1024, 1024, 1024);
GLInterface.SetMatrix(Matrix_Model, &imat);
@ -1795,7 +1793,6 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
GLInterface.SetIdentityMatrix(Matrix_Model);
GLInterface.SetTinting(-1, 0xffffff, 0xffffff);
GLInterface.SetClamp(prevClamp);
globalnoeffect=0;
return 1;