Treat D3D11 and D3D12 the same around the UI (for naming things, etc)

This commit is contained in:
baldurk
2016-10-17 15:43:58 +02:00
parent 7ce022010c
commit 1f610a8b31
4 changed files with 20 additions and 15 deletions
+7 -2
View File
@@ -575,6 +575,11 @@ namespace renderdoc
return Topology_VertexOffset(topology, primitiveIndex);
}
public static bool IsD3D(this GraphicsAPI apitype)
{
return (apitype == GraphicsAPI.D3D11 || apitype == GraphicsAPI.D3D12);
}
public static string Str(this DebugMessageSource source)
{
switch (source)
@@ -693,7 +698,7 @@ namespace renderdoc
public static string Str(this ResourceUsage usage, GraphicsAPI apitype)
{
if (apitype == GraphicsAPI.D3D11)
if (apitype.IsD3D())
{
switch (usage)
{
@@ -795,7 +800,7 @@ namespace renderdoc
public static string Str(this ShaderStageType stage, GraphicsAPI apitype)
{
if (apitype == GraphicsAPI.D3D11)
if (apitype.IsD3D())
{
switch (stage)
{
+1 -1
View File
@@ -779,7 +779,7 @@ namespace renderdoc
{
get
{
return pipelineType == GraphicsAPI.D3D11 ? ".hlsl" : ".glsl";
return pipelineType.IsD3D() ? ".hlsl" : ".glsl";
}
}
};
@@ -235,7 +235,7 @@ namespace renderdocui.Controls
string ret = String.Format("{0} {1} {2}",
Stage.Str(pipeType),
pipeType == GraphicsAPI.D3D11 ? "CB" : "UBO",
pipeType.IsD3D() ? "CB" : "UBO",
Slot);
if (m_Core != null && m_Core.CurPipelineState.SupportsResourceArrays)
+11 -11
View File
@@ -259,7 +259,7 @@ namespace renderdocui.Windows
m_CloseCallback = closeCallback;
if (m_Core.LogLoaded)
pointLinearSamplersToolStripMenuItem.Visible = (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11);
pointLinearSamplersToolStripMenuItem.Visible = m_Core.APIProps.pipelineType.IsD3D();
DockContent sel = null;
@@ -481,7 +481,7 @@ namespace renderdocui.Windows
var disasm = shader != null ? shader.Disassembly : "";
if (m_Core.Config.ShaderViewer_FriendlyNaming && m_ShaderDetails != null &&
m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
m_Core.APIProps.pipelineType.IsD3D())
{
for (int i = 0; i < m_ShaderDetails.ConstantBlocks.Length; i++)
{
@@ -1708,7 +1708,7 @@ namespace renderdocui.Windows
public void OnLogfileLoaded()
{
pointLinearSamplersToolStripMenuItem.Visible = (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11);
pointLinearSamplersToolStripMenuItem.Visible = (m_Core.APIProps.pipelineType.IsD3D());
}
public void OnEventSelected(UInt32 eventID)
@@ -2066,7 +2066,7 @@ namespace renderdocui.Windows
private int GetPostVersionInsertPosition()
{
if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
if (m_Core.APIProps.pipelineType.IsD3D())
return 0;
int ver = CurrentScintilla.Text.IndexOf("#version");
@@ -2097,7 +2097,7 @@ namespace renderdocui.Windows
if (CurrentScintilla == null)
return;
if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
if (m_Core.APIProps.pipelineType.IsD3D())
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uint4 RENDERDOC_TexDim; // xyz == width, height, depth. w == # mips" + Environment.NewLine + Environment.NewLine);
else if (m_Core.APIProps.pipelineType == GraphicsAPI.OpenGL)
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uniform uvec4 RENDERDOC_TexDim; // xyz == width, height, depth. w == # mips" + Environment.NewLine + Environment.NewLine);
@@ -2113,7 +2113,7 @@ namespace renderdocui.Windows
if (m_Core.APIProps.pipelineType == GraphicsAPI.Vulkan)
InsertVulkanUBO();
else if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
else if (m_Core.APIProps.pipelineType.IsD3D())
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uint RENDERDOC_SelectedMip; // selected mip in UI" + Environment.NewLine + Environment.NewLine);
else if (m_Core.APIProps.pipelineType == GraphicsAPI.OpenGL)
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uniform uint RENDERDOC_SelectedMip; // selected mip in UI" + Environment.NewLine + Environment.NewLine);
@@ -2127,7 +2127,7 @@ namespace renderdocui.Windows
if (m_Core.APIProps.pipelineType == GraphicsAPI.Vulkan)
InsertVulkanUBO();
else if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
else if (m_Core.APIProps.pipelineType.IsD3D())
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uint RENDERDOC_SelectedSliceFace; // selected array slice or cubemap face in UI" + Environment.NewLine + Environment.NewLine);
else if (m_Core.APIProps.pipelineType == GraphicsAPI.OpenGL)
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uniform uint RENDERDOC_SelectedSliceFace; // selected array slice or cubemap face in UI" + Environment.NewLine + Environment.NewLine);
@@ -2141,7 +2141,7 @@ namespace renderdocui.Windows
if (m_Core.APIProps.pipelineType == GraphicsAPI.Vulkan)
InsertVulkanUBO();
else if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
else if (m_Core.APIProps.pipelineType.IsD3D())
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "int RENDERDOC_SelectedSample; // selected MSAA sample or -numSamples for resolve. See docs" + Environment.NewLine + Environment.NewLine);
else if (m_Core.APIProps.pipelineType == GraphicsAPI.OpenGL)
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uniform int RENDERDOC_SelectedSample; // selected MSAA sample or -numSamples for resolve. See docs" + Environment.NewLine + Environment.NewLine);
@@ -2153,7 +2153,7 @@ namespace renderdocui.Windows
if (CurrentScintilla == null)
return;
if(m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
if(m_Core.APIProps.pipelineType.IsD3D())
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uint RENDERDOC_TextureType; // 1 = 1D, 2 = 2D, 3 = 3D, 4 = Depth, 5 = Depth + Stencil, 6 = Depth (MS), 7 = Depth + Stencil (MS)" + Environment.NewLine + Environment.NewLine);
else if (m_Core.APIProps.pipelineType == GraphicsAPI.OpenGL)
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "uniform uint RENDERDOC_TextureType; // 1 = 1D, 2 = 2D, 3 = 3D, 4 = Cube, 5 = 1DArray, 6 = 2DArray, 7 = CubeArray, 8 = Rect, 9 = Buffer, 10 = 2DMS" + Environment.NewLine + Environment.NewLine);
@@ -2167,7 +2167,7 @@ namespace renderdocui.Windows
if (CurrentScintilla == null)
return;
if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
if (m_Core.APIProps.pipelineType.IsD3D())
{
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "// Samplers" + Environment.NewLine +
"SamplerState pointSampler : register(s0);" + Environment.NewLine +
@@ -2182,7 +2182,7 @@ namespace renderdocui.Windows
if (CurrentScintilla == null)
return;
if (m_Core.APIProps.pipelineType == GraphicsAPI.D3D11)
if (m_Core.APIProps.pipelineType.IsD3D())
{
CurrentScintilla.InsertText(GetPostVersionInsertPosition(), "// Textures" + Environment.NewLine +
"Texture1DArray<float4> texDisplayTex1DArray : register(t1);" + Environment.NewLine +