Commit 4b8d181e authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: fix bug where sometimes samplers would still end up bound to texture...

engine: fix bug where sometimes samplers would still end up bound to texture units after render mode switches
parent 308172f8
......@@ -62,13 +62,15 @@ void buildgl_outputDebugMessage(uint8_t severity, const char* format, ...)
void buildgl_resetStateAccounting()
{
for (auto i=GL_TEXTURE0;i<MAXTEXUNIT;i++)
{
buildgl_bindSamplerObject(TEXUNIT_INDEX_FROM_NAME(i), 0);
inthash_free(&gl.state[TEXUNIT_INDEX_FROM_NAME(i)]);
}
Bmemset(&gl, 0, sizeof(BuildGLState));
for (auto i=GL_TEXTURE0;i<MAXTEXUNIT;i++)
{
buildgl_bindSamplerObject(TEXUNIT_INDEX_FROM_NAME(i), 0);
gl.currentBoundSampler[TEXUNIT_INDEX_FROM_NAME(i)] = (glsamplertype)-1;
gl.state[TEXUNIT_INDEX_FROM_NAME(i)].count = 64;
inthash_init(&gl.state[TEXUNIT_INDEX_FROM_NAME(i)]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment