mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add struct VarType and combine flags into single field
* This is not a space saving right now, but allows more flags to be added without adding more storage.
This commit is contained in:
@@ -749,10 +749,12 @@ static QString interpretVariant(const QVariant &v, const ShaderConstant &el,
|
||||
memcpy(&u, &f, sizeof(f));
|
||||
}
|
||||
|
||||
if(el.type.descriptor.displayAsHex && prop.format.type == ResourceFormatType::Regular)
|
||||
const bool hexDisplay = bool(el.type.descriptor.flags & ShaderVariableFlags::HexDisplay);
|
||||
|
||||
if(hexDisplay && prop.format.type == ResourceFormatType::Regular)
|
||||
ret = Formatter::HexFormat(u, prop.format.compByteWidth);
|
||||
else
|
||||
ret = Formatter::Format(u, el.type.descriptor.displayAsHex);
|
||||
ret = Formatter::Format(u, hexDisplay);
|
||||
}
|
||||
else if(vt == QMetaType::Int || vt == QMetaType::Short || vt == QMetaType::SChar)
|
||||
{
|
||||
@@ -771,7 +773,8 @@ static QString interpretVariant(const QVariant &v, const ShaderConstant &el,
|
||||
}
|
||||
else if(vt == QMetaType::ULongLong)
|
||||
{
|
||||
ret = Formatter::Format((uint64_t)v.toULongLong(), el.type.descriptor.displayAsHex);
|
||||
ret = Formatter::Format((uint64_t)v.toULongLong(),
|
||||
bool(el.type.descriptor.flags & ShaderVariableFlags::HexDisplay));
|
||||
}
|
||||
else if(vt == QMetaType::LongLong)
|
||||
{
|
||||
@@ -980,7 +983,8 @@ public:
|
||||
const ShaderConstant &el = elementForColumn(col);
|
||||
const BufferElementProperties &prop = propForColumn(col);
|
||||
|
||||
if(el.type.descriptor.displayAsRGB && prop.buffer < config.buffers.size())
|
||||
if((el.type.descriptor.flags & ShaderVariableFlags::RGBDisplay) &&
|
||||
prop.buffer < config.buffers.size())
|
||||
{
|
||||
const byte *data = config.buffers[prop.buffer]->data();
|
||||
const byte *end = config.buffers[prop.buffer]->end();
|
||||
|
||||
@@ -3057,7 +3057,7 @@ const RDTreeWidgetItem *ShaderViewer::evaluateVar(const RDTreeWidgetItem *item,
|
||||
|
||||
ShaderVariable &ret = *var;
|
||||
ret.name = mapping.name;
|
||||
ret.rowMajor = true;
|
||||
ret.flags |= ShaderVariableFlags::RowMajorMatrix;
|
||||
ret.rows = mapping.rows;
|
||||
ret.columns = mapping.columns;
|
||||
ret.type = mapping.type;
|
||||
@@ -4177,6 +4177,7 @@ bool ShaderViewer::updateWatchVariable(RDTreeWidgetItem *watchItem, const RDTree
|
||||
case VarType::SInt:
|
||||
case VarType::SShort:
|
||||
case VarType::SByte: regcast = QLatin1Char('i'); break;
|
||||
case VarType::Struct:
|
||||
case VarType::GPUPointer:
|
||||
regcast = QLatin1Char('#');
|
||||
dataSize = 8;
|
||||
@@ -4638,7 +4639,8 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const SourceVariableMappi
|
||||
case VarType::ConstantBlock:
|
||||
case VarType::ReadOnlyResource:
|
||||
case VarType::ReadWriteResource:
|
||||
case VarType::Sampler: value += stringRep(*reg, 0); break;
|
||||
case VarType::Sampler:
|
||||
case VarType::Struct: value += stringRep(*reg, 0); break;
|
||||
case VarType::Unknown:
|
||||
qCritical() << "Unexpected unknown variable" << (QString)l.name;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user