From bfcfcd37b535f321eae899c5252584a68298bfe1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 28 Sep 2016 15:51:54 +0200 Subject: [PATCH] Make sure DSVs show up with their view parameters properly. --- renderdoc/api/replay/data_types.h | 2 +- renderdocui/Interop/FetchInfo.cs | 2 +- .../PipelineState/D3D11PipelineStateViewer.cs | 21 +++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 558ecc789..ef40d155f 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -58,7 +58,7 @@ struct ResourceFormat bool operator==(const ResourceFormat &r) const { if(special || r.special) - return special == r.special && specialFormat == r.specialFormat; + return special == r.special && specialFormat == r.specialFormat && compType == r.compType; return compCount == r.compCount && compByteWidth == r.compByteWidth && compType == r.compType && bgraOrder == r.bgraOrder && srgbCorrected == r.srgbCorrected; diff --git a/renderdocui/Interop/FetchInfo.cs b/renderdocui/Interop/FetchInfo.cs index 8cdaf12a1..ac9394d4a 100644 --- a/renderdocui/Interop/FetchInfo.cs +++ b/renderdocui/Interop/FetchInfo.cs @@ -180,7 +180,7 @@ namespace renderdoc if ((object)y == null) return (object)x == null; if (x.special || y.special) - return x.special == y.special && x.specialFormat == y.specialFormat; + return x.special == y.special && x.specialFormat == y.specialFormat && x.compType == y.compType; return x.compCount == y.compCount && x.compByteWidth == y.compByteWidth && diff --git a/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs b/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs index f2eca6e03..0fd344e2d 100644 --- a/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs +++ b/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs @@ -71,10 +71,15 @@ namespace renderdocui.Windows.PipelineState { view = v; tex = t; + + DepthReadOnly = false; + StencilReadOnly = false; } public D3D11PipelineState.ShaderStage.ResourceView view; public FetchTexture tex; + + public bool DepthReadOnly, StencilReadOnly; }; private class ViewBufTag @@ -1614,10 +1619,16 @@ namespace renderdocui.Windows.PipelineState format = "Viewed as " + state.m_OM.DepthTarget.Format.ToString(); } - if (HasImportantViewParams(state.m_OM.DepthTarget, texs[t])) + if (HasImportantViewParams(state.m_OM.DepthTarget, texs[t]) || + state.m_OM.DepthReadOnly || state.m_OM.StencilReadOnly) viewDetails = true; - tag = new ViewTexTag(state.m_OM.DepthTarget, texs[t]); + ViewTexTag textag = new ViewTexTag(state.m_OM.DepthTarget, texs[t]); + + textag.DepthReadOnly = state.m_OM.DepthReadOnly; + textag.StencilReadOnly = state.m_OM.StencilReadOnly; + + tag = textag; } } @@ -1824,6 +1835,12 @@ namespace renderdocui.Windows.PipelineState text += String.Format("The texture is format {0}, the view treats it as {1}.\n", tex.tex.format, tex.view.Format); + if (tex.DepthReadOnly) + text += "Depth component is read-only\n"; + + if (tex.StencilReadOnly) + text += "Stencil component is read-only\n"; + if (tex.tex.mips > 1 && (tex.tex.mips != tex.view.NumMipLevels || tex.view.HighestMip > 0)) { if (tex.view.NumMipLevels == 1)