Files
test2/tools/utils_ide/natvis/Blender.natvis
Aras Pranckevicius 919d2693c0 Build: expand Visual Studio natvis file
Expand the natvis file (which VS IDE debugger uses to visualize custom
data types) to handle:
- blender::Map with pointer keys
- blender::Set with both regular and pointer keys

Pull Request: https://projects.blender.org/blender/blender/pulls/138866
2025-05-14 14:45:40 +02:00

117 lines
4.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="blender::StringRef">
<DisplayString>{data_,[size_]s} (size={size_})</DisplayString>
</Type>
<Type Name="blender::Vector&lt;*&gt;">
<DisplayString>{{size={end_ - begin_}}}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple"> end_ - begin_</Item>
<Item Name="[capacity]" ExcludeView="simple">capacity_end_ - begin_</Item>
<ArrayItems>
<Size>end_ - begin_</Size>
<ValuePointer>begin_</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="blender::Span&lt;*&gt;">
<DisplayString>{{size={size_ }}}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple"> size_</Item>
<ArrayItems>
<Size>size_</Size>
<ValuePointer>data_</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="blender::VecBase&lt;*,3&gt;">
<DisplayString>{{x={x}, y={y}, z={z}}}</DisplayString>
</Type>
<Type Name="blender::Array&lt;*&gt;">
<DisplayString>{{size={size_ }}}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple"> size_</Item>
<ArrayItems>
<Size>size_</Size>
<ValuePointer>data_</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<!-- visualizer for Map with pointer keys (IntrusiveMapSlot slot type) -->
<Type Name="blender::Map&lt;*&gt;" Priority="MediumLow">
<DisplayString>Size={occupied_and_removed_slots_ - removed_slots_}</DisplayString>
<Expand>
<CustomListItems MaxItemsPerView="5000">
<Variable Name="slot" InitialValue="slots_.data_"/>
<Variable Name="i" InitialValue="0"/>
<Loop>
<Break Condition="i &gt;= occupied_and_removed_slots_ - removed_slots_"/>
<If Condition="(uint64_t)slot-&gt;key_ &lt; 0xfffffffffffffffe">
<Item Name="{slot-&gt;key_}">slot-&gt;value_buffer_</Item>
<Exec>++i</Exec>
</If>
<Exec>++slot</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
<!-- visualizer for regular Map (SimpleMapSlot slot type) -->
<Type Name="blender::Map&lt;*&gt;">
<DisplayString>Size={occupied_and_removed_slots_ - removed_slots_}</DisplayString>
<Expand>
<CustomListItems>
<Variable Name="slot" InitialValue="slots_.data_"/>
<Variable Name="i" InitialValue="0"/>
<Loop>
<Item Condition="slot-&gt;state_ == 1" Name="{slot-&gt;key_buffer_}">slot-&gt;value_buffer_</Item>
<Exec>++slot</Exec>
<Exec>++i</Exec>
<Break Condition="i &gt; slots_.size_"/>
</Loop>
</CustomListItems>
</Expand>
</Type>
<!-- visualizer for Set with pointer keys (IntrusiveSetSlot slot type) -->
<Type Name="blender::Set&lt;*&gt;" Priority="MediumLow">
<DisplayString>Size={occupied_and_removed_slots_ - removed_slots_}</DisplayString>
<Expand>
<CustomListItems MaxItemsPerView="5000">
<Variable Name="slot" InitialValue="slots_.data_"/>
<Variable Name="i" InitialValue="0"/>
<Loop>
<Break Condition="i &gt;= occupied_and_removed_slots_ - removed_slots_"/>
<If Condition="(uint64_t)slot-&gt;key_ &lt; 0xfffffffffffffffe">
<Item Name="[{i}]">slot-&gt;key_</Item>
<Exec>++i</Exec>
</If>
<Exec>++slot</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
<!-- visualizer for regular Set (SimpleSetSlot slot type) -->
<Type Name="blender::Set&lt;*&gt;">
<DisplayString>Size={occupied_and_removed_slots_ - removed_slots_}</DisplayString>
<Expand>
<CustomListItems>
<Variable Name="slot" InitialValue="slots_.data_"/>
<Variable Name="i" InitialValue="0"/>
<Loop>
<Break Condition="i &gt;= occupied_and_removed_slots_ - removed_slots_"/>
<If Condition="slot-&gt;state_ == 1">
<Item Name="[{i}]">slot-&gt;key_buffer_</Item>
<Exec>++i</Exec>
</If>
<Exec>++slot</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
<Type Name="blender::TypedBuffer&lt;*,*&gt;">
<DisplayString>{*($T1*)buffer_.buffer_.buffer_}</DisplayString>
<Expand>
<ExpandedItem>*($T1*)buffer_.buffer_.buffer_,nd</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>