Explicitly handle unbounded arrays and display declared fixed vars

* GL and Vulkan allow buffers to have fixed variables before a trailing AoS
  unbounded array. These fixed variables can't be easily displayed in a table
  and previously we skipped them. Now we display these in a tree format.
* We also support formats which don't have an unbounded array at all and display
  these just with the tree. This will allow the BufferViewer to subsume the
  capabilities of the ConstantBufferPreviewer (though it needs to handle opaque
  non-buffer-backed variables, and slot-following).
This commit is contained in:
baldurk
2022-03-21 15:57:21 +00:00
parent d0720fe787
commit a36516c8a5
12 changed files with 630 additions and 177 deletions
@@ -294,7 +294,12 @@ void ConstantBufferPreviewer::processFormat(const QString &format)
{
QString errors;
m_formatOverride = BufferFormatter::ParseFormatString(format, ~0ULL, errors);
ShaderConstant fixed, repeating;
rdctie(fixed, repeating) = BufferFormatter::ParseFormatString(format, ~0ULL, errors);
m_formatOverride = fixed;
// we don't handle true unbounded repeating data here, add it as another single element
if(repeating.type.descriptor.type != VarType::Unknown)
m_formatOverride.type.members.push_back(repeating);
ui->formatSpecifier->setErrors(errors);
}