File: vulkan_tracked_object_info.cpp

package info (click to toggle)
gfxreconstruct 0.9.18%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 24,636 kB
  • sloc: cpp: 328,961; ansic: 25,454; python: 18,156; xml: 255; sh: 128; makefile: 6
file content (354 lines) | stat: -rw-r--r-- 10,003 bytes parent folder | download
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
/*
** Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/

#include "vulkan_tracked_object_info.h"

GFXRECON_BEGIN_NAMESPACE(gfxrecon)
GFXRECON_BEGIN_NAMESPACE(decode)

// Set physical device which is the parent of this logical device
void TrackedDeviceInfo::SetParentPhysicalDevice(VkPhysicalDevice physical_device)
{
    parent_ = physical_device;
}

// Get physical device which is the parent of this logical device
VkPhysicalDevice TrackedDeviceInfo::GetParentPhysicalDevice() const
{
    return parent_;
}

// Set capture device physical memory properties
void TrackedDeviceInfo::SetCaptureDevicePhysicalMemoryProperties(
    const VkPhysicalDeviceMemoryProperties* memory_properties)
{
    capture_memory_properties_ = memory_properties;
}

// Get capture device physical memory properties
const VkPhysicalDeviceMemoryProperties* TrackedDeviceInfo::GetCaptureDevicePhysicalMemoryProperties() const
{
    return capture_memory_properties_;
}

// Set replay device physical memory properties
void TrackedDeviceInfo::SetReplayDevicePhysicalMemoryProperties(
    const VkPhysicalDeviceMemoryProperties* memory_properties)
{
    replay_memory_properties_ = memory_properties;
}

// Get replay device physical memory properties
const VkPhysicalDeviceMemoryProperties* TrackedDeviceInfo::GetReplayDevicePhysicalMemoryProperties() const
{
    return replay_memory_properties_;
}

// Set trace memory allocation size
void TrackedDeviceMemoryInfo::SetTraceMemoryAllocationSize(VkDeviceSize memory_allocation_size)
{
    trace_memory_allocation_size_ = memory_allocation_size;
}

// Get trace memory allocation size
VkDeviceSize TrackedDeviceMemoryInfo::GetTraceMemoryAllocationSize() const
{
    return trace_memory_allocation_size_;
}

// Insert the mapped memory size number into the mapped memories sizes list
void TrackedDeviceMemoryInfo::InsertMappedMemorySizesList(VkDeviceSize mapped_memory_size)
{
    mapped_memories_sizes_.push_back(mapped_memory_size);
}

// Get mapped memories sizes list
const std::vector<VkDeviceSize>& TrackedDeviceMemoryInfo::GetMappedMemorySizesList() const
{
    return mapped_memories_sizes_;
}

// Insert the mapped memory offset number into the mapped memories offsets list
void TrackedDeviceMemoryInfo::InsertMappedMemoryOffsetsList(VkDeviceSize mapped_memory_offset)
{
    mapped_memories_offsets_.push_back(mapped_memory_offset);
}

// Get mapped memories offsets list
const std::vector<VkDeviceSize>& TrackedDeviceMemoryInfo::GetMappedMemoryOffsetsList() const
{
    return mapped_memories_offsets_;
}

// Insert the filled memory size number into the filled memories sizes list
void TrackedDeviceMemoryInfo::InsertFilledMemorySizesList(VkDeviceSize filled_memory_size)
{
    filled_memories_sizes_.push_back(filled_memory_size);
}

// Get filled memories sizes list
const std::vector<VkDeviceSize>& TrackedDeviceMemoryInfo::GetFilledMemorySizesList() const
{
    return filled_memories_sizes_;
}

// Insert the filled memory offset number into the filled memories offsets list
void TrackedDeviceMemoryInfo::InsertFilledMemoryOffsetsList(VkDeviceSize filled_memory_offset)
{
    filled_memories_offsets_.push_back(filled_memory_offset);
}

// Get filled memories offsets list
const std::vector<VkDeviceSize>& TrackedDeviceMemoryInfo::GetFilledMemoryOffsetsList() const
{
    return filled_memories_offsets_;
}

// Insert resource into the  bound resource list
void TrackedDeviceMemoryInfo::InsertBoundResourcesList(TrackedResourceInfo* resource)
{
    bound_resources_.push_back(resource);
}

// Get bound resource list
std::vector<TrackedResourceInfo*>* TrackedDeviceMemoryInfo::GetBoundResourcesList()
{
    return &bound_resources_;
}

const std::vector<TrackedResourceInfo*>* TrackedDeviceMemoryInfo::GetBoundResourcesList() const
{
    return &bound_resources_;
}

void TrackedDeviceMemoryInfo::AllocateReplayMemoryAllocationSize(VkDeviceSize size)
{
    replay_memory_allocation_size_ = size;
}

VkDeviceSize TrackedDeviceMemoryInfo::GetReplayMemoryAllocationSize() const
{
    return replay_memory_allocation_size_;
}

void TrackedDeviceMemoryInfo::SetMemoryPropertyFlags(VkMemoryPropertyFlags property_flags)
{
    property_flags_ = property_flags;
}

VkMemoryPropertyFlags TrackedDeviceMemoryInfo::GetMemoryPropertyFlags() const
{
    return property_flags_;
}

// Set memory ID that this resource bound to
void TrackedResourceInfo::SetBoundMemoryId(format::HandleId memory_id)
{
    memory_id_ = memory_id;
}

// Get memory ID that this resource bound to
format::HandleId TrackedResourceInfo::GetBoundMemoryId() const
{
    return memory_id_;
}

// Set memory property flags that this resource bound to
void TrackedResourceInfo::SetBoundMemoryPropertyFlags(VkMemoryPropertyFlags memory_property_flags)
{
    memory_property_flags_ = memory_property_flags;
}

// Get memory property flags that this resource bound to
VkMemoryPropertyFlags TrackedResourceInfo::GetBoundMemoryPropertyFlags() const
{
    return memory_property_flags_;
}

// Set trace resource binding offset
void TrackedResourceInfo::SetTraceBindOffset(VkDeviceSize bind_offset)
{
    if (bind_offset > 0)
    {
        trace_bind_offset_ = bind_offset;
    }
}

// Get trace source binding offset
VkDeviceSize TrackedResourceInfo::GetTraceBindOffset() const
{
    return trace_bind_offset_;
}

void TrackedResourceInfo::SetReplayBindOffset(VkDeviceSize bind_offset)
{
    if (bind_offset > 0)
    {
        replay_bind_offset_ = bind_offset;
    }
}

VkDeviceSize TrackedResourceInfo::GetReplayBindOffset() const
{
    return replay_bind_offset_;
}

void TrackedResourceInfo::SetTraceResourceSize(VkDeviceSize size)
{
    if (size > 0)
    {
        trace_size_ = size;
    }
}

VkDeviceSize TrackedResourceInfo::GetTraceResourceSize() const
{
    return trace_size_;
}

void TrackedResourceInfo::SetTraceResourceAlignment(VkDeviceSize alignment)
{
    if (alignment > 0)
    {
        trace_alignment_ = alignment;
    }
}

VkDeviceSize TrackedResourceInfo::GetTraceResourceAlignment() const
{
    return trace_alignment_;
}

void TrackedResourceInfo::SetTraceResourceMemoryTypeBits(uint32_t memory_type_bits)
{
    trace_memory_type_bits_ = memory_type_bits;
}

uint32_t TrackedResourceInfo::GetTraceResourceMemoryTypeBits() const
{
    return trace_memory_type_bits_;
}

void TrackedResourceInfo::SetReplayResourceSize(VkDeviceSize size)
{
    if (size > 0)
    {
        replay_size_ = size;
    }
}

VkDeviceSize TrackedResourceInfo::GetReplayResourceSize() const
{
    return replay_size_;
}

void TrackedResourceInfo::SetReplayResourceAlignment(VkDeviceSize alignment)
{
    if (alignment > 0)
    {
        replay_alignment_ = alignment;
    }
}

VkDeviceSize TrackedResourceInfo::GetReplayResourceAlignment() const
{
    return replay_alignment_;
}

void TrackedResourceInfo::SetReplayResourceMemoryTypeBits(uint32_t memory_type_bits)
{
    replay_memory_type_bits_ = memory_type_bits;
}

uint32_t TrackedResourceInfo::GetReplayResourceMemoryTypeBits() const
{
    return replay_memory_type_bits_;
}

// Set resource's queue family index
void TrackedResourceInfo::SetQueueFamilyIndex(uint32_t queue_family_index)
{
    queue_family_index_ = queue_family_index;
}

// Get resource's queue family index
uint32_t TrackedResourceInfo::GetQueueFamilyIndex() const
{
    return queue_family_index_;
}

// Set buffer creation information
void TrackedResourceInfo::SetBufferCreateInfo(VkBufferCreateInfo buffer_create_info)
{
    buffer_create_info_ = buffer_create_info;
}

// Get buffer binding offset
VkBufferCreateInfo TrackedResourceInfo::GetBufferCreateInfo() const
{
    return buffer_create_info_;
}

void TrackedResourceInfo::SetImageCreateInfo(VkImageCreateInfo image_create_info)
{
    image_create_info_ = image_create_info;
}

VkImageCreateInfo TrackedResourceInfo::GetImageCreateInfo() const
{
    return image_create_info_;
}

void TrackedPhysicalDeviceInfo::SetCaptureDevicePhysicalMemoryProperties(
    VkPhysicalDeviceMemoryProperties memory_properties)
{
    capture_memory_properties_ = memory_properties;
}

VkPhysicalDeviceMemoryProperties* TrackedPhysicalDeviceInfo::GetCaptureDevicePhysicalMemoryProperties()
{
    return &capture_memory_properties_;
}

const VkPhysicalDeviceMemoryProperties* TrackedPhysicalDeviceInfo::GetCaptureDevicePhysicalMemoryProperties() const
{
    return &capture_memory_properties_;
}

void TrackedPhysicalDeviceInfo::SetReplayDevicePhysicalMemoryProperties(
    VkPhysicalDeviceMemoryProperties memory_properties)
{
    replay_memory_properties_ = memory_properties;
}

VkPhysicalDeviceMemoryProperties* TrackedPhysicalDeviceInfo::GetReplayDevicePhysicalMemoryProperties()
{
    return &replay_memory_properties_;
}

const VkPhysicalDeviceMemoryProperties* TrackedPhysicalDeviceInfo::GetReplayDevicePhysicalMemoryProperties() const
{
    return &replay_memory_properties_;
}

GFXRECON_END_NAMESPACE(decode)
GFXRECON_END_NAMESPACE(gfxrecon)