From e0be3e66ecaa93d5b21d08c93d82f4ad09d47b20 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 15 Jul 2015 19:14:30 +0200 Subject: [PATCH] Fix buffer bound inputs showing up as "Unbound"/not rendering thumbnail --- renderdocui/Windows/TextureViewer.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index a903d6d6d..a3370c06a 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -1204,6 +1204,11 @@ namespace renderdocui.Windows if (t.ID == Texs[i]) tex = t; + FetchBuffer buf = null; + foreach (var b in m_Core.CurBuffers) + if (b.ID == Texs[i]) + buf = b; + if (tex != null) { prev.Init(!tex.customName && bindName.Length > 0 ? bindName : tex.name, tex.width, tex.height, tex.depth, tex.mips); @@ -1214,6 +1219,15 @@ namespace renderdocui.Windows m_Output.AddThumbnail(handle, id); }); } + else if (buf != null) + { + prev.Init(!buf.customName && bindName.Length > 0 ? bindName : buf.name, buf.length, 0, 0, Math.Max(1, buf.structureSize)); + IntPtr handle = prev.ThumbnailHandle; + m_Core.Renderer.BeginInvoke((ReplayRenderer rep) => + { + m_Output.AddThumbnail(handle, ResourceId.Null); + }); + } else { prev.Init();