1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/gpu/vulkan_memory_event.proto
3
4 #include "protos/perfetto/trace/gpu/vulkan_memory_event.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
VulkanMemoryEventAnnotation(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR VulkanMemoryEventAnnotation::VulkanMemoryEventAnnotation(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.key_iid_)*/::uint64_t{0u}
28 , /*decltype(_impl_.value_)*/{}
29 , /*decltype(_impl_._oneof_case_)*/{}} {}
30 struct VulkanMemoryEventAnnotationDefaultTypeInternal {
VulkanMemoryEventAnnotationDefaultTypeInternalperfetto::protos::VulkanMemoryEventAnnotationDefaultTypeInternal31 PROTOBUF_CONSTEXPR VulkanMemoryEventAnnotationDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~VulkanMemoryEventAnnotationDefaultTypeInternalperfetto::protos::VulkanMemoryEventAnnotationDefaultTypeInternal33 ~VulkanMemoryEventAnnotationDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 VulkanMemoryEventAnnotation _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VulkanMemoryEventAnnotationDefaultTypeInternal _VulkanMemoryEventAnnotation_default_instance_;
VulkanMemoryEvent(::_pbi::ConstantInitialized)39 PROTOBUF_CONSTEXPR VulkanMemoryEvent::VulkanMemoryEvent(
40 ::_pbi::ConstantInitialized): _impl_{
41 /*decltype(_impl_._has_bits_)*/{}
42 , /*decltype(_impl_._cached_size_)*/{}
43 , /*decltype(_impl_.annotations_)*/{}
44 , /*decltype(_impl_.source_)*/0
45 , /*decltype(_impl_.operation_)*/0
46 , /*decltype(_impl_.timestamp_)*/::int64_t{0}
47 , /*decltype(_impl_.memory_address_)*/::uint64_t{0u}
48 , /*decltype(_impl_.memory_size_)*/::uint64_t{0u}
49 , /*decltype(_impl_.pid_)*/0u
50 , /*decltype(_impl_.allocation_scope_)*/0
51 , /*decltype(_impl_.caller_iid_)*/::uint64_t{0u}
52 , /*decltype(_impl_.device_)*/::uint64_t{0u}
53 , /*decltype(_impl_.device_memory_)*/::uint64_t{0u}
54 , /*decltype(_impl_.memory_type_)*/0u
55 , /*decltype(_impl_.heap_)*/0u
56 , /*decltype(_impl_.object_handle_)*/::uint64_t{0u}} {}
57 struct VulkanMemoryEventDefaultTypeInternal {
VulkanMemoryEventDefaultTypeInternalperfetto::protos::VulkanMemoryEventDefaultTypeInternal58 PROTOBUF_CONSTEXPR VulkanMemoryEventDefaultTypeInternal()
59 : _instance(::_pbi::ConstantInitialized{}) {}
~VulkanMemoryEventDefaultTypeInternalperfetto::protos::VulkanMemoryEventDefaultTypeInternal60 ~VulkanMemoryEventDefaultTypeInternal() {}
61 union { // NOLINT(misc-non-private-member-variables-in-classes)
62 VulkanMemoryEvent _instance;
63 };
64 };
65 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VulkanMemoryEventDefaultTypeInternal _VulkanMemoryEvent_default_instance_;
66 } // namespace protos
67 } // namespace perfetto
68 namespace perfetto {
69 namespace protos {
VulkanMemoryEvent_Source_IsValid(int value)70 bool VulkanMemoryEvent_Source_IsValid(int value) {
71 switch (value) {
72 case 0:
73 case 1:
74 case 2:
75 case 3:
76 case 4:
77 case 5:
78 return true;
79 default:
80 return false;
81 }
82 }
83
84 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> VulkanMemoryEvent_Source_strings[6] = {};
85
86 static const char VulkanMemoryEvent_Source_names[] =
87 "SOURCE_BUFFER"
88 "SOURCE_DEVICE"
89 "SOURCE_DEVICE_MEMORY"
90 "SOURCE_DRIVER"
91 "SOURCE_IMAGE"
92 "SOURCE_UNSPECIFIED";
93
94 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry VulkanMemoryEvent_Source_entries[] = {
95 { {VulkanMemoryEvent_Source_names + 0, 13}, 4 },
96 { {VulkanMemoryEvent_Source_names + 13, 13}, 2 },
97 { {VulkanMemoryEvent_Source_names + 26, 20}, 3 },
98 { {VulkanMemoryEvent_Source_names + 46, 13}, 1 },
99 { {VulkanMemoryEvent_Source_names + 59, 12}, 5 },
100 { {VulkanMemoryEvent_Source_names + 71, 18}, 0 },
101 };
102
103 static const int VulkanMemoryEvent_Source_entries_by_number[] = {
104 5, // 0 -> SOURCE_UNSPECIFIED
105 3, // 1 -> SOURCE_DRIVER
106 1, // 2 -> SOURCE_DEVICE
107 2, // 3 -> SOURCE_DEVICE_MEMORY
108 0, // 4 -> SOURCE_BUFFER
109 4, // 5 -> SOURCE_IMAGE
110 };
111
VulkanMemoryEvent_Source_Name(VulkanMemoryEvent_Source value)112 const std::string& VulkanMemoryEvent_Source_Name(
113 VulkanMemoryEvent_Source value) {
114 static const bool dummy =
115 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
116 VulkanMemoryEvent_Source_entries,
117 VulkanMemoryEvent_Source_entries_by_number,
118 6, VulkanMemoryEvent_Source_strings);
119 (void) dummy;
120 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
121 VulkanMemoryEvent_Source_entries,
122 VulkanMemoryEvent_Source_entries_by_number,
123 6, value);
124 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
125 VulkanMemoryEvent_Source_strings[idx].get();
126 }
VulkanMemoryEvent_Source_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,VulkanMemoryEvent_Source * value)127 bool VulkanMemoryEvent_Source_Parse(
128 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, VulkanMemoryEvent_Source* value) {
129 int int_value;
130 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
131 VulkanMemoryEvent_Source_entries, 6, name, &int_value);
132 if (success) {
133 *value = static_cast<VulkanMemoryEvent_Source>(int_value);
134 }
135 return success;
136 }
137 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
138 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::SOURCE_UNSPECIFIED;
139 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::SOURCE_DRIVER;
140 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::SOURCE_DEVICE;
141 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::SOURCE_DEVICE_MEMORY;
142 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::SOURCE_BUFFER;
143 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::SOURCE_IMAGE;
144 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::Source_MIN;
145 constexpr VulkanMemoryEvent_Source VulkanMemoryEvent::Source_MAX;
146 constexpr int VulkanMemoryEvent::Source_ARRAYSIZE;
147 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
VulkanMemoryEvent_Operation_IsValid(int value)148 bool VulkanMemoryEvent_Operation_IsValid(int value) {
149 switch (value) {
150 case 0:
151 case 1:
152 case 2:
153 case 3:
154 case 4:
155 case 5:
156 return true;
157 default:
158 return false;
159 }
160 }
161
162 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> VulkanMemoryEvent_Operation_strings[6] = {};
163
164 static const char VulkanMemoryEvent_Operation_names[] =
165 "OP_ANNOTATIONS"
166 "OP_BIND"
167 "OP_CREATE"
168 "OP_DESTROY"
169 "OP_DESTROY_BOUND"
170 "OP_UNSPECIFIED";
171
172 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry VulkanMemoryEvent_Operation_entries[] = {
173 { {VulkanMemoryEvent_Operation_names + 0, 14}, 5 },
174 { {VulkanMemoryEvent_Operation_names + 14, 7}, 3 },
175 { {VulkanMemoryEvent_Operation_names + 21, 9}, 1 },
176 { {VulkanMemoryEvent_Operation_names + 30, 10}, 2 },
177 { {VulkanMemoryEvent_Operation_names + 40, 16}, 4 },
178 { {VulkanMemoryEvent_Operation_names + 56, 14}, 0 },
179 };
180
181 static const int VulkanMemoryEvent_Operation_entries_by_number[] = {
182 5, // 0 -> OP_UNSPECIFIED
183 2, // 1 -> OP_CREATE
184 3, // 2 -> OP_DESTROY
185 1, // 3 -> OP_BIND
186 4, // 4 -> OP_DESTROY_BOUND
187 0, // 5 -> OP_ANNOTATIONS
188 };
189
VulkanMemoryEvent_Operation_Name(VulkanMemoryEvent_Operation value)190 const std::string& VulkanMemoryEvent_Operation_Name(
191 VulkanMemoryEvent_Operation value) {
192 static const bool dummy =
193 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
194 VulkanMemoryEvent_Operation_entries,
195 VulkanMemoryEvent_Operation_entries_by_number,
196 6, VulkanMemoryEvent_Operation_strings);
197 (void) dummy;
198 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
199 VulkanMemoryEvent_Operation_entries,
200 VulkanMemoryEvent_Operation_entries_by_number,
201 6, value);
202 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
203 VulkanMemoryEvent_Operation_strings[idx].get();
204 }
VulkanMemoryEvent_Operation_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,VulkanMemoryEvent_Operation * value)205 bool VulkanMemoryEvent_Operation_Parse(
206 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, VulkanMemoryEvent_Operation* value) {
207 int int_value;
208 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
209 VulkanMemoryEvent_Operation_entries, 6, name, &int_value);
210 if (success) {
211 *value = static_cast<VulkanMemoryEvent_Operation>(int_value);
212 }
213 return success;
214 }
215 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
216 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::OP_UNSPECIFIED;
217 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::OP_CREATE;
218 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::OP_DESTROY;
219 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::OP_BIND;
220 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::OP_DESTROY_BOUND;
221 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::OP_ANNOTATIONS;
222 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::Operation_MIN;
223 constexpr VulkanMemoryEvent_Operation VulkanMemoryEvent::Operation_MAX;
224 constexpr int VulkanMemoryEvent::Operation_ARRAYSIZE;
225 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
VulkanMemoryEvent_AllocationScope_IsValid(int value)226 bool VulkanMemoryEvent_AllocationScope_IsValid(int value) {
227 switch (value) {
228 case 0:
229 case 1:
230 case 2:
231 case 3:
232 case 4:
233 case 5:
234 return true;
235 default:
236 return false;
237 }
238 }
239
240 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> VulkanMemoryEvent_AllocationScope_strings[6] = {};
241
242 static const char VulkanMemoryEvent_AllocationScope_names[] =
243 "SCOPE_CACHE"
244 "SCOPE_COMMAND"
245 "SCOPE_DEVICE"
246 "SCOPE_INSTANCE"
247 "SCOPE_OBJECT"
248 "SCOPE_UNSPECIFIED";
249
250 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry VulkanMemoryEvent_AllocationScope_entries[] = {
251 { {VulkanMemoryEvent_AllocationScope_names + 0, 11}, 3 },
252 { {VulkanMemoryEvent_AllocationScope_names + 11, 13}, 1 },
253 { {VulkanMemoryEvent_AllocationScope_names + 24, 12}, 4 },
254 { {VulkanMemoryEvent_AllocationScope_names + 36, 14}, 5 },
255 { {VulkanMemoryEvent_AllocationScope_names + 50, 12}, 2 },
256 { {VulkanMemoryEvent_AllocationScope_names + 62, 17}, 0 },
257 };
258
259 static const int VulkanMemoryEvent_AllocationScope_entries_by_number[] = {
260 5, // 0 -> SCOPE_UNSPECIFIED
261 1, // 1 -> SCOPE_COMMAND
262 4, // 2 -> SCOPE_OBJECT
263 0, // 3 -> SCOPE_CACHE
264 2, // 4 -> SCOPE_DEVICE
265 3, // 5 -> SCOPE_INSTANCE
266 };
267
VulkanMemoryEvent_AllocationScope_Name(VulkanMemoryEvent_AllocationScope value)268 const std::string& VulkanMemoryEvent_AllocationScope_Name(
269 VulkanMemoryEvent_AllocationScope value) {
270 static const bool dummy =
271 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
272 VulkanMemoryEvent_AllocationScope_entries,
273 VulkanMemoryEvent_AllocationScope_entries_by_number,
274 6, VulkanMemoryEvent_AllocationScope_strings);
275 (void) dummy;
276 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
277 VulkanMemoryEvent_AllocationScope_entries,
278 VulkanMemoryEvent_AllocationScope_entries_by_number,
279 6, value);
280 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
281 VulkanMemoryEvent_AllocationScope_strings[idx].get();
282 }
VulkanMemoryEvent_AllocationScope_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,VulkanMemoryEvent_AllocationScope * value)283 bool VulkanMemoryEvent_AllocationScope_Parse(
284 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, VulkanMemoryEvent_AllocationScope* value) {
285 int int_value;
286 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
287 VulkanMemoryEvent_AllocationScope_entries, 6, name, &int_value);
288 if (success) {
289 *value = static_cast<VulkanMemoryEvent_AllocationScope>(int_value);
290 }
291 return success;
292 }
293 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
294 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::SCOPE_UNSPECIFIED;
295 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::SCOPE_COMMAND;
296 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::SCOPE_OBJECT;
297 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::SCOPE_CACHE;
298 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::SCOPE_DEVICE;
299 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::SCOPE_INSTANCE;
300 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::AllocationScope_MIN;
301 constexpr VulkanMemoryEvent_AllocationScope VulkanMemoryEvent::AllocationScope_MAX;
302 constexpr int VulkanMemoryEvent::AllocationScope_ARRAYSIZE;
303 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
304
305 // ===================================================================
306
307 class VulkanMemoryEventAnnotation::_Internal {
308 public:
309 using HasBits = decltype(std::declval<VulkanMemoryEventAnnotation>()._impl_._has_bits_);
set_has_key_iid(HasBits * has_bits)310 static void set_has_key_iid(HasBits* has_bits) {
311 (*has_bits)[0] |= 1u;
312 }
313 };
314
VulkanMemoryEventAnnotation(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)315 VulkanMemoryEventAnnotation::VulkanMemoryEventAnnotation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
316 bool is_message_owned)
317 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
318 SharedCtor(arena, is_message_owned);
319 // @@protoc_insertion_point(arena_constructor:perfetto.protos.VulkanMemoryEventAnnotation)
320 }
VulkanMemoryEventAnnotation(const VulkanMemoryEventAnnotation & from)321 VulkanMemoryEventAnnotation::VulkanMemoryEventAnnotation(const VulkanMemoryEventAnnotation& from)
322 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
323 VulkanMemoryEventAnnotation* const _this = this; (void)_this;
324 new (&_impl_) Impl_{
325 decltype(_impl_._has_bits_){from._impl_._has_bits_}
326 , /*decltype(_impl_._cached_size_)*/{}
327 , decltype(_impl_.key_iid_){}
328 , decltype(_impl_.value_){}
329 , /*decltype(_impl_._oneof_case_)*/{}};
330
331 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
332 _this->_impl_.key_iid_ = from._impl_.key_iid_;
333 clear_has_value();
334 switch (from.value_case()) {
335 case kIntValue: {
336 _this->_internal_set_int_value(from._internal_int_value());
337 break;
338 }
339 case kDoubleValue: {
340 _this->_internal_set_double_value(from._internal_double_value());
341 break;
342 }
343 case kStringIid: {
344 _this->_internal_set_string_iid(from._internal_string_iid());
345 break;
346 }
347 case VALUE_NOT_SET: {
348 break;
349 }
350 }
351 // @@protoc_insertion_point(copy_constructor:perfetto.protos.VulkanMemoryEventAnnotation)
352 }
353
SharedCtor(::_pb::Arena * arena,bool is_message_owned)354 inline void VulkanMemoryEventAnnotation::SharedCtor(
355 ::_pb::Arena* arena, bool is_message_owned) {
356 (void)arena;
357 (void)is_message_owned;
358 new (&_impl_) Impl_{
359 decltype(_impl_._has_bits_){}
360 , /*decltype(_impl_._cached_size_)*/{}
361 , decltype(_impl_.key_iid_){::uint64_t{0u}}
362 , decltype(_impl_.value_){}
363 , /*decltype(_impl_._oneof_case_)*/{}
364 };
365 clear_has_value();
366 }
367
~VulkanMemoryEventAnnotation()368 VulkanMemoryEventAnnotation::~VulkanMemoryEventAnnotation() {
369 // @@protoc_insertion_point(destructor:perfetto.protos.VulkanMemoryEventAnnotation)
370 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
371 (void)arena;
372 return;
373 }
374 SharedDtor();
375 }
376
SharedDtor()377 inline void VulkanMemoryEventAnnotation::SharedDtor() {
378 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
379 if (has_value()) {
380 clear_value();
381 }
382 }
383
SetCachedSize(int size) const384 void VulkanMemoryEventAnnotation::SetCachedSize(int size) const {
385 _impl_._cached_size_.Set(size);
386 }
387
clear_value()388 void VulkanMemoryEventAnnotation::clear_value() {
389 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.VulkanMemoryEventAnnotation)
390 switch (value_case()) {
391 case kIntValue: {
392 // No need to clear
393 break;
394 }
395 case kDoubleValue: {
396 // No need to clear
397 break;
398 }
399 case kStringIid: {
400 // No need to clear
401 break;
402 }
403 case VALUE_NOT_SET: {
404 break;
405 }
406 }
407 _impl_._oneof_case_[0] = VALUE_NOT_SET;
408 }
409
410
Clear()411 void VulkanMemoryEventAnnotation::Clear() {
412 // @@protoc_insertion_point(message_clear_start:perfetto.protos.VulkanMemoryEventAnnotation)
413 ::uint32_t cached_has_bits = 0;
414 // Prevent compiler warnings about cached_has_bits being unused
415 (void) cached_has_bits;
416
417 _impl_.key_iid_ = ::uint64_t{0u};
418 clear_value();
419 _impl_._has_bits_.Clear();
420 _internal_metadata_.Clear<std::string>();
421 }
422
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)423 const char* VulkanMemoryEventAnnotation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
424 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
425 _Internal::HasBits has_bits{};
426 while (!ctx->Done(&ptr)) {
427 ::uint32_t tag;
428 ptr = ::_pbi::ReadTag(ptr, &tag);
429 switch (tag >> 3) {
430 // optional uint64 key_iid = 1;
431 case 1:
432 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
433 _Internal::set_has_key_iid(&has_bits);
434 _impl_.key_iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
435 CHK_(ptr);
436 } else {
437 goto handle_unusual;
438 }
439 continue;
440 // int64 int_value = 2;
441 case 2:
442 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
443 _internal_set_int_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
444 CHK_(ptr);
445 } else {
446 goto handle_unusual;
447 }
448 continue;
449 // double double_value = 3;
450 case 3:
451 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 25)) {
452 _internal_set_double_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
453 ptr += sizeof(double);
454 } else {
455 goto handle_unusual;
456 }
457 continue;
458 // uint64 string_iid = 4;
459 case 4:
460 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
461 _internal_set_string_iid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
462 CHK_(ptr);
463 } else {
464 goto handle_unusual;
465 }
466 continue;
467 default:
468 goto handle_unusual;
469 } // switch
470 handle_unusual:
471 if ((tag == 0) || ((tag & 7) == 4)) {
472 CHK_(ptr);
473 ctx->SetLastTag(tag);
474 goto message_done;
475 }
476 ptr = UnknownFieldParse(
477 tag,
478 _internal_metadata_.mutable_unknown_fields<std::string>(),
479 ptr, ctx);
480 CHK_(ptr != nullptr);
481 } // while
482 message_done:
483 _impl_._has_bits_.Or(has_bits);
484 return ptr;
485 failure:
486 ptr = nullptr;
487 goto message_done;
488 #undef CHK_
489 }
490
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const491 ::uint8_t* VulkanMemoryEventAnnotation::_InternalSerialize(
492 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
493 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.VulkanMemoryEventAnnotation)
494 ::uint32_t cached_has_bits = 0;
495 (void) cached_has_bits;
496
497 cached_has_bits = _impl_._has_bits_[0];
498 // optional uint64 key_iid = 1;
499 if (cached_has_bits & 0x00000001u) {
500 target = stream->EnsureSpace(target);
501 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_key_iid(), target);
502 }
503
504 switch (value_case()) {
505 case kIntValue: {
506 target = stream->EnsureSpace(target);
507 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_int_value(), target);
508 break;
509 }
510 case kDoubleValue: {
511 target = stream->EnsureSpace(target);
512 target = ::_pbi::WireFormatLite::WriteDoubleToArray(3, this->_internal_double_value(), target);
513 break;
514 }
515 case kStringIid: {
516 target = stream->EnsureSpace(target);
517 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_string_iid(), target);
518 break;
519 }
520 default: ;
521 }
522 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
523 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
524 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
525 }
526 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.VulkanMemoryEventAnnotation)
527 return target;
528 }
529
ByteSizeLong() const530 size_t VulkanMemoryEventAnnotation::ByteSizeLong() const {
531 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.VulkanMemoryEventAnnotation)
532 size_t total_size = 0;
533
534 ::uint32_t cached_has_bits = 0;
535 // Prevent compiler warnings about cached_has_bits being unused
536 (void) cached_has_bits;
537
538 // optional uint64 key_iid = 1;
539 cached_has_bits = _impl_._has_bits_[0];
540 if (cached_has_bits & 0x00000001u) {
541 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_key_iid());
542 }
543
544 switch (value_case()) {
545 // int64 int_value = 2;
546 case kIntValue: {
547 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_int_value());
548 break;
549 }
550 // double double_value = 3;
551 case kDoubleValue: {
552 total_size += 1 + 8;
553 break;
554 }
555 // uint64 string_iid = 4;
556 case kStringIid: {
557 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_string_iid());
558 break;
559 }
560 case VALUE_NOT_SET: {
561 break;
562 }
563 }
564 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
565 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
566 }
567 int cached_size = ::_pbi::ToCachedSize(total_size);
568 SetCachedSize(cached_size);
569 return total_size;
570 }
571
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)572 void VulkanMemoryEventAnnotation::CheckTypeAndMergeFrom(
573 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
574 MergeFrom(*::_pbi::DownCast<const VulkanMemoryEventAnnotation*>(
575 &from));
576 }
577
MergeFrom(const VulkanMemoryEventAnnotation & from)578 void VulkanMemoryEventAnnotation::MergeFrom(const VulkanMemoryEventAnnotation& from) {
579 VulkanMemoryEventAnnotation* const _this = this;
580 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.VulkanMemoryEventAnnotation)
581 GOOGLE_DCHECK_NE(&from, _this);
582 ::uint32_t cached_has_bits = 0;
583 (void) cached_has_bits;
584
585 if (from._internal_has_key_iid()) {
586 _this->_internal_set_key_iid(from._internal_key_iid());
587 }
588 switch (from.value_case()) {
589 case kIntValue: {
590 _this->_internal_set_int_value(from._internal_int_value());
591 break;
592 }
593 case kDoubleValue: {
594 _this->_internal_set_double_value(from._internal_double_value());
595 break;
596 }
597 case kStringIid: {
598 _this->_internal_set_string_iid(from._internal_string_iid());
599 break;
600 }
601 case VALUE_NOT_SET: {
602 break;
603 }
604 }
605 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
606 }
607
CopyFrom(const VulkanMemoryEventAnnotation & from)608 void VulkanMemoryEventAnnotation::CopyFrom(const VulkanMemoryEventAnnotation& from) {
609 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.VulkanMemoryEventAnnotation)
610 if (&from == this) return;
611 Clear();
612 MergeFrom(from);
613 }
614
IsInitialized() const615 bool VulkanMemoryEventAnnotation::IsInitialized() const {
616 return true;
617 }
618
InternalSwap(VulkanMemoryEventAnnotation * other)619 void VulkanMemoryEventAnnotation::InternalSwap(VulkanMemoryEventAnnotation* other) {
620 using std::swap;
621 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
622 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
623 swap(_impl_.key_iid_, other->_impl_.key_iid_);
624 swap(_impl_.value_, other->_impl_.value_);
625 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
626 }
627
GetTypeName() const628 std::string VulkanMemoryEventAnnotation::GetTypeName() const {
629 return "perfetto.protos.VulkanMemoryEventAnnotation";
630 }
631
632
633 // ===================================================================
634
635 class VulkanMemoryEvent::_Internal {
636 public:
637 using HasBits = decltype(std::declval<VulkanMemoryEvent>()._impl_._has_bits_);
set_has_source(HasBits * has_bits)638 static void set_has_source(HasBits* has_bits) {
639 (*has_bits)[0] |= 1u;
640 }
set_has_operation(HasBits * has_bits)641 static void set_has_operation(HasBits* has_bits) {
642 (*has_bits)[0] |= 2u;
643 }
set_has_timestamp(HasBits * has_bits)644 static void set_has_timestamp(HasBits* has_bits) {
645 (*has_bits)[0] |= 4u;
646 }
set_has_pid(HasBits * has_bits)647 static void set_has_pid(HasBits* has_bits) {
648 (*has_bits)[0] |= 32u;
649 }
set_has_memory_address(HasBits * has_bits)650 static void set_has_memory_address(HasBits* has_bits) {
651 (*has_bits)[0] |= 8u;
652 }
set_has_memory_size(HasBits * has_bits)653 static void set_has_memory_size(HasBits* has_bits) {
654 (*has_bits)[0] |= 16u;
655 }
set_has_caller_iid(HasBits * has_bits)656 static void set_has_caller_iid(HasBits* has_bits) {
657 (*has_bits)[0] |= 128u;
658 }
set_has_allocation_scope(HasBits * has_bits)659 static void set_has_allocation_scope(HasBits* has_bits) {
660 (*has_bits)[0] |= 64u;
661 }
set_has_device(HasBits * has_bits)662 static void set_has_device(HasBits* has_bits) {
663 (*has_bits)[0] |= 256u;
664 }
set_has_device_memory(HasBits * has_bits)665 static void set_has_device_memory(HasBits* has_bits) {
666 (*has_bits)[0] |= 512u;
667 }
set_has_memory_type(HasBits * has_bits)668 static void set_has_memory_type(HasBits* has_bits) {
669 (*has_bits)[0] |= 1024u;
670 }
set_has_heap(HasBits * has_bits)671 static void set_has_heap(HasBits* has_bits) {
672 (*has_bits)[0] |= 2048u;
673 }
set_has_object_handle(HasBits * has_bits)674 static void set_has_object_handle(HasBits* has_bits) {
675 (*has_bits)[0] |= 4096u;
676 }
677 };
678
VulkanMemoryEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)679 VulkanMemoryEvent::VulkanMemoryEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
680 bool is_message_owned)
681 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
682 SharedCtor(arena, is_message_owned);
683 // @@protoc_insertion_point(arena_constructor:perfetto.protos.VulkanMemoryEvent)
684 }
VulkanMemoryEvent(const VulkanMemoryEvent & from)685 VulkanMemoryEvent::VulkanMemoryEvent(const VulkanMemoryEvent& from)
686 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
687 VulkanMemoryEvent* const _this = this; (void)_this;
688 new (&_impl_) Impl_{
689 decltype(_impl_._has_bits_){from._impl_._has_bits_}
690 , /*decltype(_impl_._cached_size_)*/{}
691 , decltype(_impl_.annotations_){from._impl_.annotations_}
692 , decltype(_impl_.source_){}
693 , decltype(_impl_.operation_){}
694 , decltype(_impl_.timestamp_){}
695 , decltype(_impl_.memory_address_){}
696 , decltype(_impl_.memory_size_){}
697 , decltype(_impl_.pid_){}
698 , decltype(_impl_.allocation_scope_){}
699 , decltype(_impl_.caller_iid_){}
700 , decltype(_impl_.device_){}
701 , decltype(_impl_.device_memory_){}
702 , decltype(_impl_.memory_type_){}
703 , decltype(_impl_.heap_){}
704 , decltype(_impl_.object_handle_){}};
705
706 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
707 ::memcpy(&_impl_.source_, &from._impl_.source_,
708 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.object_handle_) -
709 reinterpret_cast<char*>(&_impl_.source_)) + sizeof(_impl_.object_handle_));
710 // @@protoc_insertion_point(copy_constructor:perfetto.protos.VulkanMemoryEvent)
711 }
712
SharedCtor(::_pb::Arena * arena,bool is_message_owned)713 inline void VulkanMemoryEvent::SharedCtor(
714 ::_pb::Arena* arena, bool is_message_owned) {
715 (void)arena;
716 (void)is_message_owned;
717 new (&_impl_) Impl_{
718 decltype(_impl_._has_bits_){}
719 , /*decltype(_impl_._cached_size_)*/{}
720 , decltype(_impl_.annotations_){arena}
721 , decltype(_impl_.source_){0}
722 , decltype(_impl_.operation_){0}
723 , decltype(_impl_.timestamp_){::int64_t{0}}
724 , decltype(_impl_.memory_address_){::uint64_t{0u}}
725 , decltype(_impl_.memory_size_){::uint64_t{0u}}
726 , decltype(_impl_.pid_){0u}
727 , decltype(_impl_.allocation_scope_){0}
728 , decltype(_impl_.caller_iid_){::uint64_t{0u}}
729 , decltype(_impl_.device_){::uint64_t{0u}}
730 , decltype(_impl_.device_memory_){::uint64_t{0u}}
731 , decltype(_impl_.memory_type_){0u}
732 , decltype(_impl_.heap_){0u}
733 , decltype(_impl_.object_handle_){::uint64_t{0u}}
734 };
735 }
736
~VulkanMemoryEvent()737 VulkanMemoryEvent::~VulkanMemoryEvent() {
738 // @@protoc_insertion_point(destructor:perfetto.protos.VulkanMemoryEvent)
739 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
740 (void)arena;
741 return;
742 }
743 SharedDtor();
744 }
745
SharedDtor()746 inline void VulkanMemoryEvent::SharedDtor() {
747 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
748 _impl_.annotations_.~RepeatedPtrField();
749 }
750
SetCachedSize(int size) const751 void VulkanMemoryEvent::SetCachedSize(int size) const {
752 _impl_._cached_size_.Set(size);
753 }
754
Clear()755 void VulkanMemoryEvent::Clear() {
756 // @@protoc_insertion_point(message_clear_start:perfetto.protos.VulkanMemoryEvent)
757 ::uint32_t cached_has_bits = 0;
758 // Prevent compiler warnings about cached_has_bits being unused
759 (void) cached_has_bits;
760
761 _impl_.annotations_.Clear();
762 cached_has_bits = _impl_._has_bits_[0];
763 if (cached_has_bits & 0x000000ffu) {
764 ::memset(&_impl_.source_, 0, static_cast<size_t>(
765 reinterpret_cast<char*>(&_impl_.caller_iid_) -
766 reinterpret_cast<char*>(&_impl_.source_)) + sizeof(_impl_.caller_iid_));
767 }
768 if (cached_has_bits & 0x00001f00u) {
769 ::memset(&_impl_.device_, 0, static_cast<size_t>(
770 reinterpret_cast<char*>(&_impl_.object_handle_) -
771 reinterpret_cast<char*>(&_impl_.device_)) + sizeof(_impl_.object_handle_));
772 }
773 _impl_._has_bits_.Clear();
774 _internal_metadata_.Clear<std::string>();
775 }
776
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)777 const char* VulkanMemoryEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
778 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
779 _Internal::HasBits has_bits{};
780 while (!ctx->Done(&ptr)) {
781 ::uint32_t tag;
782 ptr = ::_pbi::ReadTag(ptr, &tag);
783 switch (tag >> 3) {
784 // optional .perfetto.protos.VulkanMemoryEvent.Source source = 1;
785 case 1:
786 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
787 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
788 CHK_(ptr);
789 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::VulkanMemoryEvent_Source_IsValid(val))) {
790 _internal_set_source(static_cast<::perfetto::protos::VulkanMemoryEvent_Source>(val));
791 } else {
792 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
793 }
794 } else {
795 goto handle_unusual;
796 }
797 continue;
798 // optional .perfetto.protos.VulkanMemoryEvent.Operation operation = 2;
799 case 2:
800 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
801 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
802 CHK_(ptr);
803 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::VulkanMemoryEvent_Operation_IsValid(val))) {
804 _internal_set_operation(static_cast<::perfetto::protos::VulkanMemoryEvent_Operation>(val));
805 } else {
806 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
807 }
808 } else {
809 goto handle_unusual;
810 }
811 continue;
812 // optional int64 timestamp = 3;
813 case 3:
814 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
815 _Internal::set_has_timestamp(&has_bits);
816 _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
817 CHK_(ptr);
818 } else {
819 goto handle_unusual;
820 }
821 continue;
822 // optional uint32 pid = 4;
823 case 4:
824 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
825 _Internal::set_has_pid(&has_bits);
826 _impl_.pid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
827 CHK_(ptr);
828 } else {
829 goto handle_unusual;
830 }
831 continue;
832 // optional fixed64 memory_address = 5;
833 case 5:
834 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 41)) {
835 _Internal::set_has_memory_address(&has_bits);
836 _impl_.memory_address_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr);
837 ptr += sizeof(::uint64_t);
838 } else {
839 goto handle_unusual;
840 }
841 continue;
842 // optional uint64 memory_size = 6;
843 case 6:
844 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
845 _Internal::set_has_memory_size(&has_bits);
846 _impl_.memory_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
847 CHK_(ptr);
848 } else {
849 goto handle_unusual;
850 }
851 continue;
852 // optional uint64 caller_iid = 7;
853 case 7:
854 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
855 _Internal::set_has_caller_iid(&has_bits);
856 _impl_.caller_iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
857 CHK_(ptr);
858 } else {
859 goto handle_unusual;
860 }
861 continue;
862 // optional .perfetto.protos.VulkanMemoryEvent.AllocationScope allocation_scope = 8;
863 case 8:
864 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
865 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
866 CHK_(ptr);
867 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::VulkanMemoryEvent_AllocationScope_IsValid(val))) {
868 _internal_set_allocation_scope(static_cast<::perfetto::protos::VulkanMemoryEvent_AllocationScope>(val));
869 } else {
870 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
871 }
872 } else {
873 goto handle_unusual;
874 }
875 continue;
876 // repeated .perfetto.protos.VulkanMemoryEventAnnotation annotations = 9;
877 case 9:
878 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
879 ptr -= 1;
880 do {
881 ptr += 1;
882 ptr = ctx->ParseMessage(_internal_add_annotations(), ptr);
883 CHK_(ptr);
884 if (!ctx->DataAvailable(ptr)) break;
885 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
886 } else {
887 goto handle_unusual;
888 }
889 continue;
890 // optional fixed64 device = 16;
891 case 16:
892 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 129)) {
893 _Internal::set_has_device(&has_bits);
894 _impl_.device_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr);
895 ptr += sizeof(::uint64_t);
896 } else {
897 goto handle_unusual;
898 }
899 continue;
900 // optional fixed64 device_memory = 17;
901 case 17:
902 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 137)) {
903 _Internal::set_has_device_memory(&has_bits);
904 _impl_.device_memory_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr);
905 ptr += sizeof(::uint64_t);
906 } else {
907 goto handle_unusual;
908 }
909 continue;
910 // optional uint32 memory_type = 18;
911 case 18:
912 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 144)) {
913 _Internal::set_has_memory_type(&has_bits);
914 _impl_.memory_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
915 CHK_(ptr);
916 } else {
917 goto handle_unusual;
918 }
919 continue;
920 // optional uint32 heap = 19;
921 case 19:
922 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 152)) {
923 _Internal::set_has_heap(&has_bits);
924 _impl_.heap_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
925 CHK_(ptr);
926 } else {
927 goto handle_unusual;
928 }
929 continue;
930 // optional fixed64 object_handle = 20;
931 case 20:
932 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 161)) {
933 _Internal::set_has_object_handle(&has_bits);
934 _impl_.object_handle_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr);
935 ptr += sizeof(::uint64_t);
936 } else {
937 goto handle_unusual;
938 }
939 continue;
940 default:
941 goto handle_unusual;
942 } // switch
943 handle_unusual:
944 if ((tag == 0) || ((tag & 7) == 4)) {
945 CHK_(ptr);
946 ctx->SetLastTag(tag);
947 goto message_done;
948 }
949 ptr = UnknownFieldParse(
950 tag,
951 _internal_metadata_.mutable_unknown_fields<std::string>(),
952 ptr, ctx);
953 CHK_(ptr != nullptr);
954 } // while
955 message_done:
956 _impl_._has_bits_.Or(has_bits);
957 return ptr;
958 failure:
959 ptr = nullptr;
960 goto message_done;
961 #undef CHK_
962 }
963
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const964 ::uint8_t* VulkanMemoryEvent::_InternalSerialize(
965 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
966 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.VulkanMemoryEvent)
967 ::uint32_t cached_has_bits = 0;
968 (void) cached_has_bits;
969
970 cached_has_bits = _impl_._has_bits_[0];
971 // optional .perfetto.protos.VulkanMemoryEvent.Source source = 1;
972 if (cached_has_bits & 0x00000001u) {
973 target = stream->EnsureSpace(target);
974 target = ::_pbi::WireFormatLite::WriteEnumToArray(
975 1, this->_internal_source(), target);
976 }
977
978 // optional .perfetto.protos.VulkanMemoryEvent.Operation operation = 2;
979 if (cached_has_bits & 0x00000002u) {
980 target = stream->EnsureSpace(target);
981 target = ::_pbi::WireFormatLite::WriteEnumToArray(
982 2, this->_internal_operation(), target);
983 }
984
985 // optional int64 timestamp = 3;
986 if (cached_has_bits & 0x00000004u) {
987 target = stream->EnsureSpace(target);
988 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_timestamp(), target);
989 }
990
991 // optional uint32 pid = 4;
992 if (cached_has_bits & 0x00000020u) {
993 target = stream->EnsureSpace(target);
994 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_pid(), target);
995 }
996
997 // optional fixed64 memory_address = 5;
998 if (cached_has_bits & 0x00000008u) {
999 target = stream->EnsureSpace(target);
1000 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(5, this->_internal_memory_address(), target);
1001 }
1002
1003 // optional uint64 memory_size = 6;
1004 if (cached_has_bits & 0x00000010u) {
1005 target = stream->EnsureSpace(target);
1006 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_memory_size(), target);
1007 }
1008
1009 // optional uint64 caller_iid = 7;
1010 if (cached_has_bits & 0x00000080u) {
1011 target = stream->EnsureSpace(target);
1012 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_caller_iid(), target);
1013 }
1014
1015 // optional .perfetto.protos.VulkanMemoryEvent.AllocationScope allocation_scope = 8;
1016 if (cached_has_bits & 0x00000040u) {
1017 target = stream->EnsureSpace(target);
1018 target = ::_pbi::WireFormatLite::WriteEnumToArray(
1019 8, this->_internal_allocation_scope(), target);
1020 }
1021
1022 // repeated .perfetto.protos.VulkanMemoryEventAnnotation annotations = 9;
1023 for (unsigned i = 0,
1024 n = static_cast<unsigned>(this->_internal_annotations_size()); i < n; i++) {
1025 const auto& repfield = this->_internal_annotations(i);
1026 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1027 InternalWriteMessage(9, repfield, repfield.GetCachedSize(), target, stream);
1028 }
1029
1030 // optional fixed64 device = 16;
1031 if (cached_has_bits & 0x00000100u) {
1032 target = stream->EnsureSpace(target);
1033 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(16, this->_internal_device(), target);
1034 }
1035
1036 // optional fixed64 device_memory = 17;
1037 if (cached_has_bits & 0x00000200u) {
1038 target = stream->EnsureSpace(target);
1039 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(17, this->_internal_device_memory(), target);
1040 }
1041
1042 // optional uint32 memory_type = 18;
1043 if (cached_has_bits & 0x00000400u) {
1044 target = stream->EnsureSpace(target);
1045 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(18, this->_internal_memory_type(), target);
1046 }
1047
1048 // optional uint32 heap = 19;
1049 if (cached_has_bits & 0x00000800u) {
1050 target = stream->EnsureSpace(target);
1051 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(19, this->_internal_heap(), target);
1052 }
1053
1054 // optional fixed64 object_handle = 20;
1055 if (cached_has_bits & 0x00001000u) {
1056 target = stream->EnsureSpace(target);
1057 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(20, this->_internal_object_handle(), target);
1058 }
1059
1060 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1061 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1062 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1063 }
1064 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.VulkanMemoryEvent)
1065 return target;
1066 }
1067
ByteSizeLong() const1068 size_t VulkanMemoryEvent::ByteSizeLong() const {
1069 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.VulkanMemoryEvent)
1070 size_t total_size = 0;
1071
1072 ::uint32_t cached_has_bits = 0;
1073 // Prevent compiler warnings about cached_has_bits being unused
1074 (void) cached_has_bits;
1075
1076 // repeated .perfetto.protos.VulkanMemoryEventAnnotation annotations = 9;
1077 total_size += 1UL * this->_internal_annotations_size();
1078 for (const auto& msg : this->_impl_.annotations_) {
1079 total_size +=
1080 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1081 }
1082
1083 cached_has_bits = _impl_._has_bits_[0];
1084 if (cached_has_bits & 0x000000ffu) {
1085 // optional .perfetto.protos.VulkanMemoryEvent.Source source = 1;
1086 if (cached_has_bits & 0x00000001u) {
1087 total_size += 1 +
1088 ::_pbi::WireFormatLite::EnumSize(this->_internal_source());
1089 }
1090
1091 // optional .perfetto.protos.VulkanMemoryEvent.Operation operation = 2;
1092 if (cached_has_bits & 0x00000002u) {
1093 total_size += 1 +
1094 ::_pbi::WireFormatLite::EnumSize(this->_internal_operation());
1095 }
1096
1097 // optional int64 timestamp = 3;
1098 if (cached_has_bits & 0x00000004u) {
1099 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp());
1100 }
1101
1102 // optional fixed64 memory_address = 5;
1103 if (cached_has_bits & 0x00000008u) {
1104 total_size += 1 + 8;
1105 }
1106
1107 // optional uint64 memory_size = 6;
1108 if (cached_has_bits & 0x00000010u) {
1109 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_memory_size());
1110 }
1111
1112 // optional uint32 pid = 4;
1113 if (cached_has_bits & 0x00000020u) {
1114 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_pid());
1115 }
1116
1117 // optional .perfetto.protos.VulkanMemoryEvent.AllocationScope allocation_scope = 8;
1118 if (cached_has_bits & 0x00000040u) {
1119 total_size += 1 +
1120 ::_pbi::WireFormatLite::EnumSize(this->_internal_allocation_scope());
1121 }
1122
1123 // optional uint64 caller_iid = 7;
1124 if (cached_has_bits & 0x00000080u) {
1125 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_caller_iid());
1126 }
1127
1128 }
1129 if (cached_has_bits & 0x00001f00u) {
1130 // optional fixed64 device = 16;
1131 if (cached_has_bits & 0x00000100u) {
1132 total_size += 2 + 8;
1133 }
1134
1135 // optional fixed64 device_memory = 17;
1136 if (cached_has_bits & 0x00000200u) {
1137 total_size += 2 + 8;
1138 }
1139
1140 // optional uint32 memory_type = 18;
1141 if (cached_has_bits & 0x00000400u) {
1142 total_size += 2 +
1143 ::_pbi::WireFormatLite::UInt32Size(
1144 this->_internal_memory_type());
1145 }
1146
1147 // optional uint32 heap = 19;
1148 if (cached_has_bits & 0x00000800u) {
1149 total_size += 2 +
1150 ::_pbi::WireFormatLite::UInt32Size(
1151 this->_internal_heap());
1152 }
1153
1154 // optional fixed64 object_handle = 20;
1155 if (cached_has_bits & 0x00001000u) {
1156 total_size += 2 + 8;
1157 }
1158
1159 }
1160 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1161 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1162 }
1163 int cached_size = ::_pbi::ToCachedSize(total_size);
1164 SetCachedSize(cached_size);
1165 return total_size;
1166 }
1167
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1168 void VulkanMemoryEvent::CheckTypeAndMergeFrom(
1169 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1170 MergeFrom(*::_pbi::DownCast<const VulkanMemoryEvent*>(
1171 &from));
1172 }
1173
MergeFrom(const VulkanMemoryEvent & from)1174 void VulkanMemoryEvent::MergeFrom(const VulkanMemoryEvent& from) {
1175 VulkanMemoryEvent* const _this = this;
1176 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.VulkanMemoryEvent)
1177 GOOGLE_DCHECK_NE(&from, _this);
1178 ::uint32_t cached_has_bits = 0;
1179 (void) cached_has_bits;
1180
1181 _this->_impl_.annotations_.MergeFrom(from._impl_.annotations_);
1182 cached_has_bits = from._impl_._has_bits_[0];
1183 if (cached_has_bits & 0x000000ffu) {
1184 if (cached_has_bits & 0x00000001u) {
1185 _this->_impl_.source_ = from._impl_.source_;
1186 }
1187 if (cached_has_bits & 0x00000002u) {
1188 _this->_impl_.operation_ = from._impl_.operation_;
1189 }
1190 if (cached_has_bits & 0x00000004u) {
1191 _this->_impl_.timestamp_ = from._impl_.timestamp_;
1192 }
1193 if (cached_has_bits & 0x00000008u) {
1194 _this->_impl_.memory_address_ = from._impl_.memory_address_;
1195 }
1196 if (cached_has_bits & 0x00000010u) {
1197 _this->_impl_.memory_size_ = from._impl_.memory_size_;
1198 }
1199 if (cached_has_bits & 0x00000020u) {
1200 _this->_impl_.pid_ = from._impl_.pid_;
1201 }
1202 if (cached_has_bits & 0x00000040u) {
1203 _this->_impl_.allocation_scope_ = from._impl_.allocation_scope_;
1204 }
1205 if (cached_has_bits & 0x00000080u) {
1206 _this->_impl_.caller_iid_ = from._impl_.caller_iid_;
1207 }
1208 _this->_impl_._has_bits_[0] |= cached_has_bits;
1209 }
1210 if (cached_has_bits & 0x00001f00u) {
1211 if (cached_has_bits & 0x00000100u) {
1212 _this->_impl_.device_ = from._impl_.device_;
1213 }
1214 if (cached_has_bits & 0x00000200u) {
1215 _this->_impl_.device_memory_ = from._impl_.device_memory_;
1216 }
1217 if (cached_has_bits & 0x00000400u) {
1218 _this->_impl_.memory_type_ = from._impl_.memory_type_;
1219 }
1220 if (cached_has_bits & 0x00000800u) {
1221 _this->_impl_.heap_ = from._impl_.heap_;
1222 }
1223 if (cached_has_bits & 0x00001000u) {
1224 _this->_impl_.object_handle_ = from._impl_.object_handle_;
1225 }
1226 _this->_impl_._has_bits_[0] |= cached_has_bits;
1227 }
1228 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1229 }
1230
CopyFrom(const VulkanMemoryEvent & from)1231 void VulkanMemoryEvent::CopyFrom(const VulkanMemoryEvent& from) {
1232 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.VulkanMemoryEvent)
1233 if (&from == this) return;
1234 Clear();
1235 MergeFrom(from);
1236 }
1237
IsInitialized() const1238 bool VulkanMemoryEvent::IsInitialized() const {
1239 return true;
1240 }
1241
InternalSwap(VulkanMemoryEvent * other)1242 void VulkanMemoryEvent::InternalSwap(VulkanMemoryEvent* other) {
1243 using std::swap;
1244 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1245 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1246 _impl_.annotations_.InternalSwap(&other->_impl_.annotations_);
1247 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1248 PROTOBUF_FIELD_OFFSET(VulkanMemoryEvent, _impl_.object_handle_)
1249 + sizeof(VulkanMemoryEvent::_impl_.object_handle_) // NOLINT
1250 - PROTOBUF_FIELD_OFFSET(VulkanMemoryEvent, _impl_.source_)>(
1251 reinterpret_cast<char*>(&_impl_.source_),
1252 reinterpret_cast<char*>(&other->_impl_.source_));
1253 }
1254
GetTypeName() const1255 std::string VulkanMemoryEvent::GetTypeName() const {
1256 return "perfetto.protos.VulkanMemoryEvent";
1257 }
1258
1259
1260 // @@protoc_insertion_point(namespace_scope)
1261 } // namespace protos
1262 } // namespace perfetto
1263 PROTOBUF_NAMESPACE_OPEN
1264 template<> PROTOBUF_NOINLINE ::perfetto::protos::VulkanMemoryEventAnnotation*
CreateMaybeMessage(Arena * arena)1265 Arena::CreateMaybeMessage< ::perfetto::protos::VulkanMemoryEventAnnotation >(Arena* arena) {
1266 return Arena::CreateMessageInternal< ::perfetto::protos::VulkanMemoryEventAnnotation >(arena);
1267 }
1268 template<> PROTOBUF_NOINLINE ::perfetto::protos::VulkanMemoryEvent*
CreateMaybeMessage(Arena * arena)1269 Arena::CreateMaybeMessage< ::perfetto::protos::VulkanMemoryEvent >(Arena* arena) {
1270 return Arena::CreateMessageInternal< ::perfetto::protos::VulkanMemoryEvent >(arena);
1271 }
1272 PROTOBUF_NAMESPACE_CLOSE
1273
1274 // @@protoc_insertion_point(global_scope)
1275 #include <google/protobuf/port_undef.inc>
1276