mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-22 04:44:17 +00:00
ref: gl: invalidate texture units state cache when texture deletes
This commit is contained in:
parent
081cf9132b
commit
17e106f96d
@ -1471,6 +1471,22 @@ static void GL_DeleteTexture( gl_texture_t *tex )
|
|||||||
prev = &cur->nextHash;
|
prev = &cur->nextHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// invalidate texture units state cache
|
||||||
|
for( int i = 0; i < MAX_TEXTURE_UNITS; i++ )
|
||||||
|
{
|
||||||
|
if( glState.currentTextures[i] == tex->texnum )
|
||||||
|
{
|
||||||
|
if( glState.currentTextureTargets[i] != GL_NONE )
|
||||||
|
{
|
||||||
|
GL_SelectTexture( i );
|
||||||
|
pglDisable( glState.currentTextureTargets[i] );
|
||||||
|
}
|
||||||
|
glState.currentTextureTargets[i] = GL_NONE;
|
||||||
|
glState.currentTextures[i] = -1;
|
||||||
|
glState.currentTexturesIndex[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// release source
|
// release source
|
||||||
if( tex->original )
|
if( tex->original )
|
||||||
gEngfuncs.FS_FreeImage( tex->original );
|
gEngfuncs.FS_FreeImage( tex->original );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user