mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 09:26:52 +00:00
Clarify that buffer viewer displays a single subresource. Closes #3149
* Since the physical layout of subresources is not generally defined, the buffer viewer only displays one subresource at a time.
This commit is contained in:
@@ -3604,6 +3604,10 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
|
||||
else
|
||||
{
|
||||
buf->storage = r->GetTextureData(m_BufferID, m_TexSub);
|
||||
|
||||
// recalculate total size for this subresource based on the data returned
|
||||
if(!buf->storage.empty())
|
||||
m_ObjectByteSize = buf->storage.size();
|
||||
}
|
||||
|
||||
uint32_t repeatedDataAvailable = uint32_t(buf->size() - fixedLength);
|
||||
@@ -5055,8 +5059,13 @@ void BufferViewer::ViewTexture(ResourceId id, const Subresource &sub, const rdcs
|
||||
|
||||
TextureDescription *tex = m_Ctx.GetTexture(id);
|
||||
if(tex)
|
||||
{
|
||||
m_ObjectByteSize = tex->byteSize;
|
||||
|
||||
if(m_TexSub.sample == ~0U)
|
||||
m_TexSub.sample = tex->msSamp - 1;
|
||||
}
|
||||
|
||||
m_PagingByteOffset = 0;
|
||||
|
||||
ui->formatSpecifier->setAutoFormat(format);
|
||||
@@ -6065,6 +6074,46 @@ void BufferViewer::processFormat(const QString &format)
|
||||
|
||||
byteRangeStart->setValue(m_ByteOffset);
|
||||
byteRangeLength->setValue(m_ByteSize);
|
||||
|
||||
if(!m_IsBuffer)
|
||||
{
|
||||
byteRangeStart->setVisible(false);
|
||||
|
||||
TextureDescription *tex = m_Ctx.GetTexture(m_BufferID);
|
||||
if(tex)
|
||||
{
|
||||
if(tex->arraysize == 1 && tex->mips == 1 && tex->msSamp == 1 && tex->depth == 1)
|
||||
{
|
||||
ui->byteRangeStartLabel->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
QString text;
|
||||
|
||||
if(tex->arraysize > 1 || tex->depth > 1)
|
||||
text = tr("Slice %1").arg(m_TexSub.slice);
|
||||
|
||||
if(tex->mips > 1)
|
||||
{
|
||||
if(!text.isEmpty())
|
||||
text += lit(", ");
|
||||
text += tr("Mip %1").arg(m_TexSub.mip);
|
||||
}
|
||||
|
||||
if(tex->msSamp > 1)
|
||||
{
|
||||
if(!text.isEmpty())
|
||||
text += lit(", ");
|
||||
text += tr("Sample %1").arg(m_TexSub.sample);
|
||||
}
|
||||
|
||||
text += lit(". ");
|
||||
|
||||
ui->byteRangeStartLabel->setText(text);
|
||||
}
|
||||
}
|
||||
byteRangeLength->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
ui->formatSpecifier->setErrors(parsed.errors);
|
||||
|
||||
Reference in New Issue
Block a user