mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Set TextureDescription.resType in image_viewer
This fixes image_viewer on gl_replay. Previously, images would show up as <Uninitialised Texture>.
This commit is contained in:
committed by
Baldur Karlsson
parent
1c49f335a2
commit
ad38130624
@@ -450,6 +450,7 @@ void ImageViewer::RefreshFile()
|
||||
texDetails.format = rgba8_unorm;
|
||||
|
||||
// reasonable defaults
|
||||
texDetails.resType = TextureDim::Texture2D;
|
||||
texDetails.dimension = 2;
|
||||
texDetails.arraysize = 1;
|
||||
texDetails.width = 1;
|
||||
@@ -608,11 +609,29 @@ void ImageViewer::RefreshFile()
|
||||
texDetails.depth = read_data.depth;
|
||||
texDetails.mips = read_data.mips;
|
||||
texDetails.format = read_data.format;
|
||||
texDetails.dimension = 1;
|
||||
if(texDetails.width > 1)
|
||||
texDetails.dimension = 2;
|
||||
if(texDetails.depth > 1)
|
||||
{
|
||||
texDetails.resType = TextureDim::Texture3D;
|
||||
texDetails.dimension = 3;
|
||||
}
|
||||
else if(texDetails.cubemap)
|
||||
{
|
||||
texDetails.resType =
|
||||
texDetails.arraysize > 1 ? TextureDim::TextureCubeArray : TextureDim::TextureCube;
|
||||
texDetails.dimension = 2;
|
||||
}
|
||||
else if(texDetails.width > 1)
|
||||
{
|
||||
texDetails.resType =
|
||||
texDetails.arraysize > 1 ? TextureDim::Texture2DArray : TextureDim::Texture2D;
|
||||
texDetails.dimension = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
texDetails.resType =
|
||||
texDetails.arraysize > 1 ? TextureDim::Texture1DArray : TextureDim::Texture1D;
|
||||
texDetails.dimension = 1;
|
||||
}
|
||||
|
||||
m_FrameRecord.frameInfo.uncompressedFileSize = 0;
|
||||
for(uint32_t i = 0; i < texDetails.arraysize * texDetails.mips; i++)
|
||||
|
||||
Reference in New Issue
Block a user