mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 08:40:55 +00:00
Show truncation in fixed variables explicitly instead of showing 0s
This commit is contained in:
@@ -2430,6 +2430,7 @@ static void FillShaderVarData(ShaderVariable &var, const ShaderConstant &elem, c
|
||||
{
|
||||
var.name = elem.name;
|
||||
var.value = ShaderValue();
|
||||
var.flags |= ShaderVariableFlags::Truncated;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3120,6 +3121,14 @@ QString TypeString(const ShaderVariable &v)
|
||||
template <typename el>
|
||||
static QString RowValuesToString(int cols, ShaderVariableFlags flags, el x, el y, el z, el w)
|
||||
{
|
||||
if(flags & ShaderVariableFlags::Truncated)
|
||||
{
|
||||
QString ret = lit("---");
|
||||
for(int i = 1; i < cols; i++)
|
||||
ret += lit(", ---");
|
||||
return ret;
|
||||
}
|
||||
|
||||
const bool hex = bool(flags & ShaderVariableFlags::HexDisplay);
|
||||
|
||||
if(bool(flags & ShaderVariableFlags::BinaryDisplay))
|
||||
|
||||
@@ -1124,6 +1124,7 @@ rdcstr DoStringise(const ShaderVariableFlags &el)
|
||||
STRINGISE_BITFIELD_CLASS_BIT(R10G10B10A2);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(UNorm);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(SNorm);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Truncated);
|
||||
}
|
||||
END_BITFIELD_STRINGISE();
|
||||
}
|
||||
|
||||
@@ -4311,6 +4311,10 @@ displayed
|
||||
.. data:: SNorm
|
||||
|
||||
This value should be treated as signed normalised floating point values when interpreting.
|
||||
|
||||
.. data:: Truncated
|
||||
|
||||
This value was truncated when reading - the available range was exhausted.
|
||||
)");
|
||||
enum class ShaderVariableFlags : uint32_t
|
||||
{
|
||||
@@ -4323,6 +4327,7 @@ enum class ShaderVariableFlags : uint32_t
|
||||
R10G10B10A2 = 0x0020,
|
||||
UNorm = 0x0040,
|
||||
SNorm = 0x0080,
|
||||
Truncated = 0x0100,
|
||||
};
|
||||
|
||||
BITMASK_OPERATORS(ShaderVariableFlags);
|
||||
|
||||
Reference in New Issue
Block a user