mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Remove redundant numSubresources struct member that was just mips*slices
This commit is contained in:
@@ -103,7 +103,6 @@ struct FetchTexture
|
||||
bool32 cubemap;
|
||||
uint32_t mips;
|
||||
uint32_t arraysize;
|
||||
uint32_t numSubresources;
|
||||
uint32_t creationFlags;
|
||||
uint32_t msQual, msSamp;
|
||||
uint64_t byteSize;
|
||||
|
||||
@@ -430,7 +430,6 @@ void ImageViewer::RefreshFile()
|
||||
texDetails.format = rgba8_unorm;
|
||||
|
||||
// reasonable defaults
|
||||
texDetails.numSubresources = 1;
|
||||
texDetails.dimension = 2;
|
||||
texDetails.arraysize = 1;
|
||||
texDetails.width = 1;
|
||||
@@ -588,7 +587,6 @@ void ImageViewer::RefreshFile()
|
||||
texDetails.height = read_data.height;
|
||||
texDetails.depth = read_data.depth;
|
||||
texDetails.mips = read_data.mips;
|
||||
texDetails.numSubresources = texDetails.arraysize * texDetails.mips;
|
||||
texDetails.format = read_data.format;
|
||||
texDetails.dimension = 1;
|
||||
if(texDetails.width > 1)
|
||||
@@ -597,7 +595,7 @@ void ImageViewer::RefreshFile()
|
||||
texDetails.dimension = 3;
|
||||
|
||||
m_FrameRecord.frameInfo.fileSize = 0;
|
||||
for(uint32_t i = 0; i < texDetails.numSubresources; i++)
|
||||
for(uint32_t i = 0; i < texDetails.arraysize * texDetails.mips; i++)
|
||||
m_FrameRecord.frameInfo.fileSize += read_data.subsizes[i];
|
||||
}
|
||||
|
||||
@@ -628,7 +626,7 @@ void ImageViewer::RefreshFile()
|
||||
}
|
||||
else
|
||||
{
|
||||
for(uint32_t i = 0; i < texDetails.numSubresources; i++)
|
||||
for(uint32_t i = 0; i < texDetails.arraysize * texDetails.mips; i++)
|
||||
{
|
||||
m_Proxy->SetProxyTextureData(m_TextureID, i / texDetails.mips, i % texDetails.mips,
|
||||
read_data.subdata[i], (size_t)read_data.subsizes[i]);
|
||||
|
||||
@@ -1044,13 +1044,12 @@ void Serialiser::Serialise(const char *name, FetchTexture &el)
|
||||
Serialise("", el.cubemap);
|
||||
Serialise("", el.mips);
|
||||
Serialise("", el.arraysize);
|
||||
Serialise("", el.numSubresources);
|
||||
Serialise("", el.creationFlags);
|
||||
Serialise("", el.msQual);
|
||||
Serialise("", el.msSamp);
|
||||
Serialise("", el.byteSize);
|
||||
|
||||
SIZE_CHECK(FetchTexture, 152);
|
||||
SIZE_CHECK(FetchTexture, 144);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -74,8 +74,6 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.cubemap = false;
|
||||
tex.format = MakeResourceFormat(desc.Format);
|
||||
|
||||
tex.numSubresources = desc.MipLevels;
|
||||
|
||||
tex.creationFlags = 0;
|
||||
if(desc.BindFlags & D3D11_BIND_SHADER_RESOURCE)
|
||||
tex.creationFlags |= eTextureCreate_SRV;
|
||||
@@ -86,10 +84,11 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
if(desc.BindFlags & D3D11_BIND_UNORDERED_ACCESS)
|
||||
tex.creationFlags |= eTextureCreate_UAV;
|
||||
|
||||
if(desc.MipLevels == 0)
|
||||
tex.numSubresources = CalcNumMips(desc.Width, 1, 1);
|
||||
tex.mips = desc.MipLevels;
|
||||
|
||||
if(desc.MipLevels == 0)
|
||||
tex.mips = CalcNumMips(desc.Width, 1, 1);
|
||||
|
||||
tex.mips = tex.numSubresources;
|
||||
tex.arraysize = desc.ArraySize;
|
||||
|
||||
tex.resType = tex.arraysize > 1 ? eResType_Texture1DArray : eResType_Texture1D;
|
||||
@@ -97,8 +96,6 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.msQual = 0;
|
||||
tex.msSamp = 1;
|
||||
|
||||
tex.numSubresources *= desc.ArraySize;
|
||||
|
||||
tex.customName = true;
|
||||
|
||||
if(str == "")
|
||||
@@ -121,7 +118,7 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.name = str;
|
||||
|
||||
tex.byteSize = 0;
|
||||
for(uint32_t s = 0; s < tex.numSubresources; s++)
|
||||
for(uint32_t s = 0; s < tex.mips * tex.arraysize; s++)
|
||||
tex.byteSize += GetByteSize(d3dtex, s);
|
||||
|
||||
return tex;
|
||||
@@ -147,8 +144,6 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.depth = 1;
|
||||
tex.format = MakeResourceFormat(desc.Format);
|
||||
|
||||
tex.numSubresources = desc.MipLevels;
|
||||
|
||||
tex.creationFlags = 0;
|
||||
if(desc.BindFlags & D3D11_BIND_SHADER_RESOURCE)
|
||||
tex.creationFlags |= eTextureCreate_SRV;
|
||||
@@ -165,10 +160,11 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
if(desc.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE)
|
||||
tex.cubemap = true;
|
||||
|
||||
if(desc.MipLevels == 0)
|
||||
tex.numSubresources = CalcNumMips(desc.Width, desc.Height, 1);
|
||||
tex.mips = desc.MipLevels;
|
||||
|
||||
if(desc.MipLevels == 0)
|
||||
tex.mips = CalcNumMips(desc.Width, desc.Height, 1);
|
||||
|
||||
tex.mips = tex.numSubresources;
|
||||
tex.arraysize = desc.ArraySize;
|
||||
|
||||
tex.msQual = desc.SampleDesc.Quality;
|
||||
@@ -180,8 +176,6 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
if(tex.msSamp > 1)
|
||||
tex.resType = tex.arraysize > 1 ? eResType_Texture2DMSArray : eResType_Texture2DMS;
|
||||
|
||||
tex.numSubresources *= desc.ArraySize;
|
||||
|
||||
tex.customName = true;
|
||||
|
||||
if(str == "")
|
||||
@@ -218,7 +212,7 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.name = str;
|
||||
|
||||
tex.byteSize = 0;
|
||||
for(uint32_t s = 0; s < tex.numSubresources; s++)
|
||||
for(uint32_t s = 0; s < tex.arraysize * tex.mips; s++)
|
||||
tex.byteSize += GetByteSize(d3dtex, s);
|
||||
|
||||
return tex;
|
||||
@@ -242,8 +236,6 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.cubemap = false;
|
||||
tex.format = MakeResourceFormat(desc.Format);
|
||||
|
||||
tex.numSubresources = desc.MipLevels;
|
||||
|
||||
tex.resType = eResType_Texture3D;
|
||||
|
||||
tex.creationFlags = 0;
|
||||
@@ -256,13 +248,14 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
if(desc.BindFlags & D3D11_BIND_UNORDERED_ACCESS)
|
||||
tex.creationFlags |= eTextureCreate_UAV;
|
||||
|
||||
tex.mips = desc.MipLevels;
|
||||
|
||||
if(desc.MipLevels == 0)
|
||||
tex.numSubresources = CalcNumMips(desc.Width, desc.Height, desc.Depth);
|
||||
tex.mips = CalcNumMips(desc.Width, desc.Height, desc.Depth);
|
||||
|
||||
tex.msQual = 0;
|
||||
tex.msSamp = 1;
|
||||
|
||||
tex.mips = tex.numSubresources;
|
||||
tex.arraysize = 1;
|
||||
|
||||
tex.customName = true;
|
||||
@@ -284,7 +277,7 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.name = str;
|
||||
|
||||
tex.byteSize = 0;
|
||||
for(uint32_t s = 0; s < tex.numSubresources; s++)
|
||||
for(uint32_t s = 0; s < tex.arraysize * tex.mips; s++)
|
||||
tex.byteSize += GetByteSize(d3dtex, s);
|
||||
|
||||
return tex;
|
||||
@@ -303,7 +296,6 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id)
|
||||
tex.cubemap = false;
|
||||
tex.mips = 1;
|
||||
tex.arraysize = 1;
|
||||
tex.numSubresources = 1;
|
||||
tex.msQual = 0;
|
||||
tex.msSamp = 1;
|
||||
|
||||
|
||||
@@ -151,7 +151,6 @@ FetchTexture D3D12Replay::GetTexture(ResourceId id)
|
||||
ret.height = desc.Height;
|
||||
ret.depth = desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? desc.DepthOrArraySize : 1;
|
||||
ret.arraysize = desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? desc.DepthOrArraySize : 1;
|
||||
ret.numSubresources = GetNumSubresources(&desc);
|
||||
ret.mips = desc.MipLevels;
|
||||
ret.msQual = desc.SampleDesc.Quality;
|
||||
ret.msSamp = RDCMAX(1U, desc.SampleDesc.Count);
|
||||
|
||||
@@ -458,7 +458,6 @@ void GLReplay::CacheTexture(ResourceId id)
|
||||
tex.cubemap = false;
|
||||
tex.mips = 1;
|
||||
tex.arraysize = 1;
|
||||
tex.numSubresources = 1;
|
||||
tex.creationFlags = 0;
|
||||
tex.msQual = 0;
|
||||
tex.msSamp = 1;
|
||||
@@ -478,7 +477,6 @@ void GLReplay::CacheTexture(ResourceId id)
|
||||
tex.cubemap = false;
|
||||
tex.mips = 1;
|
||||
tex.arraysize = 1;
|
||||
tex.numSubresources = 1;
|
||||
tex.creationFlags = eTextureCreate_RTV;
|
||||
tex.msQual = 0;
|
||||
tex.msSamp = RDCMAX(1, res.samples);
|
||||
@@ -689,7 +687,6 @@ void GLReplay::CacheTexture(ResourceId id)
|
||||
tex.cubemap = false;
|
||||
tex.mips = 1;
|
||||
tex.arraysize = 1;
|
||||
tex.numSubresources = 1;
|
||||
tex.creationFlags = eTextureCreate_SRV;
|
||||
tex.msQual = 0;
|
||||
tex.msSamp = 1;
|
||||
@@ -705,8 +702,6 @@ void GLReplay::CacheTexture(ResourceId id)
|
||||
|
||||
tex.mips = GetNumMips(gl.m_Real, target, res.resource.name, tex.width, tex.height, tex.depth);
|
||||
|
||||
tex.numSubresources = tex.mips * tex.arraysize;
|
||||
|
||||
GLint compressed;
|
||||
gl.glGetTextureLevelParameterivEXT(res.resource.name, levelQueryType, 0, eGL_TEXTURE_COMPRESSED,
|
||||
&compressed);
|
||||
|
||||
@@ -801,7 +801,6 @@ FetchTexture VulkanReplay::GetTexture(ResourceId id)
|
||||
ret.height = iminfo.extent.height;
|
||||
ret.depth = iminfo.extent.depth;
|
||||
ret.mips = iminfo.mipLevels;
|
||||
ret.numSubresources = ret.mips * ret.arraysize;
|
||||
|
||||
ret.byteSize = 0;
|
||||
for(uint32_t s = 0; s < ret.mips; s++)
|
||||
|
||||
@@ -307,7 +307,6 @@ namespace renderdoc
|
||||
public bool cubemap;
|
||||
public UInt32 mips;
|
||||
public UInt32 arraysize;
|
||||
public UInt32 numSubresources;
|
||||
public TextureCreationFlags creationFlags;
|
||||
public UInt32 msQual, msSamp;
|
||||
public UInt64 byteSize;
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace renderdocui.Windows.Dialogs
|
||||
tex.cubemap = true;
|
||||
tex.msSamp = 2;
|
||||
tex.mips = 5;
|
||||
tex.numSubresources = tex.arraysize * tex.mips;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +114,7 @@ namespace renderdocui.Windows.Dialogs
|
||||
|
||||
String[] cubeFaces = { "X+", "X-", "Y+", "Y-", "Z+", "Z-" };
|
||||
|
||||
UInt32 numSlices = (Math.Max(1, tex.depth) * tex.numSubresources) / tex.mips;
|
||||
UInt32 numSlices = Math.Max(tex.arraysize, tex.depth);
|
||||
|
||||
sliceSelect.Items.Clear();
|
||||
|
||||
|
||||
@@ -1723,7 +1723,7 @@ namespace renderdocui.Windows
|
||||
|
||||
sliceFace.Items.Clear();
|
||||
|
||||
if (tex.numSubresources == tex.mips && tex.depth <= 1)
|
||||
if (tex.arraysize == 1 && tex.depth <= 1)
|
||||
{
|
||||
sliceFace.Enabled = false;
|
||||
}
|
||||
@@ -1735,7 +1735,7 @@ namespace renderdocui.Windows
|
||||
|
||||
String[] cubeFaces = { "X+", "X-", "Y+", "Y-", "Z+", "Z-" };
|
||||
|
||||
UInt32 numSlices = (Math.Max(1, tex.depth) * tex.numSubresources) / tex.mips;
|
||||
UInt32 numSlices = tex.arraysize;
|
||||
|
||||
// for 3D textures, display the number of slices at this mip
|
||||
if(tex.depth > 1)
|
||||
|
||||
Reference in New Issue
Block a user