Fix querying for texture view mip/array size

This commit is contained in:
baldurk
2019-05-15 14:12:17 +01:00
parent 00bf36fd27
commit bae420d83f
2 changed files with 10 additions and 3 deletions
+8 -1
View File
@@ -602,7 +602,14 @@ void GLReplay::CacheTexture(ResourceId id)
return;
}
tex.mips = GetNumMips(target, res.resource.name, tex.width, tex.height, tex.depth);
if(res.view)
{
tex.mips = Log2Floor(res.mipsValid + 1);
}
else
{
tex.mips = GetNumMips(target, res.resource.name, tex.width, tex.height, tex.depth);
}
GLint compressed = 0;
drv.glGetTextureLevelParameterivEXT(res.resource.name, levelQueryType, 0, eGL_TEXTURE_COMPRESSED,
@@ -702,7 +702,7 @@ bool WrappedOpenGL::Serialise_glTextureView(SerialiserType &ser, GLuint textureH
m_Textures[liveTexId].view = true;
m_Textures[liveTexId].width = m_Textures[liveOrigId].width;
m_Textures[liveTexId].height = m_Textures[liveOrigId].height;
m_Textures[liveTexId].depth = m_Textures[liveOrigId].depth;
m_Textures[liveTexId].depth = numlayers;
m_Textures[liveTexId].mipsValid = (1 << numlevels) - 1;
m_Textures[liveTexId].emulated = emulated;
@@ -759,7 +759,7 @@ void WrappedOpenGL::glTextureView(GLuint texture, GLenum target, GLuint origtext
m_Textures[texId].dimension = m_Textures[viewedId].dimension;
m_Textures[texId].width = m_Textures[viewedId].width;
m_Textures[texId].height = m_Textures[viewedId].height;
m_Textures[texId].depth = m_Textures[viewedId].depth;
m_Textures[texId].depth = numlayers;
m_Textures[texId].curType = TextureTarget(target);
m_Textures[texId].mipsValid = (1 << numlevels) - 1;
}