Display texture swizzling and depth/stencil read mode on textures

This commit is contained in:
baldurk
2015-01-17 15:53:09 +00:00
parent ce7c8eb44f
commit 24fd91a7e0
6 changed files with 111 additions and 1 deletions
+25
View File
@@ -48,6 +48,16 @@ namespace renderdoc
Double,
};
public enum TextureSwizzle
{
Red,
Green,
Blue,
Alpha,
Zero,
One,
};
public enum ShaderResourceType
{
None,
@@ -434,6 +444,21 @@ namespace renderdoc
return "Unknown Type";
}
public static string Str(this TextureSwizzle swiz)
{
switch (swiz)
{
case TextureSwizzle.Red: return "R";
case TextureSwizzle.Green: return "G";
case TextureSwizzle.Blue: return "B";
case TextureSwizzle.Alpha: return "A";
case TextureSwizzle.Zero: return "0";
case TextureSwizzle.One: return "1";
}
return "Unknown";
}
public static string Str(this ReplayCreateStatus status)
{
switch (status)
+3
View File
@@ -96,6 +96,9 @@ namespace renderdoc
public ResourceId Resource;
public UInt32 FirstSlice;
public ShaderResourceType ResType;
[CustomMarshalAs(CustomUnmanagedType.FixedArray, FixedLength = 4)]
public TextureSwizzle[] Swizzle;
public Int32 DepthReadChannel;
};
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public Texture[] Textures;
@@ -265,6 +265,29 @@ namespace renderdocui.Windows.PipelineState
name = texs[t].name;
typename = texs[t].resType.ToString();
if (texs[t].format.special &&
(texs[t].format.specialFormat == SpecialFormat.D24S8 ||
texs[t].format.specialFormat == SpecialFormat.D32S8)
)
{
if (r.DepthReadChannel == 0)
format += " Depth-Read";
else if (r.DepthReadChannel == 1)
format += " Stencil-Read";
}
else if (
r.Swizzle[0] != TextureSwizzle.Red ||
r.Swizzle[1] != TextureSwizzle.Green ||
r.Swizzle[2] != TextureSwizzle.Blue ||
r.Swizzle[3] != TextureSwizzle.Alpha)
{
format += String.Format(" swizzle[{0}{1}{2}{3}]",
r.Swizzle[0].Str(),
r.Swizzle[1].Str(),
r.Swizzle[2].Str(),
r.Swizzle[3].Str());
}
tag = texs[t];
}
}