-
Notifications
You must be signed in to change notification settings - Fork 20
/
ohm.natvis
163 lines (152 loc) · 6.76 KB
/
ohm.natvis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="glm::vec<2,char,*>">
<AlternativeType Name="glm::vec<2,unsigned char,*>"/>
<AlternativeType Name="glm::u8vec2"/>
<AlternativeType Name="glm::i8vec2"/>
<DisplayString>x={(int)x} y={(int)y} z={(int)z}</DisplayString>
<Expand>
<Item Name="x">(int)x</Item>
<Item Name="y">(int)y</Item>
<Item Name="z">(int)z</Item>
<Item Name="len2">(int)x*(int)x + (int)y*(int)y + (int)z*(int)z</Item>
</Expand>
</Type>
<Type Name="glm::vec<3,char,*>">
<AlternativeType Name="glm::vec<3,unsigned char,*>"/>
<AlternativeType Name="glm::u8vec3"/>
<AlternativeType Name="glm::i8vec3"/>
<DisplayString>x={(int)x} y={(int)y} z={(int)z}</DisplayString>
<Expand>
<Item Name="x">(int)x</Item>
<Item Name="y">(int)y</Item>
<Item Name="z">(int)z</Item>
<Item Name="len2">(int)x*(int)x + (int)y*(int)y + (int)z*(int)z</Item>
</Expand>
</Type>
<Type Name="glm::vec<4,char,*>">
<AlternativeType Name="glm::vec<4,unsigned char,*>"/>
<AlternativeType Name="glm::u8vec4"/>
<AlternativeType Name="glm::i8vec4"/>
<DisplayString>x={(int)x} y={(int)y} z={(int)z}</DisplayString>
<Expand>
<Item Name="x">(int)x</Item>
<Item Name="y">(int)y</Item>
<Item Name="z">(int)z</Item>
<Item Name="len2">(int)x*(int)x + (int)y*(int)y + (int)z*(int)z</Item>
</Expand>
</Type>
<Type Name="glm::vec<2,*>">
<AlternativeType Name="glm::vec2"/>
<AlternativeType Name="glm::dvec2"/>
<AlternativeType Name="glm::i16vec2"/>
<AlternativeType Name="glm::ivec2"/>
<AlternativeType Name="glm::u16vec2"/>
<AlternativeType Name="glm::uvec2"/>
<DisplayString>x={x} y={y} z={z}</DisplayString>
<Expand>
<Item Name="x">x</Item>
<Item Name="y">y</Item>
<Item Name="z">z</Item>
<Item Name="len2">x*x + y*y + z*z</Item>
</Expand>
</Type>
<Type Name="glm::vec<3,*>">
<AlternativeType Name="glm::vec3"/>
<AlternativeType Name="glm::dvec3"/>
<AlternativeType Name="glm::i16vec3"/>
<AlternativeType Name="glm::ivec3"/>
<AlternativeType Name="glm::u16vec3"/>
<AlternativeType Name="glm::uvec3"/>
<DisplayString>x={x} y={y} z={z}</DisplayString>
<Expand>
<Item Name="x">x</Item>
<Item Name="y">y</Item>
<Item Name="z">z</Item>
<Item Name="len2">x*x + y*y + z*z</Item>
</Expand>
</Type>
<Type Name="glm::vec<4,*>">
<AlternativeType Name="glm::vec4"/>
<AlternativeType Name="glm::dvec4"/>
<AlternativeType Name="glm::i16vec4"/>
<AlternativeType Name="glm::ivec4"/>
<AlternativeType Name="glm::u16vec4"/>
<AlternativeType Name="glm::uvec4"/>
<DisplayString>x={x} y={y} z={z}</DisplayString>
<Expand>
<Item Name="x">x</Item>
<Item Name="y">y</Item>
<Item Name="z">z</Item>
<Item Name="len2">x*x + y*y + z*z</Item>
</Expand>
</Type>
<Type Name="ohm::Key">
<DisplayString Condition="local_.x==0 && local_.y==0 && local_.z==0 && region_key_.x==-32768 && region_key_.y==-32768 && region_key_.z==-32768">(null-key)</DisplayString>
<DisplayString>L:({(int)local_.x},{(int)local_.y},{(int)local_.z}) R:({region_key_.x},{region_key_.y},{region_key_.z})</DisplayString>
<Expand>
<Item Name="local_">local_</Item>
<Item Name="region_key_">region_key_</Item>
</Expand>
</Type>
<!--
SKA hash map support: note, the correct solution is to use CustomListItems and code to decipher the elements.
However, the VSCode MIEngine does not support Loop so we need an alternative. (Of course I learned this after I
had it working).
Also doesn't seem to work for GDB.
-->
<Type Name="ska::bytell_hash_map<*>">
<DisplayString>items={num_elements}</DisplayString>
<Expand>
<!--
The backup solution is to treat it like an indexed list and iterate the data blocks rather than the individual
elements.
Data begins at the `entries` pointer. There are a number of these blocks equal to the `num_slots_minus_one + 1`
unless `num_slots_minus_one` is zero, in which case the container is empty.
The data blocks can be expanded to look for valid data entries in the map, although there will be many
malformed/invalid data items.
-->
<IndexListItems>
<Size>(num_slots_minus_one ? num_slots_minus_one + 1 : 0)</Size>
<ValueNode>
entries[$i].data
</ValueNode>
</IndexListItems>
<!--
The correct solution is this one.
This logic is based on the ska map iterator code.
Note: If this is uncommented, the decrement operators need to be restored. They are currently written as
`- -` because joining the dashes is malformed in an HTML comment. The extraneous space would need to be removed.
-->
<!-- <CustomListItems MaxItemsPerView="5000" ExcludeView="Test">
<Variable Name="num_slots" InitialValue="(size_t)(num_slots_minus_one ? num_slots_minus_one + 1 : 0)"/>
<Variable Name="BlockSize" InitialValue="ska::detailv8::CalculateBytellBlockSize<$T1,$T2>::value"/>
<Variable Name="magic_for_empty" InitialValue="ska::detailv8::sherwood_v8_constants<void>::magic_for_empty"/>
<Variable Name="index" InitialValue="num_slots"/>
<Variable Name="current" InitialValue="entries + (num_slots / BlockSize)"/>
<Variable Name="count" InitialValue="0"/>
<Loop>
<Loop>
<If Condition="index % BlockSize == 0">
<Exec>- -current</Exec>
</If>
<If Condition="index- - == 0">
<Break/>
</If>
<Break Condition="current->control_bytes[index % BlockSize] != magic_for_empty"/>
</Loop>
<Item>&current->data[index % BlockSize]</Item>
<Break Condition="++count >= num_elements"/>
</Loop>
</CustomListItems> -->
</Expand>
</Type>
<!-- SKA iterator item visualisation. Works for const and non-const. -->
<Type Name="ska::detailv8::sherwood_v8_table<std::pair<*,*>,*>::templated_iterator<*>">
<DisplayString>{current->data[index % ska::detailv8::CalculateBytellBlockSize<$T1,$T1>::value].first}:{current->data[index % ska::detailv8::CalculateBytellBlockSize<$T1,$T1>::value].second}</DisplayString>
<Expand>
<Item Name="[key]">current->data[index % ska::detailv8::CalculateBytellBlockSize<$T1,$T1>::value].first</Item>
<Item Name="[value]">current->data[index % ska::detailv8::CalculateBytellBlockSize<$T1,$T1>::value].second</Item>
</Expand>
</Type>
</AutoVisualizer>