Files
renderdoc/renderdoc/renderdoc.natvis
T
baldurk 81d5ca7c35 Add a trie lookup handler from a byte sequence key
* This is intended for write-only so does not support removing keys at all.
2025-06-06 12:16:54 +01:00

161 lines
9.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="rdcinflexiblestr">
<DisplayString>{(char*)pointer,s}</DisplayString>
<StringView>(char*)pointer,s</StringView>
<Expand>
<Synthetic Name="[mode]" Condition="is_literal != 0">
<DisplayString>Compile-Time Literal</DisplayString>
</Synthetic>
<Synthetic Name="[mode]" Condition="is_literal == 0">
<DisplayString>Heap allocated</DisplayString>
</Synthetic>
<ArrayItems>
<Size>strlen((char *)pointer)</Size>
<ValuePointer>(char *)pointer</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="rdcstr">
<DisplayString Condition="d.fixed.flags &amp; rdcstr::FIXED_STATE">{d.fixed.str,s}</DisplayString>
<DisplayString Condition="d.fixed.flags &amp; rdcstr::ALLOC_STATE">{d.alloc.str,s}</DisplayString>
<DisplayString>{d.arr.str,s}</DisplayString>
<StringView Condition="d.fixed.flags &amp; rdcstr::FIXED_STATE">d.fixed.str,s</StringView>
<StringView Condition="d.fixed.flags &amp; rdcstr::ALLOC_STATE">d.alloc.str,s</StringView>
<StringView>d.arr.str,s</StringView>
<Expand>
<Synthetic Name="[mode]" Condition="d.fixed.flags &amp; rdcstr::FIXED_STATE">
<DisplayString>Compile-Time Literal</DisplayString>
</Synthetic>
<Item Name="[size]" ExcludeView="simple" Condition="d.fixed.flags &amp; rdcstr::FIXED_STATE">d.fixed.size</Item>
<Item Name="[capacity]" ExcludeView="simple" Condition="d.fixed.flags &amp; rdcstr::FIXED_STATE">"N/A"</Item>
<ArrayItems Condition="d.fixed.flags &amp; rdcstr::FIXED_STATE">
<Size>d.fixed.size</Size>
<ValuePointer>d.fixed.str</ValuePointer>
</ArrayItems>
<Synthetic Name="[mode]" Condition="d.fixed.flags &amp; rdcstr::ALLOC_STATE">
<DisplayString>Heap-allocated String</DisplayString>
</Synthetic>
<Item Name="[size]" ExcludeView="simple" Condition="d.fixed.flags &amp; rdcstr::ALLOC_STATE">d.alloc.size</Item>
<Item Name="[capacity]" ExcludeView="simple" Condition="d.fixed.flags &amp; rdcstr::ALLOC_STATE">d.alloc._capacity &amp; rdcstr::alloc_ptr_rep::CAPACITY_MASK</Item>
<ArrayItems Condition="d.fixed.flags &amp; rdcstr::ALLOC_STATE">
<Size>d.alloc.size</Size>
<ValuePointer>d.alloc.str</ValuePointer>
</ArrayItems>
<Synthetic Name="[mode]" Condition="(d.fixed.flags &amp; (rdcstr::ALLOC_STATE|rdcstr::FIXED_STATE)) == 0">
<DisplayString>Internal Array Small String</DisplayString>
</Synthetic>
<Item Name="[size]" ExcludeView="simple" Condition="(d.fixed.flags &amp; (rdcstr::ALLOC_STATE|rdcstr::FIXED_STATE)) == 0">d.arr._size</Item>
<Item Name="[capacity]" ExcludeView="simple" Condition="(d.fixed.flags &amp; (rdcstr::ALLOC_STATE|rdcstr::FIXED_STATE)) == 0">d.arr.capacity</Item>
<ArrayItems Condition="(d.fixed.flags &amp; (rdcstr::ALLOC_STATE|rdcstr::FIXED_STATE)) == 0">
<Size>d.arr._size</Size>
<ValuePointer>d.arr.str</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="rdcarray&lt;*&gt;">
<DisplayString>{{ size={usedCount} }}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple">usedCount</Item>
<Item Name="[capacity]" ExcludeView="simple">allocatedCount</Item>
<ArrayItems>
<Size>usedCount</Size>
<ValuePointer>elems</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="rdcpair&lt;*&gt;">
<DisplayString>{{ {first}, {second} }}</DisplayString>
<Expand>
<Item Name="first" ExcludeView="simple">first</Item>
<Item Name="second" ExcludeView="simple">second</Item>
</Expand>
</Type>
<Type Name="rdcbytetrie&lt;*&gt;::NodeOrLeaf">
<DisplayString Condition="(v._trie &amp; 0xC000)==0xC000 &amp;&amp; (v._trie &amp; 0x2000)">FatNode = {v}</DisplayString>
<DisplayString Condition="(v._trie &amp; 0xC000)==0x8000 &amp;&amp; (v._trie &amp; 0x2000)">Node8 = {v}</DisplayString>
<DisplayString Condition="(v._trie &amp; 0xC000)==0x4000 &amp;&amp; (v._trie &amp; 0x2000)">Node2 = {v}</DisplayString>
<DisplayString Condition="(v._trie &amp; 0xC000)==0xC000 &amp;&amp; (v._trie &amp; 0x2000)==0">FatNode without value</DisplayString>
<DisplayString Condition="(v._trie &amp; 0xC000)==0x8000 &amp;&amp; (v._trie &amp; 0x2000)==0">Node8 without value</DisplayString>
<DisplayString Condition="(v._trie &amp; 0xC000)==0x4000 &amp;&amp; (v._trie &amp; 0x2000)==0">Node2 without value</DisplayString>
<DisplayString Condition="(v._trie &amp; 0xC000) == 0">Leaf = {v}</DisplayString>
<Expand>
<Synthetic Name="prefix">
<DisplayString>{v._trie &amp; 0x1FFF} prefix bytes</DisplayString>
<Expand>
<ArrayItems>
<Size>v._trie &amp; 0x1FFF</Size>
<ValuePointer>(byte *)(this+1)</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>
<Item Name="v" ExcludeView="simple" Condition="v._trie &amp; 0x2000">v</Item>
<Item Name="children" Condition="(v._trie &amp; 0xC000)==0xC000">((FatNode *)this)->children</Item>
<Item Name="children" Condition="(v._trie &amp; 0xC000)==0x8000">((SmallNode&lt;8&gt; *)this)->children</Item>
<Item Name="childBytes" Condition="(v._trie &amp; 0xC000)==0x8000">((SmallNode&lt;8&gt; *)this)->childBytes</Item>
<Item Name="children" Condition="(v._trie &amp; 0xC000)==0x4000">((SmallNode&lt;2&gt; *)this)->children</Item>
<Item Name="childBytes" Condition="(v._trie &amp; 0xC000)==0x4000">((SmallNode&lt;2&gt; *)this)->childBytes</Item>
</Expand>
</Type>
<Type Name="SDType">
<DisplayString>{name}</DisplayString>
<Expand>
<Item Name="name">name</Item>
<Item Name="basetype">basetype</Item>
<Item Name="byteSize">byteSize</Item>
<Item Name="flags">flags</Item>
</Expand>
</Type>
<Type Name="SDObject">
<DisplayString Condition="type.flags &amp; SDTypeFlags::HasCustomString">{name} = {data.str}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::String">{name} = {data.str}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::UnsignedInteger">{name} = {data.basic.u}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::SignedInteger">{name} = {data.basic.i}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::Float">{name} = {data.basic.d}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::Boolean">{name} = {data.basic.b}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::Character">{name} = {data.basic.c}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::Resource">{name} = {data.basic.id}</DisplayString>
<DisplayString Condition="type.basetype == SDBasic::Array">{name} = {type.name}[]</DisplayString>
<DisplayString>SDObject: {type.name} {name}</DisplayString>
<Expand>
<Item Condition="type.basetype == SDBasic::Array" Name="[size]" ExcludeView="simple">data.children.usedCount</Item>
<ArrayItems Condition="type.basetype == SDBasic::Array || type.basetype == SDBasic::Struct">
<Size>data.children.usedCount</Size>
<ValuePointer>data.children.elems</ValuePointer>
</ArrayItems>
<Item Condition="type.basetype != SDBasic::Array &amp;&amp; type.basetype != SDBasic::Struct" Name="type">type</Item>
<Item Condition="type.basetype != SDBasic::Array &amp;&amp; type.basetype != SDBasic::Struct" Name="name">name</Item>
<Item Condition="type.basetype != SDBasic::Array &amp;&amp; type.basetype != SDBasic::Struct" Name="data">data</Item>
</Expand>
</Type>
<Type Name="SDChunk">
<DisplayString>SDChunk: {name} ({metadata.chunkID})</DisplayString>
<Expand>
<Item Name="metadata" ExcludeView="simple">metadata</Item>
<Item Name="[size]" ExcludeView="simple">data.children.usedCount</Item>
<ArrayItems>
<Size>data.children.usedCount</Size>
<ValuePointer>data.children.elems</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="D3D12ResourceLayout">
<DisplayString Condition="value == D3D12_BARRIER_LAYOUT_UNDEFINED">{D3D12_BARRIER_LAYOUT_UNDEFINED}</DisplayString>
<DisplayString Condition="value &amp; 0x80000000U">{D3D12_BARRIER_LAYOUT(value &amp; 0x7fffffffU)}</DisplayString>
<DisplayString>{D3D12_RESOURCE_STATES(value)}</DisplayString>
</Type>
<Type Name="DXIL::Value" Inheritable="false">
<Expand>
<ExpandedItem Condition="valKind==1">*(DXIL::Literal *)this</ExpandedItem>
<ExpandedItem Condition="valKind==2">*(DXIL::Alias *)this</ExpandedItem>
<ExpandedItem Condition="valKind==3">*(DXIL::Constant *)this</ExpandedItem>
<ExpandedItem Condition="valKind==4">*(DXIL::GlobalVar *)this</ExpandedItem>
<ExpandedItem Condition="valKind==5">*(DXIL::Metadata *)this</ExpandedItem>
<ExpandedItem Condition="valKind==6">*(DXIL::Instruction *)this</ExpandedItem>
<ExpandedItem Condition="valKind==7">*(DXIL::Function *)this</ExpandedItem>
<ExpandedItem Condition="valKind==8">*(DXIL::Block *)this</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>