mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-24 07:26:34 +00:00
Fix querying for texture view mip/array size
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user