[Refs #87: Static Analysis] string compare as uppercase or by length

This commit is contained in:
baldurk
2014-10-05 19:01:25 +01:00
parent d29024dd8b
commit e749f42876
20 changed files with 109 additions and 110 deletions
+3 -3
View File
@@ -71,7 +71,7 @@ namespace renderdocui.Code
// save it) // save it)
foreach(var a in args) foreach(var a in args)
{ {
if(a.ToLowerInvariant() == "--tempfile") if(a.ToUpperInvariant() == "--tempfile")
temp = true; temp = true;
} }
@@ -80,7 +80,7 @@ namespace renderdocui.Code
for (int i = 0; i < args.Length; i++) for (int i = 0; i < args.Length; i++)
{ {
if (args[i].ToLowerInvariant() == "--remoteaccess" && i + 1 < args.Length) if (args[i].ToUpperInvariant() == "--remoteaccess" && i + 1 < args.Length)
{ {
var regexp = @"^([a-zA-Z0-9_-]+:)?([0-9]+)$"; var regexp = @"^([a-zA-Z0-9_-]+:)?([0-9]+)$";
@@ -89,7 +89,7 @@ namespace renderdocui.Code
if (match.Success) if (match.Success)
{ {
var host = match.Groups[1].Value; var host = match.Groups[1].Value;
if (host != "" && host[host.Length - 1] == ':') if (host.Length > 0 && host[host.Length - 1] == ':')
host = host.Substring(0, host.Length - 1); host = host.Substring(0, host.Length - 1);
uint ident = 0; uint ident = 0;
if (uint.TryParse(match.Groups[2].Value, out ident)) if (uint.TryParse(match.Groups[2].Value, out ident))
+1 -1
View File
@@ -573,7 +573,7 @@ namespace renderdocui.Code
string folder = Config.CaptureSavePath; string folder = Config.CaptureSavePath;
try try
{ {
if (folder == "" || !Directory.Exists(folder)) if (folder.Length == 0 || !Directory.Exists(folder))
folder = Path.GetTempPath(); folder = Path.GetTempPath();
} }
catch (ArgumentException) catch (ArgumentException)
+1 -1
View File
@@ -319,7 +319,7 @@ namespace renderdocui.Code
var line = l; var line = l;
line = line.Trim(); line = line.Trim();
if (line == "") continue; if (line.Length == 0) continue;
var match = regParser.Match(line); var match = regParser.Match(line);
+1 -1
View File
@@ -160,7 +160,7 @@ namespace renderdocui.Code
foreach (var kv in c.ReplayHostKeyValues) foreach (var kv in c.ReplayHostKeyValues)
{ {
if(kv.Key != null && kv.Key != "" && if (kv.Key != null && kv.Key.Length > 0 &&
kv.Value != null) kv.Value != null)
c.ReplayHosts.Add(kv.Key, kv.Value); c.ReplayHosts.Add(kv.Key, kv.Value);
} }
@@ -61,7 +61,7 @@ namespace renderdocui.Windows.Dialogs
public void SetErrors(string err) public void SetErrors(string err)
{ {
errors.Text = err; errors.Text = err;
if (errors.Text == "") if (errors.Text.Length == 0)
errors.Visible = false; errors.Visible = false;
else else
errors.Visible = true; errors.Visible = true;
+2 -2
View File
@@ -204,8 +204,8 @@ namespace renderdocui.Controls
(m_Core.CurTextures[i].creationFlags & TextureCreationFlags.DSV) > 0)); (m_Core.CurTextures[i].creationFlags & TextureCreationFlags.DSV) > 0));
include |= (Texs && (m_Core.CurTextures[i].creationFlags & TextureCreationFlags.RTV) == 0 && include |= (Texs && (m_Core.CurTextures[i].creationFlags & TextureCreationFlags.RTV) == 0 &&
(m_Core.CurTextures[i].creationFlags & TextureCreationFlags.DSV) == 0); (m_Core.CurTextures[i].creationFlags & TextureCreationFlags.DSV) == 0);
include |= (filter != "" && (m_Core.CurTextures[i].name.ToLowerInvariant().Contains(filter.ToLowerInvariant()))); include |= (filter.Length > 0 && (m_Core.CurTextures[i].name.ToUpperInvariant().Contains(filter.ToUpperInvariant())));
include |= (!RTs && !Texs && filter == ""); include |= (!RTs && !Texs && filter.Length == 0);
if (include) if (include)
{ {
+2 -2
View File
@@ -100,7 +100,7 @@ namespace renderdocui.Windows
for (int i = 1; i < lines.Length; i++) for (int i = 1; i < lines.Length; i++)
{ {
string l = rgx.Replace(lines[i], replacement); string l = rgx.Replace(lines[i], replacement);
if (l != "") if (l.Length == 0)
node.Nodes.Add(new TreelistView.Node(new object[] { "", l })); node.Nodes.Add(new TreelistView.Node(new object[] { "", l }));
} }
@@ -164,7 +164,7 @@ namespace renderdocui.Windows
callstack.Items.Clear(); callstack.Items.Clear();
if (calls.Length == 1 && calls[0] == "") if (calls.Length == 1 && calls[0].Length == 0)
{ {
callstack.Items.Add("Symbols not loaded. Tools -> Resolve Symbols."); callstack.Items.Add("Symbols not loaded. Tools -> Resolve Symbols.");
} }
+8 -8
View File
@@ -720,7 +720,7 @@ namespace renderdocui.Windows
f[i] = new FormatElement(); f[i] = new FormatElement();
f[i].buffer = 0; f[i].buffer = 0;
f[i].name = details.OutputSig[i].varName != "" ? details.OutputSig[i].varName : details.OutputSig[i].semanticIdxName; f[i].name = details.OutputSig[i].varName.Length > 0 ? details.OutputSig[i].varName : details.OutputSig[i].semanticIdxName;
f[i].format.compByteWidth = sizeof(float); f[i].format.compByteWidth = sizeof(float);
f[i].format.compCount = sig.compCount; f[i].format.compCount = sig.compCount;
f[i].format.compType = sig.compType; f[i].format.compType = sig.compType;
@@ -1273,7 +1273,7 @@ namespace renderdocui.Windows
strm.Seek(offs, SeekOrigin.Begin); strm.Seek(offs, SeekOrigin.Begin);
} }
string elname = bufferFormats[el].name.ToLowerInvariant(); string elname = bufferFormats[el].name.ToUpperInvariant();
var fmt = bufferFormats[el].format; var fmt = bufferFormats[el].format;
int byteWidth = (int)fmt.compByteWidth; int byteWidth = (int)fmt.compByteWidth;
@@ -1285,7 +1285,7 @@ namespace renderdocui.Windows
if (bytes.Length != bytesToRead) if (bytes.Length != bytesToRead)
throw new System.IO.EndOfStreamException(); throw new System.IO.EndOfStreamException();
if (elname == "position" || elname == "sv_position") if (elname == "POSITION" || elname == "SV_POSITION")
{ {
for (int i = 0; i < fmt.compCount; i++) for (int i = 0; i < fmt.compCount; i++)
{ {
@@ -1973,9 +1973,9 @@ namespace renderdocui.Windows
foreach (var el in ui.m_Input.BufferFormats) foreach (var el in ui.m_Input.BufferFormats)
{ {
// prioritise SV_Position over general POSITION // prioritise SV_Position over general POSITION
if (el.name.ToUpper() == "SV_POSITION") if (el.name.ToUpperInvariant() == "SV_POSITION")
pos = el; pos = el;
if (el.name.ToUpper() == "POSITION" && pos == null) if (el.name.ToUpperInvariant() == "POSITION" && pos == null)
pos = el; pos = el;
} }
} }
@@ -2013,7 +2013,7 @@ namespace renderdocui.Windows
float aspect = 0.0f; float aspect = 0.0f;
if (aspectGuess.Text != "") if (aspectGuess.Text.Length > 0)
{ {
float.TryParse(aspectGuess.Text, out aspect); float.TryParse(aspectGuess.Text, out aspect);
} }
@@ -2025,7 +2025,7 @@ namespace renderdocui.Windows
float near = -float.MaxValue; float near = -float.MaxValue;
if (nearGuess.Text != "") if (nearGuess.Text.Length > 0)
{ {
float.TryParse(nearGuess.Text, out near); float.TryParse(nearGuess.Text, out near);
} }
@@ -2037,7 +2037,7 @@ namespace renderdocui.Windows
float far = -float.MaxValue; float far = -float.MaxValue;
if (farGuess.Text != "") if (farGuess.Text.Length > 0)
{ {
float.TryParse(farGuess.Text, out far); float.TryParse(farGuess.Text, out far);
} }
+7 -7
View File
@@ -323,9 +323,9 @@ namespace renderdocui.Windows.Dialogs
{ {
try try
{ {
if (exePath.Text != "" && Directory.Exists(Path.GetDirectoryName(exePath.Text))) if (exePath.Text.Length > 0 && Directory.Exists(Path.GetDirectoryName(exePath.Text)))
exeBrowser.InitialDirectory = Path.GetDirectoryName(exePath.Text); exeBrowser.InitialDirectory = Path.GetDirectoryName(exePath.Text);
else if (m_Core.Config.LastCapturePath != "") else if (m_Core.Config.LastCapturePath.Length > 0)
exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath;
} }
catch (ArgumentException) catch (ArgumentException)
@@ -347,7 +347,7 @@ namespace renderdocui.Windows.Dialogs
private void exePath_DragEnter(object sender, DragEventArgs e) private void exePath_DragEnter(object sender, DragEventArgs e)
{ {
if (ValidData(e.Data) != "") if (ValidData(e.Data).Length > 0)
e.Effect = DragDropEffects.Copy; e.Effect = DragDropEffects.Copy;
else else
e.Effect = DragDropEffects.None; e.Effect = DragDropEffects.None;
@@ -356,7 +356,7 @@ namespace renderdocui.Windows.Dialogs
private void exePath_DragDrop(object sender, DragEventArgs e) private void exePath_DragDrop(object sender, DragEventArgs e)
{ {
string fn = ValidData(e.Data); string fn = ValidData(e.Data);
if (fn != "") if (fn.Length > 0)
{ {
exePath.Text = fn; exePath.Text = fn;
@@ -374,7 +374,7 @@ namespace renderdocui.Windows.Dialogs
workDirBrowser.SelectedPath = workDirPath.Text; workDirBrowser.SelectedPath = workDirPath.Text;
else if (Directory.Exists(Path.GetDirectoryName(exePath.Text))) else if (Directory.Exists(Path.GetDirectoryName(exePath.Text)))
workDirBrowser.SelectedPath = Path.GetDirectoryName(exePath.Text); workDirBrowser.SelectedPath = Path.GetDirectoryName(exePath.Text);
else if (m_Core.Config.LastCapturePath != "") else if (m_Core.Config.LastCapturePath.Length > 0)
exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath;
} }
catch (ArgumentException) catch (ArgumentException)
@@ -478,7 +478,7 @@ namespace renderdocui.Windows.Dialogs
private void workDirPath_Leave(object sender, EventArgs e) private void workDirPath_Leave(object sender, EventArgs e)
{ {
if (workDirPath.Text == "") if (workDirPath.Text.Length == 0)
{ {
workDirHint = true; workDirHint = true;
workDirPath.ForeColor = SystemColors.GrayText; workDirPath.ForeColor = SystemColors.GrayText;
@@ -497,7 +497,7 @@ namespace renderdocui.Windows.Dialogs
{ {
if (workDirHint == false) return; if (workDirHint == false) return;
if (exePath.Text == "") if (exePath.Text.Length == 0)
{ {
workDirPath.Text = ""; workDirPath.Text = "";
return; return;
@@ -237,7 +237,7 @@ namespace renderdocui.Controls
{ {
if (needName && if (needName &&
Slot < reflection.ConstantBlocks.Length && Slot < reflection.ConstantBlocks.Length &&
reflection.ConstantBlocks[Slot].name != "") reflection.ConstantBlocks[Slot].name.Length > 0)
BufferName = "<" + reflection.ConstantBlocks[Slot].name + ">"; BufferName = "<" + reflection.ConstantBlocks[Slot].name + ">";
} }
@@ -302,7 +302,7 @@ namespace renderdocui.Controls
public void ProcessBufferFormat(string formatText) public void ProcessBufferFormat(string formatText)
{ {
if (formatText == "") if (formatText.Length == 0)
{ {
m_FormatOverride = null; m_FormatOverride = null;
if (m_FormatSpecifier != null) if (m_FormatSpecifier != null)
+7 -7
View File
@@ -108,7 +108,7 @@ namespace renderdocui.Windows
m_ConnectThread = null; m_ConnectThread = null;
Text = (m_Host != "" ? m_Host + " - " : "") + "Connecting..."; Text = (m_Host.Length > 0 ? (m_Host + " - ") : "") + "Connecting...";
connectionStatus.Text = "Connecting..."; connectionStatus.Text = "Connecting...";
connectionIcon.Image = global::renderdocui.Properties.Resources.hourglass; connectionIcon.Image = global::renderdocui.Properties.Resources.hourglass;
@@ -145,7 +145,7 @@ namespace renderdocui.Windows
if (m_Connection.Connected) if (m_Connection.Connected)
{ {
string api = "..."; string api = "...";
if (m_Connection.API != "") api = m_Connection.API; if (m_Connection.API.Length > 0) api = m_Connection.API;
this.BeginInvoke((MethodInvoker)delegate this.BeginInvoke((MethodInvoker)delegate
{ {
if (m_Connection.PID == 0) if (m_Connection.PID == 0)
@@ -211,17 +211,17 @@ namespace renderdocui.Windows
byte[] thumb = m_Connection.CaptureFile.thumbnail; byte[] thumb = m_Connection.CaptureFile.thumbnail;
string path = m_Connection.CaptureFile.localpath; string path = m_Connection.CaptureFile.localpath;
if (path == "" || File.Exists(path)) if (path.Length == 0 || File.Exists(path))
{ {
this.BeginInvoke((MethodInvoker)delegate this.BeginInvoke((MethodInvoker)delegate
{ {
CaptureAdded(capID, m_Connection.Target, m_Connection.API, thumb, timestamp); CaptureAdded(capID, m_Connection.Target, m_Connection.API, thumb, timestamp);
if (path != "") if (path.Length > 0)
CaptureRetrieved(capID, path); CaptureRetrieved(capID, path);
}); });
m_Connection.CaptureExists = false; m_Connection.CaptureExists = false;
if (path == "") if (path.Length == 0)
m_Connection.CopyCapture(capID, m_Core.TempLogFilename("remotecopy_" + m_Connection.Target)); m_Connection.CopyCapture(capID, m_Core.TempLogFilename("remotecopy_" + m_Connection.Target));
} }
} }
@@ -278,7 +278,7 @@ namespace renderdocui.Windows
{ {
this.BeginInvoke((MethodInvoker)delegate this.BeginInvoke((MethodInvoker)delegate
{ {
Text = (m_Host != "" ? m_Host + " - " : "") + "Connection failed"; Text = (m_Host.Length > 0 ? (m_Host + " - ") : "") + "Connection failed";
connectionStatus.Text = "Connection failed"; connectionStatus.Text = "Connection failed";
connectionIcon.Image = global::renderdocui.Properties.Resources.delete; connectionIcon.Image = global::renderdocui.Properties.Resources.delete;
@@ -388,7 +388,7 @@ namespace renderdocui.Windows
string path = m_Main.GetSavePath(); string path = m_Main.GetSavePath();
if (path != "") if (path.Length > 0)
{ {
File.Copy(log.localpath, path, true); File.Copy(log.localpath, path, true);
File.Delete(log.localpath); File.Delete(log.localpath);
@@ -215,7 +215,7 @@ namespace renderdocui.Windows.Dialogs
private void AddNewHost() private void AddNewHost()
{ {
if (hostname.Text.Trim() != "" && !m_Core.Config.RecentHosts.Contains(hostname.Text.ToLower())) if (hostname.Text.Trim().Length > 0 && !m_Core.Config.RecentHosts.Contains(hostname.Text, StringComparer.OrdinalIgnoreCase))
{ {
m_Core.Config.RecentHosts.Add(hostname.Text); m_Core.Config.RecentHosts.Add(hostname.Text);
m_Core.Config.Serialize(Core.ConfigFilename); m_Core.Config.Serialize(Core.ConfigFilename);
@@ -115,7 +115,7 @@ namespace renderdocui.Windows.Dialogs
hosts.Clear(); hosts.Clear();
if (kv.Value != "") if (kv.Value.Length > 0)
hosts.Add(kv.Value); hosts.Add(kv.Value);
var plugins = renderdocplugin.PluginHelpers.GetPlugins(); var plugins = renderdocplugin.PluginHelpers.GetPlugins();
@@ -151,7 +151,7 @@ namespace renderdocui.Windows.Dialogs
hosts.Remove(""); hosts.Remove("");
host.Items.AddRange(hosts.ToArray()); host.Items.AddRange(hosts.ToArray());
if (kv.Value != "") if (kv.Value.Length > 0)
host.SelectedIndex = 0; host.SelectedIndex = 0;
host.Tag = driver; host.Tag = driver;
@@ -179,7 +179,7 @@ namespace renderdocui.Windows.Dialogs
var host = sender as ComboBox; var host = sender as ComboBox;
string driver = host.Tag as string; string driver = host.Tag as string;
if (driver != "" && m_Core.Config.ReplayHosts.ContainsKey(driver)) if (driver.Length > 0 && m_Core.Config.ReplayHosts.ContainsKey(driver))
m_Core.Config.ReplayHosts[driver] = host.Text; m_Core.Config.ReplayHosts[driver] = host.Text;
} }
@@ -194,7 +194,7 @@ namespace renderdocui.Windows.Dialogs
{ {
string driver = host.Tag as string; string driver = host.Tag as string;
if(host.Text == "") if (host.Text.Length == 0)
continue; continue;
bool found = false; bool found = false;
@@ -25,8 +25,8 @@ namespace renderdocui.Windows.Dialogs
{ {
fileFormat.Items.Add(ft.ToString()); fileFormat.Items.Add(ft.ToString());
if (filter != "") filter += "|"; if (filter.Length > 0) filter += "|";
filter += String.Format("{0} Files (*.{1})|*.{1}", ft.ToString(), ft.ToString().ToLowerInvariant()); filter += String.Format("{0} Files (*.{1})|*.{1}", ft.ToString(), ft.ToString().ToUpperInvariant());
} }
saveTexDialog.Filter = filter; saveTexDialog.Filter = filter;
@@ -228,11 +228,11 @@ namespace renderdocui.Windows.Dialogs
try try
{ {
string ext = Path.GetExtension(filename.Text).ToLowerInvariant().Substring(1); // trim . from extension string ext = Path.GetExtension(filename.Text).ToUpperInvariant().Substring(1); // trim . from extension
foreach (var ft in (FileType[])Enum.GetValues(typeof(FileType))) foreach (var ft in (FileType[])Enum.GetValues(typeof(FileType)))
{ {
if (ft.ToString().ToLowerInvariant() == ext) if (ft.ToString().ToUpperInvariant() == ext)
{ {
fileFormat.SelectedIndex = (int)ft; fileFormat.SelectedIndex = (int)ft;
break; break;
+12 -12
View File
@@ -475,7 +475,7 @@ namespace renderdocui.Windows
{ {
if (n.Tag is DeferredEvent) if (n.Tag is DeferredEvent)
{ {
if (n["Name"].ToString().ToLowerInvariant().Contains(filter)) if (n["Name"].ToString().ToUpperInvariant().Contains(filter))
{ {
n.Image = global::renderdocui.Properties.Resources.find; n.Image = global::renderdocui.Properties.Resources.find;
results++; results++;
@@ -493,10 +493,10 @@ namespace renderdocui.Windows
private int SetFindIcons(string filter) private int SetFindIcons(string filter)
{ {
if(filter == "") if (filter.Length == 0)
return 0; return 0;
return SetFindIcons(eventView.Nodes[0].Nodes, filter.ToLowerInvariant()); return SetFindIcons(eventView.Nodes[0].Nodes, filter.ToUpperInvariant());
} }
private TreelistView.Node FindNode(TreelistView.NodeCollection nodes, string filter, UInt32 after) private TreelistView.Node FindNode(TreelistView.NodeCollection nodes, string filter, UInt32 after)
@@ -505,7 +505,7 @@ namespace renderdocui.Windows
{ {
if (n.Tag is DeferredEvent) if (n.Tag is DeferredEvent)
{ {
if ((UInt32)n["EID"] > after && n["Name"].ToString().ToLowerInvariant().Contains(filter)) if ((UInt32)n["EID"] > after && n["Name"].ToString().ToUpperInvariant().Contains(filter))
return n; return n;
} }
@@ -537,7 +537,7 @@ namespace renderdocui.Windows
bool matchesAfter = (forward && def.eventID > after) || (!forward && def.eventID < after); bool matchesAfter = (forward && def.eventID > after) || (!forward && def.eventID < after);
if (matchesAfter && n["Name"].ToString().ToLowerInvariant().Contains(filter)) if (matchesAfter && n["Name"].ToString().ToUpperInvariant().Contains(filter))
return (int)def.eventID; return (int)def.eventID;
} }
@@ -558,7 +558,7 @@ namespace renderdocui.Windows
if (eventView.Nodes.Count == 0) if (eventView.Nodes.Count == 0)
return 0; return 0;
return FindEvent(eventView.Nodes[0].Nodes, filter.ToLowerInvariant(), after, forward); return FindEvent(eventView.Nodes[0].Nodes, filter.ToUpperInvariant(), after, forward);
} }
public void OnEventSelected(UInt32 frameID, UInt32 eventID) public void OnEventSelected(UInt32 frameID, UInt32 eventID)
@@ -614,7 +614,7 @@ namespace renderdocui.Windows
{ {
jumpStrip.Visible = false; jumpStrip.Visible = false;
if (findEvent.Text == "") if (findEvent.Text.Length == 0)
{ {
findStrip.Visible = false; findStrip.Visible = false;
@@ -713,7 +713,7 @@ namespace renderdocui.Windows
private void findEvent_TextChanged(object sender, EventArgs e) private void findEvent_TextChanged(object sender, EventArgs e)
{ {
if (findEvent.Text != "") if (findEvent.Text.Length > 0)
{ {
findHighlight.Enabled = false; findHighlight.Enabled = false;
findHighlight.Enabled = true; findHighlight.Enabled = true;
@@ -729,7 +729,7 @@ namespace renderdocui.Windows
private void findHighlight_Tick(object sender, EventArgs e) private void findHighlight_Tick(object sender, EventArgs e)
{ {
if (findEvent.Text == "") if (findEvent.Text.Length == 0)
{ {
findEvent.BackColor = SystemColors.Window; findEvent.BackColor = SystemColors.Window;
ClearFindIcons(); ClearFindIcons();
@@ -768,8 +768,8 @@ namespace renderdocui.Windows
findHighlight.Enabled = false; findHighlight.Enabled = false;
findHighlight_Tick(sender, null); findHighlight_Tick(sender, null);
} }
if (findEvent.Text != "") if (findEvent.Text.Length > 0)
{ {
Find(true); Find(true);
} }
@@ -829,7 +829,7 @@ namespace renderdocui.Windows
private void Find(bool forward) private void Find(bool forward)
{ {
if(findEvent.Text == "") if (findEvent.Text.Length == 0)
return; return;
UInt32 curEID = m_Core.CurEvent; UInt32 curEID = m_Core.CurEvent;
+13 -13
View File
@@ -200,7 +200,7 @@ namespace renderdocui.Windows
ShowLiveCapture(live); ShowLiveCapture(live);
} }
if (m_InitFilename != "") if (m_InitFilename.Length > 0)
{ {
if (Path.GetExtension(m_InitFilename) == ".rdc") if (Path.GetExtension(m_InitFilename) == ".rdc")
{ {
@@ -409,7 +409,7 @@ namespace renderdocui.Windows
return m_Core.CaptureDialog; return m_Core.CaptureDialog;
} }
else if (persistString != null && persistString != "") else if (persistString != null && persistString.Length > 0)
LoadCustomString(persistString); LoadCustomString(persistString);
return null; return null;
@@ -508,7 +508,7 @@ namespace renderdocui.Windows
if (m_Core != null && m_Core.LogLoaded) if (m_Core != null && m_Core.LogLoaded)
{ {
prefix = Path.GetFileName(m_Core.LogFileName); prefix = Path.GetFileName(m_Core.LogFileName);
if (m_RemoteReplay != "") if (m_RemoteReplay.Length > 0)
prefix += String.Format(" (Remote replay on {0})", m_RemoteReplay); prefix += String.Format(" (Remote replay on {0})", m_RemoteReplay);
prefix += " - "; prefix += " - ";
} }
@@ -535,12 +535,12 @@ namespace renderdocui.Windows
Thread thread = null; Thread thread = null;
if (!m_Core.Config.ReplayHosts.ContainsKey(driver) && driver.Trim() != "") if (!m_Core.Config.ReplayHosts.ContainsKey(driver) && driver.Trim().Length > 0)
m_Core.Config.ReplayHosts.Add(driver, ""); m_Core.Config.ReplayHosts.Add(driver, "");
// if driver is "" something went wrong loading the log, let it be handled as usual // if driver is empty something went wrong loading the log, let it be handled as usual
// below. Otherwise prompt to replay remotely. // below. Otherwise prompt to replay remotely.
if (driver != "" && (!support || m_Core.Config.ReplayHosts[driver] != "")) if (driver.Length > 0 && (!support || m_Core.Config.ReplayHosts[driver].Length > 0))
{ {
string remoteMessage = String.Format("This log was captured with {0}", driver); string remoteMessage = String.Format("This log was captured with {0}", driver);
@@ -549,7 +549,7 @@ namespace renderdocui.Windows
else else
remoteMessage += " and your settings say to replay this remotely.\n"; remoteMessage += " and your settings say to replay this remotely.\n";
if(m_Core.Config.ReplayHosts[driver] == "") if (m_Core.Config.ReplayHosts[driver].Length == 0)
remoteMessage += "Do you wish to select a remote host to replay on?\n\n" + remoteMessage += "Do you wish to select a remote host to replay on?\n\n" +
"You can set up a default host for this driver on the next screen."; "You can set up a default host for this driver on the next screen.";
else else
@@ -560,11 +560,11 @@ namespace renderdocui.Windows
if (res == DialogResult.Yes) if (res == DialogResult.Yes)
{ {
if (m_Core.Config.ReplayHosts[driver] == "") if (m_Core.Config.ReplayHosts[driver].Length == 0)
{ {
(new Dialogs.ReplayHostManager(m_Core, this)).ShowDialog(); (new Dialogs.ReplayHostManager(m_Core, this)).ShowDialog();
if (m_Core.Config.ReplayHosts[driver] == "") if (m_Core.Config.ReplayHosts[driver].Length == 0)
return; return;
} }
@@ -863,7 +863,7 @@ namespace renderdocui.Windows
if(!PromptCloseLog()) if(!PromptCloseLog())
return; return;
if (m_Core.Config.LastLogPath != "") if (m_Core.Config.LastLogPath.Length > 0)
openDialog.InitialDirectory = m_Core.Config.LastLogPath; openDialog.InitialDirectory = m_Core.Config.LastLogPath;
DialogResult res = openDialog.ShowDialog(); DialogResult res = openDialog.ShowDialog();
@@ -982,7 +982,7 @@ namespace renderdocui.Windows
CloseLogfile(); CloseLogfile();
if(deletepath != "") if (deletepath.Length > 0)
File.Delete(deletepath); File.Delete(deletepath);
return true; return true;
@@ -1440,7 +1440,7 @@ namespace renderdocui.Windows
private void MainWindow_DragDrop(object sender, DragEventArgs e) private void MainWindow_DragDrop(object sender, DragEventArgs e)
{ {
string fn = ValidData(e.Data); string fn = ValidData(e.Data);
if (fn != "") if (fn.Length > 0)
{ {
LoadLogfile(fn, false); LoadLogfile(fn, false);
} }
@@ -1448,7 +1448,7 @@ namespace renderdocui.Windows
private void MainWindow_DragEnter(object sender, DragEventArgs e) private void MainWindow_DragEnter(object sender, DragEventArgs e)
{ {
if(ValidData(e.Data) != "") if (ValidData(e.Data).Length > 0)
e.Effect = DragDropEffects.Copy; e.Effect = DragDropEffects.Copy;
else else
e.Effect = DragDropEffects.None; e.Effect = DragDropEffects.None;
@@ -116,7 +116,6 @@ namespace renderdocui.Windows.PipelineState
gsStreams.Nodes.Clear(); gsStreams.Nodes.Clear();
var tick = global::renderdocui.Properties.Resources.tick; var tick = global::renderdocui.Properties.Resources.tick;
var cross = global::renderdocui.Properties.Resources.cross;
fillMode.Text = "Solid"; fillMode.Text = "Solid";
cullMode.Text = "Front"; cullMode.Text = "Front";
@@ -194,7 +193,7 @@ namespace renderdocui.Windows.PipelineState
else else
shader.Text = stage.ShaderName; shader.Text = stage.ShaderName;
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0) if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc.Length > 0 && shaderDetails.DebugInfo.files.Length > 0)
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " + shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " +
Path.GetFileName(shaderDetails.DebugInfo.files[0].filename); Path.GetFileName(shaderDetails.DebugInfo.files[0].filename);
@@ -227,7 +226,7 @@ namespace renderdocui.Windows.PipelineState
{ {
string slotname = i.ToString(); string slotname = i.ToString();
if (shaderInput != null && shaderInput.name != "") if (shaderInput != null && shaderInput.name.Length > 0)
slotname += ": " + shaderInput.name; slotname += ": " + shaderInput.name;
UInt32 w = 1, h = 1, d = 1; UInt32 w = 1, h = 1, d = 1;
@@ -337,7 +336,7 @@ namespace renderdocui.Windows.PipelineState
} }
} }
bool filledSlot = (s.AddressU != ""); bool filledSlot = (s.AddressU.Length > 0);
bool usedSlot = (shaderInput != null); bool usedSlot = (shaderInput != null);
// show if // show if
@@ -348,7 +347,7 @@ namespace renderdocui.Windows.PipelineState
{ {
string slotname = i.ToString(); string slotname = i.ToString();
if (shaderInput != null && shaderInput.name != "") if (shaderInput != null && shaderInput.name.Length > 0)
slotname += ": " + shaderInput.name; slotname += ": " + shaderInput.name;
string borderColor = s.BorderColor[0].ToString() + ", " + string borderColor = s.BorderColor[0].ToString() + ", " +
@@ -411,7 +410,7 @@ namespace renderdocui.Windows.PipelineState
{ {
ConstantBlock shaderCBuf = null; ConstantBlock shaderCBuf = null;
if (shaderDetails != null && i < shaderDetails.ConstantBlocks.Length && shaderDetails.ConstantBlocks[i].name != "") if (shaderDetails != null && i < shaderDetails.ConstantBlocks.Length && shaderDetails.ConstantBlocks[i].name.Length > 0)
shaderCBuf = shaderDetails.ConstantBlocks[i]; shaderCBuf = shaderDetails.ConstantBlocks[i];
bool filledSlot = (b.Buffer != ResourceId.Null); bool filledSlot = (b.Buffer != ResourceId.Null);
@@ -444,7 +443,7 @@ namespace renderdocui.Windows.PipelineState
string slotname = i.ToString(); string slotname = i.ToString();
if (shaderCBuf != null && shaderCBuf.name != "") if (shaderCBuf != null && shaderCBuf.name.Length > 0)
slotname += ": " + shaderCBuf.name; slotname += ": " + shaderCBuf.name;
var node = cbuffers.Nodes.Add(new object[] { slotname, name, b.VecOffset, b.VecCount, numvars, length }); var node = cbuffers.Nodes.Add(new object[] { slotname, name, b.VecOffset, b.VecCount, numvars, length });
@@ -550,7 +549,7 @@ namespace renderdocui.Windows.PipelineState
if(state.m_IA.Bytecode == null) if(state.m_IA.Bytecode == null)
iaBytecode.Text = "None"; iaBytecode.Text = "None";
else if(state.m_IA.Bytecode.DebugInfo == null || state.m_IA.Bytecode.DebugInfo.entryFunc == "") else if (state.m_IA.Bytecode.DebugInfo == null || state.m_IA.Bytecode.DebugInfo.entryFunc.Length == 0)
iaBytecode.Text = "Layout " + state.m_IA.layout.ToString(); iaBytecode.Text = "Layout " + state.m_IA.layout.ToString();
else else
iaBytecode.Text = state.m_IA.Bytecode.DebugInfo.entryFunc; iaBytecode.Text = state.m_IA.Bytecode.DebugInfo.entryFunc;
@@ -577,7 +576,7 @@ namespace renderdocui.Windows.PipelineState
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
// misorder or misnamed semantics // misorder or misnamed semantics
if (IA[i].semanticIdxName.ToLowerInvariant() != VS[i].semanticIdxName.ToLowerInvariant()) if (IA[i].semanticIdxName.ToUpperInvariant() != VS[i].semanticIdxName.ToUpperInvariant())
mismatchDetails += String.Format("IA bytecode semantic {0}: {1} != VS bytecode semantic {0}: {2}\n", i, mismatchDetails += String.Format("IA bytecode semantic {0}: {1} != VS bytecode semantic {0}: {2}\n", i,
IA[i].semanticIdxName, VS[i].semanticIdxName); IA[i].semanticIdxName, VS[i].semanticIdxName);
@@ -1469,7 +1468,7 @@ namespace renderdocui.Windows.PipelineState
{ {
if (r.variableType.members.Length == 0) if (r.variableType.members.Length == 0)
{ {
if (r.variableType.Name != "") if (r.variableType.Name.Length > 0)
format = r.variableType.Name + " " + r.name + ";"; format = r.variableType.Name + " " + r.name + ";";
} }
else else
@@ -1486,7 +1485,7 @@ namespace renderdocui.Windows.PipelineState
if (buf.ID != ResourceId.Null) if (buf.ID != ResourceId.Null)
{ {
var viewer = new BufferViewer(m_Core, false); var viewer = new BufferViewer(m_Core, false);
if (format == "") if (format.Length == 0)
viewer.ViewRawBuffer(buf.ID); viewer.ViewRawBuffer(buf.ID);
else else
viewer.ViewRawBuffer(buf.ID, format); viewer.ViewRawBuffer(buf.ID, format);
@@ -1652,7 +1651,7 @@ namespace renderdocui.Windows.PipelineState
string mainfile = ""; string mainfile = "";
var files = new Dictionary<string, string>(); var files = new Dictionary<string, string>();
if (shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0) if (shaderDetails.DebugInfo.entryFunc.Length > 0 && shaderDetails.DebugInfo.files.Length > 0)
{ {
entryFunc = shaderDetails.DebugInfo.entryFunc; entryFunc = shaderDetails.DebugInfo.entryFunc;
@@ -1708,7 +1707,7 @@ namespace renderdocui.Windows.PipelineState
int cbufIdx = 0; int cbufIdx = 0;
foreach (var cbuf in shaderDetails.ConstantBlocks) foreach (var cbuf in shaderDetails.ConstantBlocks)
{ {
if (cbuf.name != "" && cbuf.variables.Length > 0) if (cbuf.name.Length > 0 && cbuf.variables.Length > 0)
{ {
cbuffers += String.Format("cbuffer {0} : register(b{1}) {{", cbuf.name, cbufIdx) + nl; cbuffers += String.Format("cbuffer {0} : register(b{1}) {{", cbuf.name, cbufIdx) + nl;
MakeShaderVariablesHLSL(true, cbuf.variables, ref cbuffers, ref hlsl); MakeShaderVariablesHLSL(true, cbuf.variables, ref cbuffers, ref hlsl);
@@ -1721,12 +1720,12 @@ namespace renderdocui.Windows.PipelineState
hlsl += String.Format("struct {0}Input{1}{{{1}", shType, nl); hlsl += String.Format("struct {0}Input{1}{{{1}", shType, nl);
foreach(var sig in shaderDetails.InputSig) foreach(var sig in shaderDetails.InputSig)
hlsl += String.Format("\t{0} {1} : {2};" + nl, sig.TypeString, sig.varName != "" ? sig.varName : "param" + sig.regIndex, sig.D3D11SemanticString); hlsl += String.Format("\t{0} {1} : {2};" + nl, sig.TypeString, sig.varName.Length > 0 ? sig.varName : ("param" + sig.regIndex), sig.D3D11SemanticString);
hlsl += "};" + nl2; hlsl += "};" + nl2;
hlsl += String.Format("struct {0}Output{1}{{{1}", shType, nl); hlsl += String.Format("struct {0}Output{1}{{{1}", shType, nl);
foreach (var sig in shaderDetails.OutputSig) foreach (var sig in shaderDetails.OutputSig)
hlsl += String.Format("\t{0} {1} : {2};" + nl, sig.TypeString, sig.varName != "" ? sig.varName : "param" + sig.regIndex, sig.D3D11SemanticString); hlsl += String.Format("\t{0} {1} : {2};" + nl, sig.TypeString, sig.varName.Length > 0 ? sig.varName : ("param" + sig.regIndex), sig.D3D11SemanticString);
hlsl += "};" + nl2; hlsl += "};" + nl2;
hlsl += String.Format("{0}Output {1}(in {0}Input IN){2}{{{2}\t{0}Output OUT = ({0}Output)0;{2}{2}\t// ...{2}{2}\treturn OUT;{2}}}{2}", shType, entryFunc, nl); hlsl += String.Format("{0}Output {1}(in {0}Input IN){2}{{{2}\t{0}Output OUT = ({0}Output)0;{2}{2}\t// ...{2}{2}\treturn OUT;{2}}}{2}", shType, entryFunc, nl);
@@ -1854,7 +1853,7 @@ namespace renderdocui.Windows.PipelineState
{ {
if (stage.ShaderDetails != null && if (stage.ShaderDetails != null &&
(stage.ShaderDetails.ConstantBlocks.Length <= slot || (stage.ShaderDetails.ConstantBlocks.Length <= slot ||
stage.ShaderDetails.ConstantBlocks[slot].name == "") stage.ShaderDetails.ConstantBlocks[slot].name.Length == 0)
) )
{ {
// unused cbuffer, open regular buffer viewer // unused cbuffer, open regular buffer viewer
+10 -10
View File
@@ -398,7 +398,7 @@ namespace renderdocui.Windows
w.CloseButtonVisible = false; w.CloseButtonVisible = false;
} }
if (shader.DebugInfo.entryFunc != "" && shader.DebugInfo.files.Length > 0) if (shader.DebugInfo.entryFunc.Length > 0 && shader.DebugInfo.files.Length > 0)
{ {
if(trace != null) if(trace != null)
Text = String.Format("Debug {0}() - {1}", shader.DebugInfo.entryFunc, debugContext); Text = String.Format("Debug {0}() - {1}", shader.DebugInfo.entryFunc, debugContext);
@@ -459,8 +459,8 @@ namespace renderdocui.Windows
foreach (var s in m_ShaderDetails.InputSig) foreach (var s in m_ShaderDetails.InputSig)
{ {
string name = s.varName == "" ? s.semanticName : String.Format("{0} ({1})", s.varName, s.semanticName); string name = s.varName.Length == 0 ? s.semanticName : String.Format("{0} ({1})", s.varName, s.semanticName);
if (s.semanticName == "") name = s.varName; if (s.semanticName.Length == 0) name = s.varName;
var node = inSig.Nodes.Add(new object[] { name, s.semanticIndex, s.regIndex, s.TypeString, s.systemValue.ToString(), var node = inSig.Nodes.Add(new object[] { name, s.semanticIndex, s.regIndex, s.TypeString, s.systemValue.ToString(),
SigParameter.GetComponentString(s.regChannelMask), SigParameter.GetComponentString(s.channelUsedMask) }); SigParameter.GetComponentString(s.regChannelMask), SigParameter.GetComponentString(s.channelUsedMask) });
@@ -478,8 +478,8 @@ namespace renderdocui.Windows
foreach (var s in m_ShaderDetails.OutputSig) foreach (var s in m_ShaderDetails.OutputSig)
{ {
string name = s.varName == "" ? s.semanticName : String.Format("{0} ({1})", s.varName, s.semanticName); string name = s.varName.Length == 0 ? s.semanticName : String.Format("{0} ({1})", s.varName, s.semanticName);
if (s.semanticName == "") name = s.varName; if (s.semanticName.Length == 0) name = s.varName;
if(multipleStreams) if(multipleStreams)
name = String.Format("Stream {0} : {1}", s.stream, name); name = String.Format("Stream {0} : {1}", s.stream, name);
@@ -667,7 +667,7 @@ namespace renderdocui.Windows
hoverTimer.Enabled = false; hoverTimer.Enabled = false;
if (m_HoverScintilla != null && m_HoverReg != "") if (m_HoverScintilla != null && m_HoverReg.Length > 0)
{ {
var pt = m_HoverScintilla.PointToClient(Cursor.Position); var pt = m_HoverScintilla.PointToClient(Cursor.Position);
@@ -995,7 +995,7 @@ namespace renderdocui.Windows
var swizzle = match.Groups[3].Value.Replace(".", ""); var swizzle = match.Groups[3].Value.Replace(".", "");
var regcast = match.Groups[4].Value.Replace(",", ""); var regcast = match.Groups[4].Value.Replace(",", "");
if (regcast == "") if (regcast.Length == 0)
{ {
if (displayInts.Checked) if (displayInts.Checked)
regcast = "i"; regcast = "i";
@@ -1039,7 +1039,7 @@ namespace renderdocui.Windows
{ {
ShaderVariable vr = vars[regindex]; ShaderVariable vr = vars[regindex];
if (swizzle == "") if (swizzle.Length == 0)
{ {
swizzle = "xyzw".Substring(0, (int)vr.columns); swizzle = "xyzw".Substring(0, (int)vr.columns);
@@ -1469,9 +1469,9 @@ namespace renderdocui.Windows
private void watchRegs_AfterLabelEdit(object sender, LabelEditEventArgs e) private void watchRegs_AfterLabelEdit(object sender, LabelEditEventArgs e)
{ {
if (e.Label == "" && e.Item < watchRegs.Items.Count - 1) if (e.Label.Length == 0 && e.Item < watchRegs.Items.Count - 1)
watchRegs.Items.RemoveAt(e.Item); watchRegs.Items.RemoveAt(e.Item);
else if (e.Label != null && e.Label != "" && e.Item == watchRegs.Items.Count - 1) else if (e.Label != null && e.Label.Length > 0 && e.Item == watchRegs.Items.Count - 1)
watchRegs.Items.Add(new ListViewItem(new string[] { "", "", "" })); watchRegs.Items.Add(new ListViewItem(new string[] { "", "", "" }));
this.BeginInvoke((MethodInvoker)delegate { UpdateDebugging(); }); this.BeginInvoke((MethodInvoker)delegate { UpdateDebugging(); });
+13 -13
View File
@@ -346,7 +346,7 @@ namespace renderdocui.Windows
private void TextureViewer_Load(object sender, EventArgs e) private void TextureViewer_Load(object sender, EventArgs e)
{ {
if (onloadLayout != "") if (onloadLayout.Length > 0)
{ {
Control[] persistors = { Control[] persistors = {
renderToolstripContainer, renderToolstripContainer,
@@ -494,7 +494,7 @@ namespace renderdocui.Windows
{ {
if (!m_Core.LogLoaded) return; if (!m_Core.LogLoaded) return;
if (filter == "") if (filter.Length > 0)
{ {
var shaders = m_CustomShaders.Values.ToArray(); var shaders = m_CustomShaders.Values.ToArray();
@@ -510,7 +510,7 @@ namespace renderdocui.Windows
else else
{ {
var fn = Path.GetFileNameWithoutExtension(filter); var fn = Path.GetFileNameWithoutExtension(filter);
var key = fn.ToLowerInvariant(); var key = fn.ToUpperInvariant();
if (m_CustomShaders.ContainsKey(key)) if (m_CustomShaders.ContainsKey(key))
{ {
@@ -543,7 +543,7 @@ namespace renderdocui.Windows
foreach (var f in Directory.EnumerateFiles(Core.ConfigDirectory, "*.hlsl")) foreach (var f in Directory.EnumerateFiles(Core.ConfigDirectory, "*.hlsl"))
{ {
var fn = Path.GetFileNameWithoutExtension(f); var fn = Path.GetFileNameWithoutExtension(f);
var key = fn.ToLowerInvariant(); var key = fn.ToUpperInvariant();
if (!m_CustomShaders.ContainsKey(key)) if (!m_CustomShaders.ContainsKey(key))
{ {
@@ -583,13 +583,13 @@ namespace renderdocui.Windows
private void customCreate_Click(object sender, EventArgs e) private void customCreate_Click(object sender, EventArgs e)
{ {
if (customShader.Text == null || customShader.Text == "") if (customShader.Text == null || customShader.Text.Length == 0)
{ {
MessageBox.Show("No name entered.\nEnter a name in the textbox.", "Error Creating Shader", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No name entered.\nEnter a name in the textbox.", "Error Creating Shader", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
if (m_CustomShaders.ContainsKey(customShader.Text.ToLowerInvariant())) if (m_CustomShaders.ContainsKey(customShader.Text.ToUpperInvariant()))
{ {
MessageBox.Show("Selected shader already exists.\nEnter a new name in the textbox.", "Error Creating Shader", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Selected shader already exists.\nEnter a new name in the textbox.", "Error Creating Shader", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
@@ -633,13 +633,13 @@ namespace renderdocui.Windows
private void customDelete_Click(object sender, EventArgs e) private void customDelete_Click(object sender, EventArgs e)
{ {
if (customShader.Text == null || customShader.Text == "") if (customShader.Text == null || customShader.Text.Length == 0)
{ {
MessageBox.Show("No shader selected.\nSelect a custom shader from the drop-down", "Error Deleting Shader", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No shader selected.\nSelect a custom shader from the drop-down", "Error Deleting Shader", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
if (!m_CustomShaders.ContainsKey(customShader.Text.ToLowerInvariant())) if (!m_CustomShaders.ContainsKey(customShader.Text.ToUpperInvariant()))
{ {
MessageBox.Show("Selected shader doesn't exist.\nSelect a custom shader from the drop-down", "Error Deleting Shader", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Selected shader doesn't exist.\nSelect a custom shader from the drop-down", "Error Deleting Shader", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
@@ -877,7 +877,7 @@ namespace renderdocui.Windows
if (tex != null) if (tex != null)
{ {
prev.Init(!tex.customName && bindName != "" ? bindName : tex.name, tex.width, tex.height, tex.depth, tex.mips); prev.Init(!tex.customName && bindName.Length > 0 ? bindName : tex.name, tex.width, tex.height, tex.depth, tex.mips);
IntPtr handle = prev.ThumbnailHandle; IntPtr handle = prev.ThumbnailHandle;
ResourceId id = RTs[i]; ResourceId id = RTs[i];
m_Core.Renderer.BeginInvoke((ReplayRenderer rep) => m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
@@ -887,7 +887,7 @@ namespace renderdocui.Windows
} }
else if (buf != null) else if (buf != null)
{ {
prev.Init(!buf.customName && bindName != "" ? bindName : buf.name, buf.length, 0, 0, Math.Max(1, buf.structureSize)); prev.Init(!buf.customName && bindName.Length > 0 ? bindName : buf.name, buf.length, 0, 0, Math.Max(1, buf.structureSize));
IntPtr handle = prev.ThumbnailHandle; IntPtr handle = prev.ThumbnailHandle;
m_Core.Renderer.BeginInvoke((ReplayRenderer rep) => m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
{ {
@@ -963,7 +963,7 @@ namespace renderdocui.Windows
if (tex != null) if (tex != null)
{ {
prev.Init(!tex.customName && bindName != "" ? bindName : tex.name, tex.width, tex.height, tex.depth, tex.mips); prev.Init(!tex.customName && bindName.Length > 0 ? bindName : tex.name, tex.width, tex.height, tex.depth, tex.mips);
IntPtr handle = prev.ThumbnailHandle; IntPtr handle = prev.ThumbnailHandle;
ResourceId id = Texs[i]; ResourceId id = Texs[i];
m_Core.Renderer.BeginInvoke((ReplayRenderer rep) => m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
@@ -1609,10 +1609,10 @@ namespace renderdocui.Windows
m_TexDisplay.HDRMul = -1.0f; m_TexDisplay.HDRMul = -1.0f;
m_TexDisplay.CustomShader = ResourceId.Null; m_TexDisplay.CustomShader = ResourceId.Null;
if (m_CustomShaders.ContainsKey(customShader.Text.ToLowerInvariant())) if (m_CustomShaders.ContainsKey(customShader.Text.ToUpperInvariant()))
{ {
if (m_TexDisplay.CustomShader == ResourceId.Null) { m_CurPixelValue = null; m_CurRealValue = null; UI_UpdateStatusText(); } if (m_TexDisplay.CustomShader == ResourceId.Null) { m_CurPixelValue = null; m_CurRealValue = null; UI_UpdateStatusText(); }
m_TexDisplay.CustomShader = m_CustomShaders[customShader.Text.ToLowerInvariant()]; m_TexDisplay.CustomShader = m_CustomShaders[customShader.Text.ToUpperInvariant()];
customDelete.Enabled = customEdit.Enabled = true; customDelete.Enabled = customEdit.Enabled = true;
customCreate.Enabled = false; customCreate.Enabled = false;
} }
+2 -2
View File
@@ -377,7 +377,7 @@ namespace renderdocui.Windows
{ {
float myWidth = 20.0f; float myWidth = 20.0f;
if (s.Name != "") if (s.Name.Length > 0)
myWidth = Math.Max(myWidth, MinBarSize(g, "+ " + s.Name)); myWidth = Math.Max(myWidth, MinBarSize(g, "+ " + s.Name));
if (s.subsections == null || s.subsections.Count == 0) if (s.subsections == null || s.subsections.Count == 0)
@@ -499,7 +499,7 @@ namespace renderdocui.Windows
for (int i = 0; i < section.subsections.Count; i++) for (int i = 0; i < section.subsections.Count; i++)
{ {
var s = section.subsections[i]; var s = section.subsections[i];
if (s.Name != "") if (s.Name.Length > 0)
{ {
g.Clip = new Region(clipRect); g.Clip = new Region(clipRect);
var childRect = DrawBar(g, col, rect, start, widths[i], (s.Expanded ? "- " : "+ ") + s.Name, visible); var childRect = DrawBar(g, col, rect, start, widths[i], (s.Expanded ? "- " : "+ ") + s.Name, visible);