Only set GL_DEPTH_STENCIL_TEXTURE_MODE if it has a valid value

This commit is contained in:
baldurk
2014-11-16 12:22:02 +00:00
parent 3c95803566
commit 9ce6c242b2
+2 -1
View File
@@ -746,7 +746,8 @@ void GLResourceManager::Apply_InitialState(GLResource live, InitialContentData i
TextureStateInitialData *state = (TextureStateInitialData *)initial.blob;
{
gl.glTextureParameterivEXT(live.name, details.curType, eGL_DEPTH_STENCIL_TEXTURE_MODE, (GLint *)&state->depthMode);
if(state->depthMode == eGL_DEPTH_COMPONENT || state->depthMode == eGL_STENCIL_INDEX)
gl.glTextureParameterivEXT(live.name, details.curType, eGL_DEPTH_STENCIL_TEXTURE_MODE, (GLint *)&state->depthMode);
gl.glTextureParameterivEXT(live.name, details.curType, eGL_TEXTURE_BASE_LEVEL, (GLint *)&state->baseLevel);
gl.glTextureParameterivEXT(live.name, details.curType, eGL_TEXTURE_MAX_LEVEL, (GLint *)&state->maxLevel);
gl.glTextureParameterivEXT(live.name, details.curType, eGL_TEXTURE_COMPARE_FUNC, (GLint *)&state->compareFunc);