mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 14:15:42 +00:00
Allow fully flexible display of position&other component on meshes
* You can choose which component will be used as 'position' when rendering vertex inputs. Helpful if a position component isn't auto-detected, or if you want to render UV co-ordinates onto the screen. * Instead of fixed TEXCOORD0/Color options for solid shading onto the mesh you can choose a secondary column yourself. * Also the solid shading options are available on vertex output meshes as well as inputs.
This commit is contained in:
@@ -58,6 +58,41 @@ namespace renderdocui.Code
|
||||
hex = h;
|
||||
}
|
||||
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
return obj is FormatElement && this == (FormatElement)obj;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
int hash = name.GetHashCode() * 17;
|
||||
hash = hash * 17 + buffer.GetHashCode();
|
||||
hash = hash * 17 + offset.GetHashCode();
|
||||
hash = hash * 17 + format.GetHashCode();
|
||||
hash = hash * 17 + perinstance.GetHashCode();
|
||||
hash = hash * 17 + rowmajor.GetHashCode();
|
||||
hash = hash * 17 + matrixdim.GetHashCode();
|
||||
hash = hash * 17 + hex.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
public static bool operator ==(FormatElement x, FormatElement y)
|
||||
{
|
||||
if ((object)x == null) return false;
|
||||
if ((object)y == null) return false;
|
||||
|
||||
return x.name == y.name &&
|
||||
x.buffer == y.buffer &&
|
||||
x.offset == y.offset &&
|
||||
x.format == y.format &&
|
||||
x.perinstance == y.perinstance &&
|
||||
x.rowmajor == y.rowmajor &&
|
||||
x.matrixdim == y.matrixdim &&
|
||||
x.hex == y.hex;
|
||||
}
|
||||
public static bool operator !=(FormatElement x, FormatElement y)
|
||||
{
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public uint ByteSize
|
||||
{
|
||||
get
|
||||
|
||||
@@ -343,8 +343,7 @@ namespace renderdoc
|
||||
None = 0,
|
||||
Solid,
|
||||
Lit,
|
||||
Tex,
|
||||
VertCol,
|
||||
Secondary,
|
||||
};
|
||||
|
||||
public enum TriangleFillMode
|
||||
|
||||
@@ -132,11 +132,22 @@ namespace renderdoc
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return rawType.GetHashCode();
|
||||
int hash = specialFormat.GetHashCode() * 17;
|
||||
hash = hash * 17 + compCount.GetHashCode();
|
||||
hash = hash * 17 + compByteWidth.GetHashCode();
|
||||
hash = hash * 17 + compType.GetHashCode();
|
||||
hash = hash * 17 + srgbCorrected.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
public static bool operator ==(ResourceFormat x, ResourceFormat y)
|
||||
{
|
||||
return x.rawType == y.rawType;
|
||||
if (x.special || y.special)
|
||||
return x.special == y.special && x.specialFormat == y.specialFormat;
|
||||
|
||||
return x.compCount == y.compCount &&
|
||||
x.compByteWidth == y.compByteWidth &&
|
||||
x.compType == y.compType &&
|
||||
x.srgbCorrected == y.srgbCorrected;
|
||||
}
|
||||
public static bool operator !=(ResourceFormat x, ResourceFormat y)
|
||||
{
|
||||
@@ -341,6 +352,19 @@ namespace renderdoc
|
||||
public DebugMessage[] debugMessages;
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MeshFormat
|
||||
{
|
||||
public ResourceId buf;
|
||||
public UInt32 offset;
|
||||
public UInt32 stride;
|
||||
public UInt32 compCount;
|
||||
public UInt32 compByteWidth;
|
||||
public FormatComponentType compType;
|
||||
public SpecialFormat specialFormat;
|
||||
public bool showAlpha;
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class MeshDisplay
|
||||
{
|
||||
@@ -357,13 +381,8 @@ namespace renderdoc
|
||||
public bool thisDrawOnly = true;
|
||||
|
||||
public UInt32 highlightVert;
|
||||
public ResourceId positionBuf;
|
||||
public UInt32 positionOffset;
|
||||
public UInt32 positionStride;
|
||||
public UInt32 positionCompCount;
|
||||
public UInt32 positionCompByteWidth;
|
||||
public FormatComponentType positionCompType;
|
||||
public SpecialFormat positionFormat;
|
||||
public MeshFormat position;
|
||||
public MeshFormat secondary;
|
||||
|
||||
public FloatVector prevMeshColour = new FloatVector();
|
||||
public FloatVector currentMeshColour = new FloatVector();
|
||||
|
||||
+129
-69
@@ -35,21 +35,21 @@
|
||||
System.Windows.Forms.Label label3;
|
||||
System.Windows.Forms.Label label5;
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BufferViewer));
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin3 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin();
|
||||
WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin3 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient7 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient15 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin3 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient16 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient8 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient17 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient18 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient19 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient9 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient20 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient21 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin();
|
||||
WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
|
||||
this.previewTable = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.render = new renderdocui.Controls.NoScrollPanel();
|
||||
@@ -114,6 +114,12 @@
|
||||
this.instLabel = new System.Windows.Forms.ToolStripLabel();
|
||||
this.instanceIdxToolitem = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.gsOutBufferView = new System.Windows.Forms.DataGridView();
|
||||
this.columnContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.resetSelectedColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.selectColumnAsPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.selectColumnAsSecondaryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.selectAlphaAsSecondaryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
label7 = new System.Windows.Forms.Label();
|
||||
label6 = new System.Windows.Forms.Label();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
@@ -134,6 +140,7 @@
|
||||
this.flowLayoutPanel2.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gsOutBufferView)).BeginInit();
|
||||
this.columnContextMenu.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label7
|
||||
@@ -469,8 +476,7 @@
|
||||
"None",
|
||||
"Solid Colour",
|
||||
"Flat Shaded",
|
||||
"TEXCOORD0",
|
||||
"COLOR0"});
|
||||
"Secondary"});
|
||||
this.solidShading.Name = "solidShading";
|
||||
this.solidShading.Size = new System.Drawing.Size(121, 25);
|
||||
this.solidShading.SelectedIndexChanged += new System.EventHandler(this.solidShading_SelectedIndexChanged);
|
||||
@@ -573,7 +579,7 @@
|
||||
this.previewTab.SelectedIndex = 0;
|
||||
this.previewTab.Size = new System.Drawing.Size(559, 313);
|
||||
this.previewTab.TabIndex = 1;
|
||||
this.previewTab.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
|
||||
this.previewTab.SelectedIndexChanged += new System.EventHandler(this.meshStageDraw_SelectedIndexChanged);
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
@@ -624,13 +630,14 @@
|
||||
this.vsInBufferView.Size = new System.Drawing.Size(246, 85);
|
||||
this.vsInBufferView.TabIndex = 10;
|
||||
this.vsInBufferView.VirtualMode = true;
|
||||
this.vsInBufferView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.bufferView_MouseClick);
|
||||
this.vsInBufferView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.bufferView_CellValueNeeded);
|
||||
this.vsInBufferView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.bufferView_ColumnHeaderMouseClick);
|
||||
this.vsInBufferView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.bufferView_Scroll);
|
||||
this.vsInBufferView.SelectionChanged += new System.EventHandler(this.bufferView_SelectionChanged);
|
||||
this.vsInBufferView.Paint += new System.Windows.Forms.PaintEventHandler(this.bufferView_Paint);
|
||||
this.vsInBufferView.Enter += new System.EventHandler(this.bufferView_EnterLeave);
|
||||
this.vsInBufferView.Leave += new System.EventHandler(this.bufferView_EnterLeave);
|
||||
this.vsInBufferView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bufferView_MouseClick);
|
||||
//
|
||||
// csvSaveDialog
|
||||
//
|
||||
@@ -662,13 +669,14 @@
|
||||
this.vsOutBufferView.Size = new System.Drawing.Size(206, 85);
|
||||
this.vsOutBufferView.TabIndex = 11;
|
||||
this.vsOutBufferView.VirtualMode = true;
|
||||
this.vsOutBufferView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.bufferView_MouseClick);
|
||||
this.vsOutBufferView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.bufferView_CellValueNeeded);
|
||||
this.vsOutBufferView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.bufferView_ColumnHeaderMouseClick);
|
||||
this.vsOutBufferView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.bufferView_Scroll);
|
||||
this.vsOutBufferView.SelectionChanged += new System.EventHandler(this.bufferView_SelectionChanged);
|
||||
this.vsOutBufferView.Paint += new System.Windows.Forms.PaintEventHandler(this.bufferView_Paint);
|
||||
this.vsOutBufferView.Enter += new System.EventHandler(this.bufferView_EnterLeave);
|
||||
this.vsOutBufferView.Leave += new System.EventHandler(this.bufferView_EnterLeave);
|
||||
this.vsOutBufferView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bufferView_MouseClick);
|
||||
//
|
||||
// dockPanel
|
||||
//
|
||||
@@ -680,52 +688,52 @@
|
||||
this.dockPanel.Location = new System.Drawing.Point(3, 34);
|
||||
this.dockPanel.Name = "dockPanel";
|
||||
this.dockPanel.Size = new System.Drawing.Size(834, 462);
|
||||
dockPanelGradient7.EndColor = System.Drawing.SystemColors.ControlLight;
|
||||
dockPanelGradient7.StartColor = System.Drawing.SystemColors.ControlLight;
|
||||
autoHideStripSkin3.DockStripGradient = dockPanelGradient7;
|
||||
tabGradient15.EndColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient15.StartColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient15.TextColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
autoHideStripSkin3.TabGradient = tabGradient15;
|
||||
autoHideStripSkin3.TextFont = new System.Drawing.Font("Tahoma", 8.25F);
|
||||
dockPanelSkin3.AutoHideStripSkin = autoHideStripSkin3;
|
||||
tabGradient16.EndColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
tabGradient16.StartColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
tabGradient16.TextColor = System.Drawing.SystemColors.ControlText;
|
||||
dockPaneStripGradient3.ActiveTabGradient = tabGradient16;
|
||||
dockPanelGradient8.EndColor = System.Drawing.SystemColors.Control;
|
||||
dockPanelGradient8.StartColor = System.Drawing.SystemColors.Control;
|
||||
dockPaneStripGradient3.DockStripGradient = dockPanelGradient8;
|
||||
tabGradient17.EndColor = System.Drawing.SystemColors.ControlLight;
|
||||
tabGradient17.StartColor = System.Drawing.SystemColors.ControlLight;
|
||||
tabGradient17.TextColor = System.Drawing.SystemColors.ControlText;
|
||||
dockPaneStripGradient3.InactiveTabGradient = tabGradient17;
|
||||
dockPaneStripSkin3.DocumentGradient = dockPaneStripGradient3;
|
||||
dockPaneStripSkin3.TextFont = new System.Drawing.Font("Tahoma", 8.25F);
|
||||
tabGradient18.EndColor = System.Drawing.SystemColors.ActiveCaption;
|
||||
tabGradient18.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
|
||||
tabGradient18.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
|
||||
tabGradient18.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
dockPaneStripToolWindowGradient3.ActiveCaptionGradient = tabGradient18;
|
||||
tabGradient19.EndColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient19.StartColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient19.TextColor = System.Drawing.SystemColors.ControlText;
|
||||
dockPaneStripToolWindowGradient3.ActiveTabGradient = tabGradient19;
|
||||
dockPanelGradient9.EndColor = System.Drawing.SystemColors.ControlLight;
|
||||
dockPanelGradient9.StartColor = System.Drawing.SystemColors.ControlLight;
|
||||
dockPaneStripToolWindowGradient3.DockStripGradient = dockPanelGradient9;
|
||||
tabGradient20.EndColor = System.Drawing.SystemColors.InactiveCaption;
|
||||
tabGradient20.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
|
||||
tabGradient20.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
|
||||
tabGradient20.TextColor = System.Drawing.SystemColors.InactiveCaptionText;
|
||||
dockPaneStripToolWindowGradient3.InactiveCaptionGradient = tabGradient20;
|
||||
tabGradient21.EndColor = System.Drawing.Color.Transparent;
|
||||
tabGradient21.StartColor = System.Drawing.Color.Transparent;
|
||||
tabGradient21.TextColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
dockPaneStripToolWindowGradient3.InactiveTabGradient = tabGradient21;
|
||||
dockPaneStripSkin3.ToolWindowGradient = dockPaneStripToolWindowGradient3;
|
||||
dockPanelSkin3.DockPaneStripSkin = dockPaneStripSkin3;
|
||||
this.dockPanel.Skin = dockPanelSkin3;
|
||||
dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
|
||||
dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
|
||||
autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
|
||||
tabGradient1.EndColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient1.StartColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
autoHideStripSkin1.TabGradient = tabGradient1;
|
||||
autoHideStripSkin1.TextFont = new System.Drawing.Font("Tahoma", 8.25F);
|
||||
dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
|
||||
tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
tabGradient2.TextColor = System.Drawing.SystemColors.ControlText;
|
||||
dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
|
||||
dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control;
|
||||
dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control;
|
||||
dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
|
||||
tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
|
||||
tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
|
||||
tabGradient3.TextColor = System.Drawing.SystemColors.ControlText;
|
||||
dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
|
||||
dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
|
||||
dockPaneStripSkin1.TextFont = new System.Drawing.Font("Tahoma", 8.25F);
|
||||
tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption;
|
||||
tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
|
||||
tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
|
||||
tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
|
||||
tabGradient5.EndColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient5.StartColor = System.Drawing.SystemColors.Control;
|
||||
tabGradient5.TextColor = System.Drawing.SystemColors.ControlText;
|
||||
dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
|
||||
dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
|
||||
dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
|
||||
dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
|
||||
tabGradient6.EndColor = System.Drawing.SystemColors.InactiveCaption;
|
||||
tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
|
||||
tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
|
||||
tabGradient6.TextColor = System.Drawing.SystemColors.InactiveCaptionText;
|
||||
dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
|
||||
tabGradient7.EndColor = System.Drawing.Color.Transparent;
|
||||
tabGradient7.StartColor = System.Drawing.Color.Transparent;
|
||||
tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
|
||||
dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
|
||||
dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
|
||||
this.dockPanel.Skin = dockPanelSkin1;
|
||||
this.dockPanel.TabIndex = 12;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
@@ -749,7 +757,7 @@
|
||||
this.flowLayoutPanel2.Controls.Add(this.toolStrip1);
|
||||
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 3);
|
||||
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
this.flowLayoutPanel2.Size = new System.Drawing.Size(759, 25);
|
||||
this.flowLayoutPanel2.Size = new System.Drawing.Size(728, 25);
|
||||
this.flowLayoutPanel2.TabIndex = 0;
|
||||
//
|
||||
// toolStrip1
|
||||
@@ -774,7 +782,7 @@
|
||||
this.instanceIdxToolitem});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.Size = new System.Drawing.Size(759, 25);
|
||||
this.toolStrip1.Size = new System.Drawing.Size(728, 25);
|
||||
this.toolStrip1.TabIndex = 0;
|
||||
this.toolStrip1.Text = "toolStrip1";
|
||||
//
|
||||
@@ -929,13 +937,58 @@
|
||||
this.gsOutBufferView.Size = new System.Drawing.Size(206, 85);
|
||||
this.gsOutBufferView.TabIndex = 14;
|
||||
this.gsOutBufferView.VirtualMode = true;
|
||||
this.gsOutBufferView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.bufferView_MouseClick);
|
||||
this.gsOutBufferView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.bufferView_CellValueNeeded);
|
||||
this.gsOutBufferView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.bufferView_ColumnHeaderMouseClick);
|
||||
this.gsOutBufferView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.bufferView_Scroll);
|
||||
this.gsOutBufferView.SelectionChanged += new System.EventHandler(this.bufferView_SelectionChanged);
|
||||
this.gsOutBufferView.Paint += new System.Windows.Forms.PaintEventHandler(this.bufferView_Paint);
|
||||
this.gsOutBufferView.Enter += new System.EventHandler(this.bufferView_EnterLeave);
|
||||
this.gsOutBufferView.Leave += new System.EventHandler(this.bufferView_EnterLeave);
|
||||
this.gsOutBufferView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bufferView_MouseClick);
|
||||
//
|
||||
// columnContextMenu
|
||||
//
|
||||
this.columnContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.resetSelectedColumnsToolStripMenuItem,
|
||||
this.toolStripSeparator5,
|
||||
this.selectColumnAsPositionToolStripMenuItem,
|
||||
this.selectColumnAsSecondaryToolStripMenuItem,
|
||||
this.selectAlphaAsSecondaryToolStripMenuItem});
|
||||
this.columnContextMenu.Name = "columnContextMenu";
|
||||
this.columnContextMenu.Size = new System.Drawing.Size(202, 98);
|
||||
//
|
||||
// resetSelectedColumnsToolStripMenuItem
|
||||
//
|
||||
this.resetSelectedColumnsToolStripMenuItem.Name = "resetSelectedColumnsToolStripMenuItem";
|
||||
this.resetSelectedColumnsToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.resetSelectedColumnsToolStripMenuItem.Text = "Reset Selected Columns";
|
||||
this.resetSelectedColumnsToolStripMenuItem.Click += new System.EventHandler(this.resetSelectedColumnsToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator5
|
||||
//
|
||||
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||
this.toolStripSeparator5.Size = new System.Drawing.Size(198, 6);
|
||||
//
|
||||
// selectColumnAsPositionToolStripMenuItem
|
||||
//
|
||||
this.selectColumnAsPositionToolStripMenuItem.Name = "selectColumnAsPositionToolStripMenuItem";
|
||||
this.selectColumnAsPositionToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.selectColumnAsPositionToolStripMenuItem.Text = "Select as Position";
|
||||
this.selectColumnAsPositionToolStripMenuItem.Click += new System.EventHandler(this.selectColumnAsPositionToolStripMenuItem_Click);
|
||||
//
|
||||
// selectColumnAsSecondaryToolStripMenuItem
|
||||
//
|
||||
this.selectColumnAsSecondaryToolStripMenuItem.Name = "selectColumnAsSecondaryToolStripMenuItem";
|
||||
this.selectColumnAsSecondaryToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.selectColumnAsSecondaryToolStripMenuItem.Text = "Select as Secondary";
|
||||
this.selectColumnAsSecondaryToolStripMenuItem.Click += new System.EventHandler(this.selectColumnAsSecondaryToolStripMenuItem_Click);
|
||||
//
|
||||
// selectAlphaAsSecondaryToolStripMenuItem
|
||||
//
|
||||
this.selectAlphaAsSecondaryToolStripMenuItem.Name = "selectAlphaAsSecondaryToolStripMenuItem";
|
||||
this.selectAlphaAsSecondaryToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.selectAlphaAsSecondaryToolStripMenuItem.Text = "Select Alpha as Secondary";
|
||||
this.selectAlphaAsSecondaryToolStripMenuItem.Click += new System.EventHandler(this.selectAlphaAsSecondaryToolStripMenuItem_Click);
|
||||
//
|
||||
// BufferViewer
|
||||
//
|
||||
@@ -973,6 +1026,7 @@
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gsOutBufferView)).EndInit();
|
||||
this.columnContextMenu.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -1043,6 +1097,12 @@
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.DataGridView gsOutBufferView;
|
||||
private System.Windows.Forms.ToolStripButton highlightVerts;
|
||||
private System.Windows.Forms.ContextMenuStrip columnContextMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem resetSelectedColumnsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
|
||||
private System.Windows.Forms.ToolStripMenuItem selectColumnAsPositionToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem selectColumnAsSecondaryToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem selectAlphaAsSecondaryToolStripMenuItem;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -95,8 +95,15 @@ namespace renderdocui.Windows
|
||||
// visible data in the UI.
|
||||
private class UIState
|
||||
{
|
||||
public UIState(MeshDataStage stage)
|
||||
{
|
||||
m_Stage = stage;
|
||||
}
|
||||
|
||||
public Input m_Input = null;
|
||||
|
||||
public MeshDataStage m_Stage = MeshDataStage.VSIn;
|
||||
|
||||
public Dataset m_Data = null;
|
||||
public Stream[] m_Stream = null;
|
||||
public BinaryReader[] m_Reader = null;
|
||||
@@ -135,9 +142,9 @@ namespace renderdocui.Windows
|
||||
}
|
||||
|
||||
// one UI state for each stage
|
||||
private UIState m_VSIn = new UIState();
|
||||
private UIState m_VSOut = new UIState();
|
||||
private UIState m_GSOut = new UIState();
|
||||
private UIState m_VSIn = new UIState(MeshDataStage.VSIn);
|
||||
private UIState m_VSOut = new UIState(MeshDataStage.VSOut);
|
||||
private UIState m_GSOut = new UIState(MeshDataStage.GSOut);
|
||||
|
||||
// this points to the 'highlighted'/current UI state.
|
||||
private UIState m_ContextUIState = null;
|
||||
@@ -444,8 +451,6 @@ namespace renderdocui.Windows
|
||||
var contentsVSOut = RT_FetchBufferContents(MeshDataStage.VSOut, r, m_VSOut.m_Input);
|
||||
var contentsGSOut = RT_FetchBufferContents(MeshDataStage.GSOut, r, m_GSOut.m_Input);
|
||||
|
||||
UpdateMeshPositionBuffer();
|
||||
|
||||
if (curReq != m_ReqID)
|
||||
return;
|
||||
|
||||
@@ -454,20 +459,21 @@ namespace renderdocui.Windows
|
||||
if (curReq != m_ReqID)
|
||||
return;
|
||||
|
||||
UI_SetColumns(MeshDataStage.VSIn, m_VSIn.m_Input.BufferFormats);
|
||||
UI_AutoFetchRenderComponents(MeshDataStage.VSIn, true);
|
||||
UI_AutoFetchRenderComponents(MeshDataStage.VSOut, true);
|
||||
UI_AutoFetchRenderComponents(MeshDataStage.GSOut, true);
|
||||
UI_AutoFetchRenderComponents(MeshDataStage.VSIn, false);
|
||||
UI_AutoFetchRenderComponents(MeshDataStage.VSOut, false);
|
||||
UI_AutoFetchRenderComponents(MeshDataStage.GSOut, false);
|
||||
UI_UpdateMeshRenderComponents();
|
||||
|
||||
UI_SetAllColumns();
|
||||
|
||||
UI_SetRowsData(MeshDataStage.VSIn, contentsVSIn);
|
||||
|
||||
if (m_VSOut.m_Input != null)
|
||||
{
|
||||
UI_SetColumns(MeshDataStage.VSOut, m_VSOut.m_Input.BufferFormats);
|
||||
UI_SetRowsData(MeshDataStage.VSOut, contentsVSOut);
|
||||
}
|
||||
|
||||
if (m_GSOut.m_Input != null)
|
||||
{
|
||||
UI_SetColumns(MeshDataStage.GSOut, m_GSOut.m_Input.BufferFormats);
|
||||
UI_SetRowsData(MeshDataStage.GSOut, contentsGSOut);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
@@ -514,18 +520,34 @@ namespace renderdocui.Windows
|
||||
|
||||
if (MeshView)
|
||||
{
|
||||
MeshDataStage[] stages = new MeshDataStage[] { MeshDataStage.VSIn, MeshDataStage.VSOut, MeshDataStage.GSOut };
|
||||
|
||||
FormatElement[] prevPos = new FormatElement[3];
|
||||
FormatElement[] prevSecond = new FormatElement[3];
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
prevPos[i] = GetPosHighlightFormatElement(stages[i]);
|
||||
prevSecond[i] = GetSecondHighlightFormatElement(stages[i]);
|
||||
}
|
||||
|
||||
m_VSIn.m_Input = GetCurrentMeshInput(draw, MeshDataStage.VSIn);
|
||||
m_VSOut.m_Input = GetCurrentMeshInput(draw, MeshDataStage.VSOut);
|
||||
m_GSOut.m_Input = GetCurrentMeshInput(draw, MeshDataStage.GSOut);
|
||||
|
||||
for(int i=0; i < 3; i++)
|
||||
{
|
||||
FormatElement curPos = GetPosHighlightFormatElement(stages[i]);
|
||||
FormatElement curSecond = GetSecondHighlightFormatElement(stages[i]);
|
||||
if (prevPos[i] != curPos) UI_AutoFetchRenderComponents(stages[i], true);
|
||||
if (prevSecond[i] != curSecond) UI_AutoFetchRenderComponents(stages[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
var contentsVSIn = RT_FetchBufferContents(MeshDataStage.VSIn, r, m_VSIn.m_Input);
|
||||
var contentsVSOut = RT_FetchBufferContents(MeshDataStage.VSOut, r, m_VSOut.m_Input);
|
||||
var contentsGSOut = RT_FetchBufferContents(MeshDataStage.GSOut, r, m_GSOut.m_Input);
|
||||
|
||||
if (MeshView)
|
||||
UpdateMeshPositionBuffer();
|
||||
|
||||
if (curReq != m_ReqID)
|
||||
return;
|
||||
|
||||
@@ -534,32 +556,24 @@ namespace renderdocui.Windows
|
||||
if (curReq != m_ReqID)
|
||||
return;
|
||||
|
||||
if (MeshView)
|
||||
UI_UpdateMeshRenderComponents();
|
||||
|
||||
m_VSIn.AbortThread();
|
||||
m_VSOut.AbortThread();
|
||||
m_GSOut.AbortThread();
|
||||
|
||||
UI_SetAllColumns();
|
||||
|
||||
if (m_VSIn.m_Input != null)
|
||||
{
|
||||
UI_SetColumns(MeshDataStage.VSIn, m_VSIn.m_Input.BufferFormats);
|
||||
UI_SetRowsData(MeshDataStage.VSIn, contentsVSIn);
|
||||
}
|
||||
|
||||
if (m_VSOut.m_Input != null)
|
||||
{
|
||||
UI_SetColumns(MeshDataStage.VSOut, m_VSOut.m_Input.BufferFormats);
|
||||
UI_SetRowsData(MeshDataStage.VSOut, contentsVSOut);
|
||||
}
|
||||
|
||||
if (m_GSOut.m_Input != null)
|
||||
{
|
||||
UI_SetColumns(MeshDataStage.GSOut, m_GSOut.m_Input.BufferFormats);
|
||||
UI_SetRowsData(MeshDataStage.GSOut, contentsGSOut);
|
||||
}
|
||||
}));
|
||||
|
||||
RT_UpdateRenderOutput(r);
|
||||
if (m_Output != null)
|
||||
m_Output.Display();
|
||||
render.Invalidate();
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1022,6 +1036,49 @@ namespace renderdocui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void UI_UpdateMeshColumns(MeshDataStage type, FormatElement[] el)
|
||||
{
|
||||
bool active = (type == m_MeshDisplay.type);
|
||||
bool input = (type == MeshDataStage.VSIn);
|
||||
var bufView = GetUIState(type).m_GridView;
|
||||
|
||||
if (bufView.ColumnCount == 0)
|
||||
return;
|
||||
|
||||
int colidx = 2; // skip VTX and IDX columns
|
||||
Color defaultCol = bufView.Columns[0].DefaultCellStyle.BackColor;
|
||||
|
||||
for (int e = 0; e < el.Length; e++)
|
||||
{
|
||||
for (int i = 0; i < el[e].format.compCount; i++)
|
||||
{
|
||||
if (colidx >= bufView.ColumnCount)
|
||||
return;
|
||||
|
||||
DataGridViewColumn col = bufView.Columns[colidx];
|
||||
colidx++;
|
||||
|
||||
if (e == CurPosElement && active)
|
||||
{
|
||||
if (i != 3 || !input)
|
||||
col.DefaultCellStyle.BackColor = Color.SkyBlue;
|
||||
else
|
||||
col.DefaultCellStyle.BackColor = Color.LightCyan;
|
||||
}
|
||||
else if (e == CurSecondElement && active && m_MeshDisplay.solidShadeMode == SolidShadeMode.Secondary)
|
||||
{
|
||||
if ((m_MeshDisplay.secondary.showAlpha && i == 3) ||
|
||||
(!m_MeshDisplay.secondary.showAlpha && i != 3))
|
||||
col.DefaultCellStyle.BackColor = Color.LightGreen;
|
||||
else
|
||||
col.DefaultCellStyle.BackColor = Color.FromArgb(200, 238, 200);
|
||||
}
|
||||
else
|
||||
col.DefaultCellStyle.BackColor = defaultCol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UI_SetMeshColumns(MeshDataStage type, FormatElement[] el)
|
||||
{
|
||||
var bufView = GetUIState(type).m_GridView;
|
||||
@@ -1066,13 +1123,14 @@ namespace renderdocui.Windows
|
||||
col.ReadOnly = true;
|
||||
col.SortMode = DataGridViewColumnSortMode.Programmatic;
|
||||
col.DefaultCellStyle.Padding = new Padding(0, 2, 0, 2);
|
||||
|
||||
bufView.Columns.Add(col);
|
||||
}
|
||||
|
||||
if (e < el.Length-1)
|
||||
bufView.Columns[bufView.Columns.Count - 1].DividerWidth = 10;
|
||||
}
|
||||
|
||||
UI_UpdateMeshColumns(type, el);
|
||||
}
|
||||
|
||||
private void UI_SetRawColumns(FormatElement[] el)
|
||||
@@ -1123,6 +1181,26 @@ namespace renderdocui.Windows
|
||||
UI_SetRawColumns(el);
|
||||
}
|
||||
|
||||
private void UI_SetAllColumns()
|
||||
{
|
||||
if (m_VSIn.m_Input != null)
|
||||
UI_SetColumns(MeshDataStage.VSIn, m_VSIn.m_Input.BufferFormats);
|
||||
if (m_VSOut.m_Input != null)
|
||||
UI_SetColumns(MeshDataStage.VSOut, m_VSOut.m_Input.BufferFormats);
|
||||
if (m_GSOut.m_Input != null)
|
||||
UI_SetColumns(MeshDataStage.GSOut, m_GSOut.m_Input.BufferFormats);
|
||||
}
|
||||
|
||||
private void UI_UpdateAllColumns()
|
||||
{
|
||||
if (m_VSIn.m_Input != null)
|
||||
UI_UpdateMeshColumns(MeshDataStage.VSIn, m_VSIn.m_Input.BufferFormats);
|
||||
if (m_VSOut.m_Input != null)
|
||||
UI_UpdateMeshColumns(MeshDataStage.VSOut, m_VSOut.m_Input.BufferFormats);
|
||||
if (m_GSOut.m_Input != null)
|
||||
UI_UpdateMeshColumns(MeshDataStage.GSOut, m_GSOut.m_Input.BufferFormats);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Setting Row Data
|
||||
@@ -1690,7 +1768,6 @@ namespace renderdocui.Windows
|
||||
}
|
||||
|
||||
m_CurrentCamera.Apply();
|
||||
m_Core.Renderer.BeginInvoke(RT_UpdateRenderOutput);
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
@@ -1721,7 +1798,6 @@ namespace renderdocui.Windows
|
||||
camSpeed.Value = Helpers.Clamp((decimal)(diag.Length() / 200.0f), camSpeed.Minimum, camSpeed.Maximum);
|
||||
|
||||
m_CurrentCamera.Apply();
|
||||
m_Core.Renderer.BeginInvoke(RT_UpdateRenderOutput);
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
@@ -1734,7 +1810,6 @@ namespace renderdocui.Windows
|
||||
if (m_CurrentCamera.Dirty)
|
||||
{
|
||||
m_CurrentCamera.Apply();
|
||||
m_Core.Renderer.BeginInvoke(RT_UpdateRenderOutput);
|
||||
render.Invalidate();
|
||||
}
|
||||
}
|
||||
@@ -1800,7 +1875,6 @@ namespace renderdocui.Windows
|
||||
UpdateHighlightVerts(GetUIState(m_MeshDisplay.type));
|
||||
|
||||
m_CurrentCamera.Apply();
|
||||
m_Core.Renderer.BeginInvoke(RT_UpdateRenderOutput);
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
@@ -1841,7 +1915,7 @@ namespace renderdocui.Windows
|
||||
return;
|
||||
}
|
||||
|
||||
m_Core.Renderer.Invoke((ReplayRenderer r) => { if (m_Output != null) m_Output.Display(); });
|
||||
m_Core.Renderer.Invoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
}
|
||||
|
||||
private void BufferViewer_Load(object sender, EventArgs e)
|
||||
@@ -1935,18 +2009,25 @@ namespace renderdocui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
private void meshStageDraw_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
previewTable.Parent = previewTab.SelectedTab;
|
||||
if (previewTab.SelectedIndex == 0)
|
||||
m_MeshDisplay.type = MeshDataStage.VSIn;
|
||||
else if (previewTab.SelectedIndex == 1)
|
||||
m_MeshDisplay.type = MeshDataStage.VSOut;
|
||||
else if (previewTab.SelectedIndex == 2)
|
||||
m_MeshDisplay.type = MeshDataStage.GSOut;
|
||||
|
||||
drawRange.Enabled = (m_MeshDisplay.type != MeshDataStage.VSIn);
|
||||
|
||||
UI_UpdateMeshRenderComponents();
|
||||
|
||||
if (previewTab.SelectedIndex == 0)
|
||||
{
|
||||
m_MeshDisplay.type = MeshDataStage.VSIn;
|
||||
controlType.SelectedIndex = 0;
|
||||
}
|
||||
else if (previewTab.SelectedIndex == 1)
|
||||
{
|
||||
m_MeshDisplay.type = MeshDataStage.VSOut;
|
||||
if (m_Core.CurPipelineState.IsTessellationEnabled)
|
||||
controlType.SelectedIndex = 0;
|
||||
else
|
||||
@@ -1954,52 +2035,188 @@ namespace renderdocui.Windows
|
||||
}
|
||||
else if (previewTab.SelectedIndex == 2)
|
||||
{
|
||||
m_MeshDisplay.type = MeshDataStage.GSOut;
|
||||
controlType.SelectedIndex = 1;
|
||||
}
|
||||
|
||||
UpdateMeshPositionBuffer();
|
||||
|
||||
enableCameraControls();
|
||||
|
||||
controlType_SelectedIndexChanged(sender, e);
|
||||
|
||||
previewTable.Parent = previewTab.SelectedTab;
|
||||
}
|
||||
|
||||
private void UpdateMeshPositionBuffer()
|
||||
private int[] m_PosElement = new int[] { -1, -1, -1, -1 };
|
||||
private int[] m_SecondElement = new int[] { -1, -1, -1, -1 };
|
||||
private bool[] m_SecondShowAlpha = new bool[] { false, false, false, false };
|
||||
|
||||
private int CurPosElement { get { return m_PosElement[(int)m_MeshDisplay.type]; } }
|
||||
private int CurSecondElement { get { return m_SecondElement[(int)m_MeshDisplay.type]; } }
|
||||
private bool CurSecondShowAlpha { get { return m_SecondShowAlpha[(int)m_MeshDisplay.type]; } }
|
||||
|
||||
private FormatElement GetPosHighlightFormatElement(MeshDataStage stage)
|
||||
{
|
||||
var ui = GetUIState(m_MeshDisplay.type);
|
||||
|
||||
FormatElement pos = null;
|
||||
int idx = m_PosElement[(int)stage];
|
||||
|
||||
if (ui.m_Input != null && ui.m_Input.BufferFormats != null)
|
||||
if (ui.m_Input == null || ui.m_Input.BufferFormats == null ||
|
||||
idx == -1 || idx >= ui.m_Input.BufferFormats.Length)
|
||||
return null;
|
||||
|
||||
return ui.m_Input.BufferFormats[idx];
|
||||
}
|
||||
|
||||
private FormatElement GetSecondHighlightFormatElement(MeshDataStage stage)
|
||||
{
|
||||
var ui = GetUIState(m_MeshDisplay.type);
|
||||
|
||||
int idx = m_SecondElement[(int)stage];
|
||||
|
||||
if (ui.m_Input == null || ui.m_Input.BufferFormats == null ||
|
||||
idx == -1 || idx >= ui.m_Input.BufferFormats.Length)
|
||||
return null;
|
||||
|
||||
return ui.m_Input.BufferFormats[idx];
|
||||
}
|
||||
|
||||
private void UI_AutoFetchRenderComponents(MeshDataStage stage, bool pos)
|
||||
{
|
||||
var ui = GetUIState(stage);
|
||||
|
||||
if (pos)
|
||||
{
|
||||
foreach (var el in ui.m_Input.BufferFormats)
|
||||
int posEl = -1;
|
||||
|
||||
if (ui.m_Input != null && ui.m_Input.BufferFormats != null)
|
||||
{
|
||||
// prioritise SV_Position over general POSITION
|
||||
if (el.name.ToUpperInvariant() == "SV_POSITION")
|
||||
pos = el;
|
||||
if (el.name.ToUpperInvariant() == "POSITION" && pos == null)
|
||||
pos = el;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ui.m_Input.BufferFormats.Length; i++)
|
||||
{
|
||||
FormatElement el = ui.m_Input.BufferFormats[i];
|
||||
|
||||
if (pos == null)
|
||||
{
|
||||
m_MeshDisplay.positionBuf = ResourceId.Null;
|
||||
if (el.name.ToUpperInvariant() == "SV_POSITION")
|
||||
{
|
||||
posEl = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; posEl == -1 && i < ui.m_Input.BufferFormats.Length; i++)
|
||||
{
|
||||
FormatElement el = ui.m_Input.BufferFormats[i];
|
||||
|
||||
if (el.name.ToUpperInvariant() == "POSITION" ||
|
||||
el.name.ToUpperInvariant() == "POSITION0" ||
|
||||
el.name.ToUpperInvariant() == "POS" ||
|
||||
el.name.ToUpperInvariant() == "POS0")
|
||||
{
|
||||
posEl = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_PosElement[(int)stage] = posEl;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_MeshDisplay.positionBuf = m_VSIn.m_Input.Buffers[pos.buffer];
|
||||
m_MeshDisplay.positionOffset = pos.offset + ui.m_Input.Offsets[pos.buffer];
|
||||
m_MeshDisplay.positionStride = ui.m_Input.Strides[pos.buffer];
|
||||
int secondEl = -1;
|
||||
|
||||
m_MeshDisplay.positionCompByteWidth = pos.format.compByteWidth;
|
||||
m_MeshDisplay.positionCompCount = pos.format.compCount;
|
||||
m_MeshDisplay.positionCompType = pos.format.compType;
|
||||
m_MeshDisplay.positionFormat = pos.format.special ? pos.format.specialFormat : SpecialFormat.Unknown;
|
||||
if (ui.m_Input != null && ui.m_Input.BufferFormats != null)
|
||||
{
|
||||
// prioritise TEXCOORD over general COLOR
|
||||
for (int i = 0; i < ui.m_Input.BufferFormats.Length; i++)
|
||||
{
|
||||
FormatElement el = ui.m_Input.BufferFormats[i];
|
||||
|
||||
if (el.name.ToUpperInvariant() == "TEXCOORD" ||
|
||||
el.name.ToUpperInvariant() == "TEXCOORD0" ||
|
||||
el.name.ToUpperInvariant() == "TEX" ||
|
||||
el.name.ToUpperInvariant() == "TEX0" ||
|
||||
el.name.ToUpperInvariant() == "UV" ||
|
||||
el.name.ToUpperInvariant() == "UV0")
|
||||
{
|
||||
secondEl = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; secondEl == -1 && i < ui.m_Input.BufferFormats.Length; i++)
|
||||
{
|
||||
FormatElement el = ui.m_Input.BufferFormats[i];
|
||||
|
||||
if (el.name.ToUpperInvariant() == "COLOR" ||
|
||||
el.name.ToUpperInvariant() == "COLOR0" ||
|
||||
el.name.ToUpperInvariant() == "COL" ||
|
||||
el.name.ToUpperInvariant() == "COL0")
|
||||
{
|
||||
secondEl = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_SecondElement[(int)stage] = secondEl;
|
||||
}
|
||||
}
|
||||
|
||||
private void UI_UpdateMeshRenderComponents()
|
||||
{
|
||||
var ui = GetUIState(m_MeshDisplay.type);
|
||||
|
||||
if (ui.m_Input == null || ui.m_Input.BufferFormats == null ||
|
||||
CurPosElement == -1 || CurPosElement >= ui.m_Input.BufferFormats.Length)
|
||||
{
|
||||
m_MeshDisplay.position.buf = ResourceId.Null;
|
||||
m_MeshDisplay.position.offset = 0;
|
||||
m_MeshDisplay.position.stride = 0;
|
||||
m_MeshDisplay.position.compByteWidth = 0;
|
||||
m_MeshDisplay.position.compCount = 0;
|
||||
m_MeshDisplay.position.compType = FormatComponentType.None;
|
||||
m_MeshDisplay.position.specialFormat = SpecialFormat.Unknown;
|
||||
m_MeshDisplay.position.showAlpha = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
FormatElement pos = ui.m_Input.BufferFormats[CurPosElement];
|
||||
|
||||
m_MeshDisplay.position.buf = m_VSIn.m_Input.Buffers[pos.buffer];
|
||||
m_MeshDisplay.position.offset = pos.offset + ui.m_Input.Offsets[pos.buffer];
|
||||
m_MeshDisplay.position.stride = ui.m_Input.Strides[pos.buffer];
|
||||
m_MeshDisplay.position.compByteWidth = pos.format.compByteWidth;
|
||||
m_MeshDisplay.position.compCount = pos.format.compCount;
|
||||
m_MeshDisplay.position.compType = pos.format.compType;
|
||||
m_MeshDisplay.position.specialFormat = pos.format.special ? pos.format.specialFormat : SpecialFormat.Unknown;
|
||||
m_MeshDisplay.position.showAlpha = false;
|
||||
}
|
||||
|
||||
if (ui.m_Input == null || ui.m_Input.BufferFormats == null ||
|
||||
CurSecondElement == -1 || CurSecondElement >= ui.m_Input.BufferFormats.Length)
|
||||
{
|
||||
m_MeshDisplay.secondary.buf = ResourceId.Null;
|
||||
m_MeshDisplay.secondary.offset = 0;
|
||||
m_MeshDisplay.secondary.stride = 0;
|
||||
m_MeshDisplay.secondary.compByteWidth = 0;
|
||||
m_MeshDisplay.secondary.compCount = 0;
|
||||
m_MeshDisplay.secondary.compType = FormatComponentType.None;
|
||||
m_MeshDisplay.secondary.specialFormat = SpecialFormat.Unknown;
|
||||
m_MeshDisplay.secondary.showAlpha = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
FormatElement tex = ui.m_Input.BufferFormats[CurSecondElement];
|
||||
|
||||
m_MeshDisplay.secondary.buf = m_VSIn.m_Input.Buffers[tex.buffer];
|
||||
m_MeshDisplay.secondary.offset = tex.offset + ui.m_Input.Offsets[tex.buffer];
|
||||
m_MeshDisplay.secondary.stride = ui.m_Input.Strides[tex.buffer];
|
||||
m_MeshDisplay.secondary.compByteWidth = tex.format.compByteWidth;
|
||||
m_MeshDisplay.secondary.compCount = tex.format.compCount;
|
||||
m_MeshDisplay.secondary.compType = tex.format.compType;
|
||||
m_MeshDisplay.secondary.specialFormat = tex.format.special ? tex.format.specialFormat : SpecialFormat.Unknown;
|
||||
m_MeshDisplay.secondary.showAlpha = CurSecondShowAlpha;
|
||||
}
|
||||
|
||||
UI_UpdateAllColumns();
|
||||
}
|
||||
|
||||
private void camGuess_PropChanged()
|
||||
{
|
||||
m_MeshDisplay.ortho = matrixType.SelectedIndex == 1;
|
||||
@@ -2049,10 +2266,7 @@ namespace renderdocui.Windows
|
||||
|
||||
farGuess.Text = far > -float.MaxValue ? far.ToString("G") : "";
|
||||
|
||||
|
||||
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void camGuess_KeyPress(object sender, KeyPressEventArgs e)
|
||||
@@ -2073,26 +2287,32 @@ namespace renderdocui.Windows
|
||||
{
|
||||
m_MeshDisplay.thisDrawOnly = (drawRange.SelectedIndex == 0);
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void solidShading_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_MeshDisplay.solidShadeMode = (SolidShadeMode)solidShading.SelectedIndex;
|
||||
|
||||
wireframeDraw.Enabled = (solidShading.SelectedIndex != 0);
|
||||
|
||||
if (solidShading.SelectedIndex == 0 && !wireframeDraw.Checked)
|
||||
wireframeDraw.Checked = true;
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
UI_UpdateAllColumns();
|
||||
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void wireframeDraw_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (solidShading.SelectedIndex == 0 && !wireframeDraw.Checked)
|
||||
{
|
||||
wireframeDraw.Checked = true;
|
||||
return;
|
||||
}
|
||||
|
||||
m_MeshDisplay.wireframeDraw = wireframeDraw.Checked;
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void instanceIdx_KeyDown(object sender, KeyEventArgs e)
|
||||
@@ -2124,9 +2344,79 @@ namespace renderdocui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void bufferView_MouseClick(object sender, MouseEventArgs e)
|
||||
private int m_ContextColumn = 0;
|
||||
|
||||
private void resetSelectedColumnsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (m_Core.LogLoaded)
|
||||
UI_AutoFetchRenderComponents(m_ContextUIState.m_Stage, true);
|
||||
UI_AutoFetchRenderComponents(m_ContextUIState.m_Stage, false);
|
||||
}
|
||||
|
||||
private void selectColumnAsPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_PosElement[(int)m_ContextUIState.m_Stage] = m_ContextColumn;
|
||||
|
||||
UI_UpdateMeshRenderComponents();
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void selectColumnAsSecondaryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_SecondElement[(int)m_ContextUIState.m_Stage] = m_ContextColumn;
|
||||
m_SecondShowAlpha[(int)m_ContextUIState.m_Stage] = false;
|
||||
|
||||
UI_UpdateMeshRenderComponents();
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void selectAlphaAsSecondaryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_SecondElement[(int)m_ContextUIState.m_Stage] = m_ContextColumn;
|
||||
m_SecondShowAlpha[(int)m_ContextUIState.m_Stage] = true;
|
||||
|
||||
UI_UpdateMeshRenderComponents();
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void bufferView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
|
||||
{
|
||||
if (m_Core.LogLoaded && MeshView)
|
||||
{
|
||||
m_ContextUIState = GetUIState(sender);
|
||||
bool input = (m_ContextUIState == m_VSIn);
|
||||
|
||||
if (e.Button == MouseButtons.Right &&
|
||||
m_ContextUIState.m_Input != null &&
|
||||
m_ContextUIState.m_Input.BufferFormats != null)
|
||||
{
|
||||
selectColumnAsPositionToolStripMenuItem.Visible = input;
|
||||
selectAlphaAsSecondaryToolStripMenuItem.Visible = true;
|
||||
|
||||
m_ContextColumn = 0;
|
||||
int colidx = 2; // skip VTX and IDX columns
|
||||
|
||||
for (int el = 0; el < m_ContextUIState.m_Input.BufferFormats.Length; el++)
|
||||
{
|
||||
for (int i = 0; i < m_ContextUIState.m_Input.BufferFormats[el].format.compCount; i++)
|
||||
{
|
||||
if (colidx == e.ColumnIndex)
|
||||
{
|
||||
m_ContextColumn = el;
|
||||
selectAlphaAsSecondaryToolStripMenuItem.Visible = (m_ContextUIState.m_Input.BufferFormats[el].format.compCount >= 4);
|
||||
}
|
||||
|
||||
colidx++;
|
||||
}
|
||||
}
|
||||
|
||||
columnContextMenu.Show(Cursor.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void bufferView_MouseClick(object sender, DataGridViewCellMouseEventArgs e)
|
||||
{
|
||||
if (m_Core.LogLoaded && e.RowIndex >= 0)
|
||||
{
|
||||
m_ContextUIState = GetUIState(sender);
|
||||
|
||||
@@ -2140,7 +2430,7 @@ namespace renderdocui.Windows
|
||||
vsInBufferView.SelectedRows.Count == 1;
|
||||
setInstanceToolStripMenuItem.Enabled = (m_Core.CurDrawcall != null && m_Core.CurDrawcall.numInstances > 1);
|
||||
|
||||
rightclickMenu.Show(((DataGridView)sender).PointToScreen(e.Location));
|
||||
rightclickMenu.Show(Cursor.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2380,7 +2670,7 @@ namespace renderdocui.Windows
|
||||
private void ClearHighlightVerts()
|
||||
{
|
||||
m_MeshDisplay.highlightVert = ~0U;
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
private void UpdateHighlightVerts(UIState ui)
|
||||
@@ -2394,7 +2684,7 @@ namespace renderdocui.Windows
|
||||
else
|
||||
m_MeshDisplay.highlightVert = ~0U;
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { RT_UpdateRenderOutput(r); if (m_Output != null) m_Output.Display(); });
|
||||
render.Invalidate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -135,9 +135,6 @@
|
||||
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>486, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>486, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="wireframeDraw.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
@@ -166,4 +163,7 @@
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>387, 17</value>
|
||||
</metadata>
|
||||
<metadata name="columnContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>585, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Reference in New Issue
Block a user