本文整理汇总了C#中TreelistView.BeginUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# TreelistView.BeginUpdate方法的具体用法?C# TreelistView.BeginUpdate怎么用?C# TreelistView.BeginUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreelistView
的用法示例。
在下文中一共展示了TreelistView.BeginUpdate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
D3D11PipelineState.ShaderStage stage,
Label shader, TreelistView.TreeListView resources, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView classes)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.ShaderName;
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc.Length > 0 && shaderDetails.DebugInfo.files.Length > 0)
{
string shaderfn = "";
int entryFile = shaderDetails.DebugInfo.entryFile;
if (entryFile < 0 || entryFile >= shaderDetails.DebugInfo.files.Length)
entryFile = 0;
shaderfn = shaderDetails.DebugInfo.files[entryFile].BaseFilename;
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " + shaderfn;
}
int vs = 0;
vs = resources.VScrollValue();
resources.BeginUpdate();
resources.Nodes.Clear();
if (stage.SRVs != null)
{
int i = 0;
foreach (var r in stage.SRVs)
{
ShaderResource shaderInput = null;
if (shaderDetails != null)
{
foreach (var bind in shaderDetails.ReadOnlyResources)
{
if (bind.IsSRV && bind.bindPoint == i)
{
shaderInput = bind;
break;
}
}
}
bool filledSlot = (r.Resource != ResourceId.Null);
bool usedSlot = (shaderInput != null);
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
(showDisabled.Checked && !usedSlot && filledSlot) || // it's bound, but not referenced, and we have "show disabled"
(showEmpty.Checked && !filledSlot) // it's empty, and we have "show empty"
)
{
string slotname = i.ToString();
if (shaderInput != null && shaderInput.name.Length > 0)
slotname += ": " + shaderInput.name;
UInt64 w = 1;
UInt32 h = 1, d = 1;
UInt32 a = 1;
string format = "Unknown";
string name = "Shader Resource " + r.Resource.ToString();
string typename = "Unknown";
object tag = null;
bool viewDetails = false;
if (!filledSlot)
{
name = "Empty";
format = "-";
typename = "-";
w = h = d = a = 0;
}
// check to see if it's a texture
for (int t = 0; t < texs.Length; t++)
{
if (texs[t].ID == r.Resource)
{
w = texs[t].width;
h = texs[t].height;
d = texs[t].depth;
a = texs[t].arraysize;
format = texs[t].format.ToString();
name = texs[t].name;
typename = texs[t].resType.Str();
if (texs[t].resType == ShaderResourceType.Texture2DMS ||
texs[t].resType == ShaderResourceType.Texture2DMSArray)
{
typename += String.Format(" {0}x", texs[t].msSamp);
}
//.........这里部分代码省略.........
示例2: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
D3D11PipelineState.ShaderStage stage,
Label shader, TreelistView.TreeListView resources, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView classes)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.ShaderName;
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0)
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " +
Path.GetFileName(shaderDetails.DebugInfo.files[0].filename);
resources.BeginUpdate();
resources.Nodes.Clear();
if (stage.SRVs != null)
{
int i = 0;
foreach (var r in stage.SRVs)
{
ShaderResource shaderInput = null;
if (shaderDetails != null)
{
foreach (var bind in shaderDetails.Resources)
{
if (bind.IsSRV && bind.bindPoint == i)
shaderInput = bind;
}
}
bool filledSlot = (r.Resource != ResourceId.Null);
bool usedSlot = (shaderInput != null);
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
(showDisabled.Checked && !usedSlot && filledSlot) || // it's bound, but not referenced, and we have "show disabled"
(showEmpty.Checked && !filledSlot) // it's empty, and we have "show empty"
)
{
string slotname = i.ToString();
if (shaderInput != null && shaderInput.name != "")
slotname += ": " + shaderInput.name;
UInt32 w = 1, h = 1, d = 1;
UInt32 a = 1;
string format = "Unknown";
string name = "Shader Resource " + r.Resource.ToString();
string typename = "Unknown";
object tag = null;
if (!filledSlot)
{
name = "Empty";
format = "-";
typename = "-";
w = h = d = a = 0;
}
// check to see if it's a texture
for (int t = 0; t < texs.Length; t++)
{
if (texs[t].ID == r.Resource)
{
w = texs[t].width;
h = texs[t].height;
d = texs[t].depth;
a = texs[t].arraysize;
format = texs[t].format.ToString();
name = texs[t].name;
typename = string.Format("Texture{0}D", texs[t].dimension);
if(texs[t].cubemap)
typename = "TexCube";
tag = texs[t];
}
}
// if not a texture, it must be a buffer
for (int t = 0; t < bufs.Length; t++)
{
if (bufs[t].ID == r.Resource)
{
w = bufs[t].length;
h = 0;
d = 0;
a = 0;
format = "";
name = bufs[t].name;
typename = "Buffer";
// for structured buffers, display how many 'elements' there are in the buffer
if (bufs[t].structureSize > 0)
typename = "StructuredBuffer[" + (bufs[t].length / bufs[t].structureSize) + "]";
//.........这里部分代码省略.........
示例3: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
GLPipelineState state, GLPipelineState.ShaderStage stage,
TableLayoutPanel table, Label shader,
TreelistView.TreeListView textures, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView subs,
TreelistView.TreeListView readwrites)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
var mapping = stage.BindpointMapping;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.stage.Str(APIPipelineStateType.OpenGL) + " Shader " + stage.Shader.ToString();
// disabled since entry function is always main, and filenames have no names, so this is useless.
/*
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0)
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " +
Path.GetFileName(shaderDetails.DebugInfo.files[0].filename);
*/
int vs = 0;
int vs2 = 0;
// simultaneous update of resources and samplers
vs = textures.VScrollValue();
textures.BeginUpdate();
textures.Nodes.Clear();
vs2 = samplers.VScrollValue();
samplers.BeginUpdate();
samplers.Nodes.Clear();
if (state.Textures != null)
{
for (int i = 0; i < state.Textures.Length; i++)
{
var r = state.Textures[i];
var s = state.Samplers[i];
ShaderResource shaderInput = null;
BindpointMap map = null;
if (shaderDetails != null)
{
foreach (var bind in shaderDetails.Resources)
{
if (bind.IsSRV && !bind.IsReadWrite && mapping.Resources[bind.bindPoint].bind == i)
{
shaderInput = bind;
map = mapping.Resources[bind.bindPoint];
}
}
}
bool filledSlot = (r.Resource != ResourceId.Null);
bool usedSlot = (shaderInput != null && map.used);
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
(showDisabled.Checked && !usedSlot && filledSlot) || // it's bound, but not referenced, and we have "show disabled"
(showEmpty.Checked && !filledSlot) // it's empty, and we have "show empty"
)
{
// do texture
{
string slotname = i.ToString();
if (shaderInput != null && shaderInput.name != "")
slotname += ": " + shaderInput.name;
UInt32 w = 1, h = 1, d = 1;
UInt32 a = 1;
string format = "Unknown";
string name = "Shader Resource " + r.Resource.ToString();
string typename = "Unknown";
object tag = null;
if (!filledSlot)
{
name = "Empty";
format = "-";
typename = "-";
w = h = d = a = 0;
}
// check to see if it's a texture
for (int t = 0; t < texs.Length; t++)
{
if (texs[t].ID == r.Resource)
{
w = texs[t].width;
h = texs[t].height;
d = texs[t].depth;
a = texs[t].arraysize;
format = texs[t].format.ToString();
name = texs[t].name;
typename = texs[t].resType.Str();
if (texs[t].format.special &&
//.........这里部分代码省略.........
示例4: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
VulkanPipelineState.ShaderStage stage, VulkanPipelineState.Pipeline pipe,
Label shader, TreelistView.TreeListView resources,
TreelistView.TreeListView cbuffers)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.ShaderName;
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc.Length > 0)
{
if (shaderDetails.DebugInfo.files.Length > 0 || shaderDetails.DebugInfo.entryFunc != "main")
shader.Text = shaderDetails.DebugInfo.entryFunc + "()";
if (shaderDetails.DebugInfo.files.Length > 0)
{
string shaderfn = "";
int entryFile = shaderDetails.DebugInfo.entryFile;
if (entryFile < 0 || entryFile >= shaderDetails.DebugInfo.files.Length)
entryFile = 0;
shaderfn = shaderDetails.DebugInfo.files[entryFile].BaseFilename;
shader.Text += " - " + shaderfn;
}
}
int vs = 0;
vs = resources.VScrollValue();
resources.BeginUpdate();
resources.Nodes.Clear();
var samplers = new Dictionary<ResourceId, SamplerData>();
for(int bindset = 0; bindset < pipe.DescSets.Length; bindset++)
{
for(int bind = 0; bind < pipe.DescSets[bindset].bindings.Length; bind++)
{
AddResourceRow(shaderDetails, stage, bindset, bind, pipe, resources, texs, bufs, ref samplers);
}
// if we have a shader bound, go through and add rows for any resources it wants for binds that aren't
// in this descriptor set (e.g. if layout mismatches)
if (shaderDetails != null)
{
for (int i = 0; i < shaderDetails.ReadOnlyResources.Length; i++)
{
var ro = shaderDetails.ReadOnlyResources[i];
if (stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset == bindset &&
stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind >= pipe.DescSets[bindset].bindings.Length)
{
AddResourceRow(shaderDetails, stage, bindset,
stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind,
pipe, resources, texs, bufs, ref samplers);
}
}
for (int i = 0; i < shaderDetails.ReadWriteResources.Length; i++)
{
var rw = shaderDetails.ReadWriteResources[i];
if (stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset == bindset &&
stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind >= pipe.DescSets[bindset].bindings.Length)
{
AddResourceRow(shaderDetails, stage, bindset,
stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind,
pipe, resources, texs, bufs, ref samplers);
}
}
}
}
// if we have a shader bound, go through and add rows for any resources it wants for descriptor sets that aren't
// bound at all
if (shaderDetails != null)
{
for (int i = 0; i < shaderDetails.ReadOnlyResources.Length; i++)
{
var ro = shaderDetails.ReadOnlyResources[i];
if (stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset >= pipe.DescSets.Length)
{
AddResourceRow(shaderDetails, stage,
stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset,
stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind,
pipe, resources, texs, bufs, ref samplers);
}
}
for (int i = 0; i < shaderDetails.ReadWriteResources.Length; i++)
{
var rw = shaderDetails.ReadWriteResources[i];
//.........这里部分代码省略.........
示例5: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(D3D12PipelineState.ShaderStage stage,
Label shader, TreelistView.TreeListView resources, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView uavs)
{
FetchTexture[] texs = m_Core.CurTextures;
FetchBuffer[] bufs = m_Core.CurBuffers;
D3D12PipelineState state = m_Core.CurD3D12PipelineState;
ShaderReflection shaderDetails = stage.ShaderDetails;
ShaderBindpointMapping bindpointMapping = stage.BindpointMapping;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else if (state.customName)
shader.Text = state.PipelineName + " - " + m_Core.CurPipelineState.Abbrev(stage.stage);
else
shader.Text = state.PipelineName + " - " + stage.stage.Str(GraphicsAPI.D3D12) + " Shader";
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc.Length > 0 && shaderDetails.DebugInfo.files.Length > 0)
{
string shaderfn = "";
int entryFile = shaderDetails.DebugInfo.entryFile;
if (entryFile < 0 || entryFile >= shaderDetails.DebugInfo.files.Length)
entryFile = 0;
shaderfn = shaderDetails.DebugInfo.files[entryFile].BaseFilename;
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " + shaderfn;
}
int vs = 0;
vs = resources.VScrollValue();
resources.BeginUpdate();
resources.Nodes.Clear();
for (int space = 0; space < stage.Spaces.Length; space++)
{
for (int reg = 0; reg < stage.Spaces[space].SRVs.Length; reg++)
{
AddResourceRow(stage, resources, space, reg, false);
}
}
resources.EndUpdate();
resources.NodesSelection.Clear();
resources.SetVScrollValue(vs);
vs = uavs.VScrollValue();
uavs.BeginUpdate();
uavs.Nodes.Clear();
for (int space = 0; space < stage.Spaces.Length; space++)
{
for (int reg = 0; reg < stage.Spaces[space].UAVs.Length; reg++)
{
AddResourceRow(stage, uavs, space, reg, true);
}
}
uavs.EndUpdate();
uavs.NodesSelection.Clear();
uavs.SetVScrollValue(vs);
vs = samplers.VScrollValue();
samplers.BeginUpdate();
samplers.Nodes.Clear();
for (int space = 0; space < stage.Spaces.Length; space++)
{
for (int reg = 0; reg < stage.Spaces[space].Samplers.Length; reg++)
{
D3D12PipelineState.Sampler s = stage.Spaces[space].Samplers[reg];
// consider this register to not exist - it's in a gap defined by sparse root signature elements
if (s.RootElement == uint.MaxValue)
continue;
BindpointMap bind = null;
ShaderResource shaderInput = null;
if (stage.BindpointMapping != null && stage.ShaderDetails != null)
{
for (int i = 0; i < stage.BindpointMapping.ReadOnlyResources.Length; i++)
{
var b = stage.BindpointMapping.ReadOnlyResources[i];
var res = stage.ShaderDetails.ReadOnlyResources[i];
bool regMatch = b.bind == reg;
// handle unbounded arrays specially. It's illegal to have an unbounded array with
// anything after it
if (b.bind <= reg)
regMatch = (b.arraySize == UInt32.MaxValue) || (b.bind + b.arraySize > reg);
if (b.bindset == space && regMatch && res.IsSampler)
{
bind = b;
shaderInput = res;
break;
}
}
}
//.........这里部分代码省略.........
示例6: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
GLPipelineState.ShaderStage stage,
Label shader, TreelistView.TreeListView resources, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView classes)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = "Shader " + stage.Shader.ToString();
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0)
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " +
Path.GetFileName(shaderDetails.DebugInfo.files[0].filename);
cbuffers.BeginUpdate();
cbuffers.Nodes.Clear();
if(shaderDetails != null)
{
UInt32 i = 0;
foreach (var shaderCBuf in shaderDetails.ConstantBlocks)
{
{
string name = shaderCBuf.name;
int numvars = shaderCBuf.variables.Length;
string slotname = i.ToString();
var node = cbuffers.Nodes.Add(new object[] { slotname, name, "", "", numvars, "" });
node.Image = global::renderdocui.Properties.Resources.action;
node.HoverImage = global::renderdocui.Properties.Resources.action_hover;
node.Tag = i;
}
i++;
}
}
cbuffers.EndUpdate();
cbuffers.NodesSelection.Clear();
}
示例7: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
VulkanPipelineState.ShaderStage stage, VulkanPipelineState.Pipeline pipe,
Label shader, TreelistView.TreeListView resources,
TreelistView.TreeListView cbuffers)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.ShaderName;
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc.Length > 0)
{
if (shaderDetails.DebugInfo.files.Length > 0 || shaderDetails.DebugInfo.entryFunc != "main")
shader.Text = shaderDetails.DebugInfo.entryFunc + "()";
if (shaderDetails.DebugInfo.files.Length > 0)
{
string shaderfn = "";
int entryFile = shaderDetails.DebugInfo.entryFile;
if (entryFile < 0 || entryFile >= shaderDetails.DebugInfo.files.Length)
entryFile = 0;
shaderfn = shaderDetails.DebugInfo.files[entryFile].BaseFilename;
shader.Text += " - " + shaderfn;
}
}
int vs = 0;
vs = resources.VScrollValue();
resources.BeginUpdate();
resources.Nodes.Clear();
var samplers = new Dictionary<ResourceId, SamplerData>();
for(int bindset = 0; bindset < pipe.DescSets.Length; bindset++)
{
for(int bind = 0; bind < pipe.DescSets[bindset].bindings.Length; bind++)
{
ShaderResource shaderRes = null;
BindpointMap bindMap = null;
bool isrw = false;
uint bindPoint = 0;
if (shaderDetails != null)
{
for(int i=0; i < shaderDetails.ReadOnlyResources.Length; i++)
{
var ro = shaderDetails.ReadOnlyResources[i];
if (stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset == bindset &&
stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind == bind)
{
bindPoint = (uint)i;
shaderRes = ro;
bindMap = stage.BindpointMapping.ReadOnlyResources[ro.bindPoint];
}
}
for(int i=0; i < shaderDetails.ReadWriteResources.Length; i++)
{
var rw = shaderDetails.ReadWriteResources[i];
if (stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset == bindset &&
stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind == bind)
{
bindPoint = (uint)i;
isrw = true;
shaderRes = rw;
bindMap = stage.BindpointMapping.ReadWriteResources[rw.bindPoint];
}
}
}
VulkanPipelineState.Pipeline.DescriptorSet.DescriptorBinding.BindingElement[] slotBinds =
pipe.DescSets[bindset].bindings[bind].binds;
ShaderBindType bindType = pipe.DescSets[bindset].bindings[bind].type;
ShaderStageBits stageBits = pipe.DescSets[bindset].bindings[bind].stageFlags;
// skip descriptors that aren't for this shader stage
if (!stageBits.HasFlag((ShaderStageBits)(1 << (int)stage.stage)))
continue;
// these are treated as uniform buffers
if (bindType == ShaderBindType.ReadOnlyBuffer)
continue;
// consider it filled if any array element is filled
bool filledSlot = false;
for (int idx = 0; idx < slotBinds.Length; idx++)
{
filledSlot |= slotBinds[idx].res != ResourceId.Null;
if(bindType == ShaderBindType.Sampler || bindType == ShaderBindType.ImageSampler)
filledSlot |= slotBinds[idx].sampler != ResourceId.Null;
//.........这里部分代码省略.........
示例8: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
GLPipelineState state, GLPipelineState.ShaderStage stage,
Label shader, TreelistView.TreeListView resources, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView classes)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = "Shader " + stage.Shader.ToString();
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0)
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " +
Path.GetFileName(shaderDetails.DebugInfo.files[0].filename);
cbuffers.BeginUpdate();
cbuffers.Nodes.Clear();
if(shaderDetails != null)
{
UInt32 i = 0;
foreach (var shaderCBuf in shaderDetails.ConstantBlocks)
{
int bindPoint = stage.BindpointMapping.ConstantBlocks[i].bind;
bool filledSlot = !shaderCBuf.bufferBacked ||
(bindPoint >= 0 && bindPoint < state.UniformBuffers.Length && state.UniformBuffers[bindPoint].Resource != ResourceId.Null);
bool usedSlot = stage.BindpointMapping.ConstantBlocks[i].used;
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
(showDisabled.Checked && !usedSlot && filledSlot) || // it's bound, but not referenced, and we have "show disabled"
(showEmpty.Checked && !filledSlot) // it's empty, and we have "show empty"
)
{
string name = shaderCBuf.name;
int numvars = shaderCBuf.variables.Length;
string slotname = i.ToString();
var node = cbuffers.Nodes.Add(new object[] { slotname, name, bindPoint, "", numvars, "" });
node.Image = global::renderdocui.Properties.Resources.action;
node.HoverImage = global::renderdocui.Properties.Resources.action_hover;
node.Tag = i;
if (!filledSlot)
EmptyRow(node);
if (!usedSlot)
InactiveRow(node);
}
i++;
}
}
cbuffers.EndUpdate();
cbuffers.NodesSelection.Clear();
}