mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 14:15:42 +00:00
CBuffer window is a dialog now, with ability to set custom layout
This commit is contained in:
@@ -148,45 +148,25 @@ namespace renderdoc
|
||||
return Maths_HalfToFloat(comp);
|
||||
}
|
||||
|
||||
public string Interpret(UInt32 comp, bool hex)
|
||||
{
|
||||
if (compByteWidth != 4 || compType == FormatComponentType.Float) throw new ArgumentException();
|
||||
|
||||
if (compType == FormatComponentType.SInt)
|
||||
{
|
||||
int cast = (int)comp;
|
||||
return String.Format("{0}", cast);
|
||||
}
|
||||
else if (compType == FormatComponentType.UInt)
|
||||
{
|
||||
return String.Format(hex ? "{0:X8}" : "{0}", comp);
|
||||
}
|
||||
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
public string Interpret(UInt16 comp, bool hex)
|
||||
public object Interpret(UInt16 comp)
|
||||
{
|
||||
if (compByteWidth != 2 || compType == FormatComponentType.Float) throw new ArgumentException();
|
||||
|
||||
if (compType == FormatComponentType.SInt)
|
||||
{
|
||||
Int16 cast = (Int16)comp;
|
||||
return String.Format("{0}", cast);
|
||||
return (Int16)comp;
|
||||
}
|
||||
else if (compType == FormatComponentType.UInt)
|
||||
{
|
||||
return String.Format(hex ? "{0:X4}" : "{0}", comp);
|
||||
return comp;
|
||||
}
|
||||
else if (compType == FormatComponentType.UNorm)
|
||||
{
|
||||
float f = (float)comp / (float)UInt16.MaxValue;
|
||||
return Formatter.Format(f);
|
||||
return (float)comp / (float)UInt16.MaxValue;
|
||||
}
|
||||
else if (compType == FormatComponentType.UNorm_SRGB)
|
||||
{
|
||||
float f = (float)comp / (float)UInt16.MaxValue;
|
||||
return Formatter.Format(f);
|
||||
return (float)comp / (float)UInt16.MaxValue;
|
||||
}
|
||||
else if (compType == FormatComponentType.SNorm)
|
||||
{
|
||||
@@ -199,34 +179,31 @@ namespace renderdoc
|
||||
else
|
||||
f = ((float)cast) / 32767.0f;
|
||||
|
||||
return Formatter.Format(f);
|
||||
return f;
|
||||
}
|
||||
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
public string Interpret(byte comp, bool hex)
|
||||
public object Interpret(byte comp)
|
||||
{
|
||||
if (compByteWidth != 1 || compType == FormatComponentType.Float) throw new ArgumentException();
|
||||
|
||||
if (compType == FormatComponentType.SInt)
|
||||
{
|
||||
sbyte cast = (sbyte)comp;
|
||||
return String.Format("{0}", cast);
|
||||
return (sbyte)comp;
|
||||
}
|
||||
else if (compType == FormatComponentType.UInt)
|
||||
{
|
||||
return String.Format(hex ? "{0:X2}" : "{0}", comp);
|
||||
return comp;
|
||||
}
|
||||
else if (compType == FormatComponentType.UNorm)
|
||||
{
|
||||
float f = ((float)comp) / 255.0f;
|
||||
return Formatter.Format(f);
|
||||
return ((float)comp) / 255.0f;
|
||||
}
|
||||
else if (compType == FormatComponentType.UNorm_SRGB)
|
||||
{
|
||||
float f = ((float)comp) / 255.0f;
|
||||
return Formatter.Format(f);
|
||||
return ((float)comp) / 255.0f;
|
||||
}
|
||||
else if (compType == FormatComponentType.SNorm)
|
||||
{
|
||||
@@ -239,7 +216,7 @@ namespace renderdoc
|
||||
else
|
||||
f = ((float)cast) / 127.0f;
|
||||
|
||||
return Formatter.Format(f);
|
||||
return f;
|
||||
}
|
||||
|
||||
throw new ArgumentException();
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace renderdoc
|
||||
public string Row(int row, VarType t)
|
||||
{
|
||||
if(t == VarType.Double)
|
||||
return RowValuesToString((int)columns, value.dv[row*columns+0], value.dv[row*columns+1]);
|
||||
return RowValuesToString((int)columns, value.dv[row * columns + 0], value.dv[row * columns + 1]);
|
||||
else if(t == VarType.Int)
|
||||
return RowValuesToString((int)columns, value.iv[row * columns + 0], value.iv[row * columns + 1], value.iv[row * columns + 2], value.iv[row * columns + 3]);
|
||||
else if(t == VarType.UInt)
|
||||
|
||||
Reference in New Issue
Block a user