Display resolve attachments with other framebuffer outputs in UI

This commit is contained in:
baldurk
2017-06-16 15:59:39 +01:00
parent 0f2f359eef
commit abcfcfd8a4
11 changed files with 88 additions and 17 deletions
+24 -6
View File
@@ -1461,18 +1461,36 @@ namespace renderdocui.Code
var rp = m_Vulkan.Pass.renderpass;
var fb = m_Vulkan.Pass.framebuffer;
BoundResource[] ret = new BoundResource[rp.colorAttachments.Length];
int idx = 0;
BoundResource[] ret = new BoundResource[rp.colorAttachments.Length*2];
for (int i = 0; i < rp.colorAttachments.Length; i++)
{
ret[i] = new BoundResource();
ret[idx] = new BoundResource();
if(rp.colorAttachments[i] < fb.attachments.Length)
{
ret[i].Id = fb.attachments[rp.colorAttachments[i]].img;
ret[i].HighestMip = (int)fb.attachments[rp.colorAttachments[i]].baseMip;
ret[i].FirstSlice = (int)fb.attachments[rp.colorAttachments[i]].baseLayer;
ret[i].typeHint = fb.attachments[rp.colorAttachments[i]].viewfmt.compType;
ret[idx].Id = fb.attachments[rp.colorAttachments[i]].img;
ret[idx].HighestMip = (int)fb.attachments[rp.colorAttachments[i]].baseMip;
ret[idx].FirstSlice = (int)fb.attachments[rp.colorAttachments[i]].baseLayer;
ret[idx].typeHint = fb.attachments[rp.colorAttachments[i]].viewfmt.compType;
}
idx++;
}
for (int i = 0; i < rp.resolveAttachments.Length; i++)
{
ret[idx] = new BoundResource();
if (rp.resolveAttachments[i] < fb.attachments.Length)
{
ret[idx].Id = fb.attachments[rp.resolveAttachments[i]].img;
ret[idx].HighestMip = (int)fb.attachments[rp.resolveAttachments[i]].baseMip;
ret[idx].FirstSlice = (int)fb.attachments[rp.resolveAttachments[i]].baseLayer;
ret[idx].typeHint = fb.attachments[rp.resolveAttachments[i]].viewfmt.compType;
}
idx++;
}
return ret;
@@ -350,6 +350,8 @@ namespace renderdoc
public UInt32[] inputAttachments;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public UInt32[] colorAttachments;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public UInt32[] resolveAttachments;
public Int32 depthstencilAttachment;
};
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
@@ -2918,7 +2918,7 @@
// targetOutputs
//
treeListColumn103.AutoSizeMinSize = 0;
treeListColumn103.Width = 50;
treeListColumn103.Width = 70;
treeListColumn104.AutoSize = true;
treeListColumn104.AutoSizeMinSize = 150;
treeListColumn104.Width = 50;
@@ -1536,9 +1536,10 @@ namespace renderdocui.Windows.PipelineState
foreach (var p in state.Pass.framebuffer.attachments)
{
int colIdx = Array.IndexOf(state.Pass.renderpass.colorAttachments, (uint)i);
int resIdx = Array.IndexOf(state.Pass.renderpass.resolveAttachments, (uint)i);
bool filledSlot = (p.img != ResourceId.Null);
bool usedSlot = (colIdx >= 0 || state.Pass.renderpass.depthstencilAttachment == i);
bool usedSlot = (colIdx >= 0 || resIdx >= 0 || state.Pass.renderpass.depthstencilAttachment == i);
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
@@ -1605,7 +1606,13 @@ namespace renderdocui.Windows.PipelineState
p.swizzle[3].Str());
}
var node = targetOutputs.Nodes.Add(new object[] { i, name, typename, w, h, d, a, format });
string slotname = String.Format("Color {0}", i);
if (resIdx >= 0)
slotname = String.Format("Resolve {0}", i);
else if (colIdx < 0)
slotname = "Depth";
var node = targetOutputs.Nodes.Add(new object[] { slotname, name, typename, w, h, d, a, format });
node.Image = global::renderdocui.Properties.Resources.action;
node.HoverImage = global::renderdocui.Properties.Resources.action_hover;