1 /**************************************************************************
3 * Copyright 2013-2014 RAD Game Tools and Valve Software
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 **************************************************************************/
26 #ifndef VOGL_TRACE_PACKET_H
27 #define VOGL_TRACE_PACKET_H
29 #include "vogl_core.h"
30 #include "vogl_data_stream.h"
31 #include "vogl_value.h"
32 #include "vogl_console.h"
34 #include "vogl_trace_stream_types.h"
35 #include "vogl_common.h"
36 #include "vogl_blob_manager.h"
38 #include "TypeTraits.h"
40 //----------------------------------------------------------------------------------------------------------------------
41 // class vogl_client_memory_array
42 //----------------------------------------------------------------------------------------------------------------------
43 class vogl_client_memory_array
46 inline vogl_client_memory_array(vogl_ctype_t element_ctype, const void *p, uint element_size, uint num_elements)
47 : m_element_ctype(element_ctype), m_pPtr(static_cast<const uint8 *>(p)), m_element_size(element_size), m_num_elements(num_elements)
52 inline vogl_ctype_t get_element_ctype() const
54 return m_element_ctype;
57 inline const void *get_ptr() const
63 inline const T *get_value_ptr() const
65 return reinterpret_cast<const T *>(m_pPtr);
68 inline uint size() const
70 return m_num_elements;
72 inline uint get_element_size() const
74 return m_element_size;
76 inline uint get_size_in_bytes() const
78 return m_element_size * m_num_elements;
82 inline T get_element(uint index) const
86 VOGL_ASSERT(index < m_num_elements);
88 if ((!m_pPtr) || (!m_num_elements))
91 utils::zero_object(result);
95 uint n = math::minimum<uint>(sizeof(T), m_element_size);
97 utils::zero_object(result);
98 memcpy(&result, m_pPtr + m_element_size * index, n);
103 vogl_ctype_t m_element_ctype;
110 //----------------------------------------------------------------------------------------------------------------------
111 // class vogl_trace_packet
112 // Keep this in sync with class vogl_entrypoint_serializer
113 // This object is somewhat expensive to construct - so keep it around!
114 //----------------------------------------------------------------------------------------------------------------------
115 class vogl_trace_packet
118 inline vogl_trace_packet(const vogl_ctypes *pCtypes)
119 : m_pCTypes(pCtypes),
121 m_has_return_value(false),
126 VOGL_ASSUME(VOGL_INVALID_CTYPE == 0);
128 utils::zero_object(m_packet);
138 // reset() tries its best to not free any memory.
145 m_has_return_value = false;
147 utils::zero_object(m_packet);
151 utils::zero_object(m_param_ctype);
152 utils::zero_object(m_param_data);
153 utils::zero_object(m_param_size);
155 for (uint i = 0; i < cMaxParams; i++)
156 m_client_memory_descs[i].clear();
158 m_client_memory.resize(0);
159 m_key_value_map.reset();
162 void set_ctypes(const vogl_ctypes *pCtypes)
169 const vogl_ctypes *get_ctypes() const
176 bool compare(const vogl_trace_packet &other, bool deep) const;
180 bool pretty_print(dynamic_string &str, bool type_info) const;
182 // serialization/deserialization
183 bool serialize(data_stream &stream) const;
184 bool serialize(uint8_vec &buf) const;
186 bool deserialize(const uint8 *pPacket_data, uint packet_data_buf_size, bool check_crc);
187 bool deserialize(const uint8_vec &packet_buf, bool check_crc);
189 class json_serialize_params
192 json_serialize_params()
203 m_pBlob_manager = NULL;
205 m_blob_file_size_threshold = 2048;
206 m_write_debug_info = false;
209 dynamic_string m_output_basename;
210 vogl_blob_manager *m_pBlob_manager;
213 uint m_blob_file_size_threshold;
214 bool m_write_debug_info;
217 bool json_serialize(json_node &node, const json_serialize_params ¶ms) const;
219 // pDocument_filename is used to print context of warnings/errors
220 bool json_deserialize(const json_node &node, const char *pDocument_filename, const vogl_blob_manager *pBlob_manager);
222 inline const vogl_trace_gl_entrypoint_packet &get_entrypoint_packet() const
226 inline vogl_trace_gl_entrypoint_packet &get_entrypoint_packet()
231 inline gl_entrypoint_id_t get_entrypoint_id() const
233 return static_cast<gl_entrypoint_id_t>(m_packet.m_entrypoint_id);
235 inline const gl_entrypoint_desc_t &get_entrypoint_desc() const
237 return g_vogl_entrypoint_descs[m_packet.m_entrypoint_id];
240 inline uint64_t get_context_handle() const
242 return m_packet.m_context_handle;
244 inline uint64_t get_call_counter() const
246 return m_packet.m_call_counter;
248 inline uint64_t get_thread_id() const
250 return m_packet.m_thread_id;
253 inline bool is_valid() const
257 inline uint total_params() const
259 return m_total_params;
261 inline bool has_return_value() const
263 return m_has_return_value;
266 inline const key_value_map &get_key_value_map() const
268 return m_key_value_map;
270 inline key_value_map &get_key_value_map()
272 return m_key_value_map;
275 // packet construction
276 inline void begin_construction(gl_entrypoint_id_t id, uint64_t context_handle, uint64_t call_counter, uint64_t thread_id, uint64_t begin_rdtsc)
280 VOGL_ASSERT(id < VOGL_NUM_ENTRYPOINTS);
283 m_has_return_value = false;
285 VOGL_ASSUME(VOGL_INVALID_CTYPE == 0);
286 utils::zero_object(m_param_ctype);
288 const uint total_params_to_serialize = g_vogl_entrypoint_descs[id].m_num_params + (g_vogl_entrypoint_descs[id].m_return_ctype != VOGL_VOID);
289 for (uint i = 0; i < total_params_to_serialize; ++i)
290 m_client_memory_descs[i].clear();
292 m_client_memory.resize(0);
293 m_key_value_map.reset();
297 m_packet.m_packet_begin_rdtsc = begin_rdtsc;
298 m_packet.m_entrypoint_id = id;
299 m_packet.m_context_handle = context_handle;
300 m_packet.m_call_counter = call_counter;
301 m_packet.m_thread_id = thread_id;
302 m_packet.m_backtrace_hash_index = 0;
307 inline void set_begin_rdtsc(uint64_t val)
309 m_packet.m_packet_begin_rdtsc = val;
312 inline void set_gl_begin_rdtsc(uint64_t val)
314 m_packet.m_gl_begin_rdtsc = val;
316 inline void set_gl_end_rdtsc(uint64_t val)
318 m_packet.m_gl_end_rdtsc = val;
321 inline void set_backtrace_hash_index(uint32 hash_index)
323 m_packet.m_backtrace_hash_index = hash_index;
325 inline uint32 get_backtrace_hash_index() const
327 return m_packet.m_backtrace_hash_index;
330 inline void end_construction(uint64_t end_rdtsc)
334 VOGL_ASSERT(m_is_valid);
335 VOGL_ASSERT(m_total_params == get_entrypoint_desc().m_num_params);
336 VOGL_ASSERT(m_has_return_value == (get_entrypoint_desc().m_return_ctype != VOGL_VOID));
338 m_packet.m_packet_end_rdtsc = end_rdtsc;
342 inline void set_return_param(vogl_ctype_t ctype, const void *pParam, uint param_size)
346 VOGL_ASSERT(m_is_valid);
347 VOGL_ASSERT(ctype != VOGL_INVALID_CTYPE);
348 VOGL_ASSERT((uint)trace_ctypes()[ctype].m_size == param_size);
349 VOGL_ASSERT((param_size >= sizeof(uint8)) && (param_size <= sizeof(uint64_t)));
350 VOGL_ASSERT(g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_return_ctype == ctype);
352 uint param_index = g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_num_params;
353 memcpy(&m_param_data[param_index], pParam, param_size);
354 m_param_ctype[param_index] = ctype;
355 m_param_size[param_index] = static_cast<uint8>(param_size);
357 m_has_return_value = true;
360 inline void set_param(uint8_t param_id, vogl_ctype_t ctype, const void *pParam, uint param_size)
364 if (param_id == VOGL_RETURN_PARAM_INDEX)
366 set_return_param(ctype, pParam, param_size);
370 VOGL_ASSERT(m_is_valid);
371 VOGL_ASSERT(ctype != VOGL_INVALID_CTYPE);
372 VOGL_ASSERT(param_id < g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_num_params);
373 VOGL_ASSERT(g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_num_params < cMaxParams);
374 VOGL_ASSERT((uint)trace_ctypes()[ctype].m_size == param_size);
375 VOGL_ASSERT((param_size >= sizeof(uint8)) && (param_size <= sizeof(uint64_t)));
376 VOGL_ASSERT(g_vogl_entrypoint_param_descs[m_packet.m_entrypoint_id][param_id].m_ctype == ctype);
378 m_total_params += (m_param_ctype[param_id] == VOGL_INVALID_CTYPE);
379 VOGL_ASSERT(m_total_params <= g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_num_params);
381 memcpy(&m_param_data[param_id], pParam, param_size);
382 m_param_ctype[param_id] = ctype;
383 m_param_size[param_id] = static_cast<uint8>(param_size);
386 inline void set_array_client_memory(uint8_t param_id, vogl_ctype_t pointee_ctype, uint64_t array_size, const void *pData, uint64_t data_size)
390 VOGL_NOTE_UNUSED(array_size);
392 VOGL_ASSERT(m_is_valid);
393 //VOGL_ASSERT(param_id <= cUINT8_MAX);
394 VOGL_ASSERT(static_cast<int>(pointee_ctype) <= cUINT8_MAX);
395 if (trace_ctypes()[pointee_ctype].m_size > 0)
397 VOGL_ASSERT((data_size % trace_ctypes()[pointee_ctype].m_size) == 0);
399 if (data_size >= static_cast<uint64_t>(cINT32_MAX))
401 VOGL_FAIL("vogl_entrypoint_serializer::add_param_client_memory: Need to support streaming more than 2GB of client memory per call!\n");
404 uint param_index = param_id;
405 if (param_id == VOGL_RETURN_PARAM_INDEX)
407 VOGL_ASSERT(trace_ctypes()[g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_return_ctype].m_is_pointer);
408 param_index = g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_num_params;
412 VOGL_ASSERT(trace_ctypes()[g_vogl_entrypoint_param_descs[m_packet.m_entrypoint_id][param_id].m_ctype].m_is_pointer);
415 uint32 data_size32 = static_cast<uint32>(data_size);
417 m_client_memory_descs[param_index].m_pointee_ctype = pointee_ctype;
419 if ((m_client_memory_descs[param_index].m_vec_ofs >= 0) && (data_size32 <= m_client_memory_descs[param_index].m_data_size))
421 memcpy(&m_client_memory[m_client_memory_descs[param_index].m_vec_ofs], pData, static_cast<size_t>(data_size));
425 m_client_memory_descs[param_index].m_vec_ofs = m_client_memory.size();
426 m_client_memory_descs[param_index].m_data_size = data_size32;
427 m_client_memory.append(static_cast<const uint8 *>(pData), data_size32);
431 inline void set_ref_client_memory(uint8_t param_id, vogl_ctype_t pointee_ctype, const void *pData, uint64_t data_size)
435 set_array_client_memory(param_id, pointee_ctype, 1U, pData, data_size);
438 inline bool set_key_value(const value &key, const value &value)
442 VOGL_ASSERT(m_is_valid);
443 return m_key_value_map.insert(key, value).second;
446 // ownership of blob's buffer is taken
447 inline bool set_key_value_blob_take_ownership(const value &key, uint8_vec &blob)
451 VOGL_ASSERT(m_is_valid);
452 value_to_value_hash_map::insert_result res(m_key_value_map.insert(key, value()));
453 (res.first)->second.set_blob_take_ownership(blob);
457 inline bool set_key_value_blob(const value &key, const void *pData, uint data_size)
461 VOGL_ASSERT(m_is_valid);
462 value_to_value_hash_map::insert_result res(m_key_value_map.insert(key, value()));
463 (res.first)->second.set_blob(static_cast<const uint8 *>(pData), data_size);
467 inline bool set_key_value_json_document(const value &key, const json_document &doc)
471 VOGL_ASSERT(m_is_valid);
472 value_to_value_hash_map::insert_result res(m_key_value_map.insert(key, value()));
473 (res.first)->second.set_json_document(doc);
478 inline const uint64_t &get_param_data(uint param_index) const
480 VOGL_ASSERT(param_index < m_total_params);
481 return m_param_data[param_index];
483 inline uint get_param_size(uint param_index) const
485 VOGL_ASSERT(param_index < m_total_params);
486 return m_param_size[param_index];
488 inline vogl_ctype_t get_param_ctype(uint param_index) const
490 VOGL_ASSERT(param_index < m_total_params);
491 return m_param_ctype[param_index];
493 inline const gl_entrypoint_param_desc_t &get_param_desc(uint param_index) const
495 VOGL_ASSERT(param_index < m_total_params);
496 return g_vogl_entrypoint_param_descs[m_packet.m_entrypoint_id][param_index];
498 inline const vogl_ctype_desc_t &get_param_ctype_desc(uint param_index) const
500 VOGL_ASSERT(param_index < m_total_params);
501 return trace_ctypes()[m_param_ctype[param_index]];
503 inline vogl_namespace_t get_param_namespace(uint param_index) const
505 return get_param_desc(param_index).m_namespace;
508 // It's acceptable to call this on params which have sizeof's less than T, the upper bytes are 0's.
509 template <typename T>
510 inline T get_param_value(uint param_index) const
514 VOGL_ASSERT(sizeof(T) <= sizeof(uint64_t));
515 VOGL_ASSUME(!Loki::type_is_ptr<T>::result);
516 VOGL_ASSERT(sizeof(T) >= static_cast<uint>(get_param_ctype_desc(param_index).m_size));
517 VOGL_ASSERT(!get_param_ctype_desc(param_index).m_is_pointer);
519 if (sizeof(T) != get_param_size(param_index))
521 if (!validate_value_conversion(sizeof(T), Loki::TypeTraits<T>::typeFlags, param_index))
523 console::warning("%s: Parameter value conversion of call counter %llu func %s parameter \"%s %s\" to dest type size %u will fail, size %u value=0x%08llx\n", VOGL_METHOD_NAME,
524 (unsigned long long)m_packet.m_call_counter,
525 get_entrypoint_desc().m_pName,
526 get_param_ctype_desc(param_index).m_pName, get_param_desc(param_index).m_pName,
528 get_param_size(param_index),
529 (unsigned long long)get_param_data(param_index));
533 return *reinterpret_cast<const T *>(&get_param_data(param_index));
536 inline vogl_trace_ptr_value get_param_ptr_value(uint param_index) const
540 VOGL_ASSUME(sizeof(vogl_trace_ptr_value) <= sizeof(uint64_t));
541 VOGL_ASSERT(get_param_ctype_desc(param_index).m_is_pointer);
542 return *reinterpret_cast<const vogl_trace_ptr_value *>(&get_param_data(param_index));
545 // Returns cInvalidIndex if not found
546 inline int find_param_index(const char *pName) const
550 const gl_entrypoint_param_desc_t *pParams = &g_vogl_entrypoint_param_descs[m_packet.m_entrypoint_id][0];
551 VOGL_ASSERT(g_vogl_entrypoint_descs[m_packet.m_entrypoint_id].m_num_params == m_total_params);
553 for (uint i = 0; i < m_total_params; i++)
554 if (vogl_strcmp(pName, pParams->m_pName) == 0)
557 return cInvalidIndex;
560 bool pretty_print_param(dynamic_string &str, uint param_index, bool type_info) const;
561 bool pretty_print_return_value(dynamic_string &str, bool type_info) const;
564 inline const uint64_t &get_return_value_data() const
566 VOGL_ASSERT(m_has_return_value);
567 return m_param_data[m_total_params];
569 inline uint get_return_value_size() const
571 VOGL_ASSERT(m_has_return_value);
572 return m_param_size[m_total_params];
574 inline vogl_ctype_t get_return_value_ctype() const
576 VOGL_ASSERT(m_has_return_value);
577 return m_param_ctype[m_total_params];
579 inline const vogl_ctype_desc_t &get_return_value_ctype_desc() const
581 return trace_ctypes()[get_return_value_ctype()];
583 inline vogl_namespace_t get_return_value_namespace() const
585 return get_entrypoint_desc().m_return_namespace;
588 // It's acceptable to call this on params which have sizeof's less than T, the upper bytes are 0's.
589 template <typename T>
590 inline T get_return_value() const
594 VOGL_ASSERT(sizeof(T) <= sizeof(uint64_t));
595 VOGL_ASSUME(!Loki::type_is_ptr<T>::result);
596 VOGL_ASSERT(sizeof(T) >= static_cast<uint>(get_return_value_ctype_desc().m_size));
597 VOGL_ASSERT(!get_return_value_ctype_desc().m_is_pointer);
599 if (sizeof(T) != get_return_value_size())
601 if (!validate_value_conversion(sizeof(T), Loki::TypeTraits<T>::typeFlags, -1))
603 console::warning("%s: Return value conversion of call counter %llu func %s return value type \"%s\" to dest type size %u will fail, size %u value=0x%08llx\n", VOGL_METHOD_NAME,
604 (unsigned long long)m_packet.m_call_counter,
605 get_entrypoint_desc().m_pName,
606 get_return_value_ctype_desc().m_pName,
608 get_return_value_size(),
609 (unsigned long long)get_return_value_data());
613 return *reinterpret_cast<const T *>(&get_return_value_data());
616 inline vogl_trace_ptr_value get_return_ptr_value() const
620 VOGL_ASSUME(sizeof(vogl_trace_ptr_value) <= sizeof(uint64_t));
621 VOGL_ASSERT(get_return_value_ctype_desc().m_is_pointer);
622 return *reinterpret_cast<const vogl_trace_ptr_value *>(&get_return_value_data());
625 // param client memory accessors
626 inline bool has_param_client_memory(uint param_index) const
628 VOGL_ASSERT(param_index < m_total_params);
629 return m_client_memory_descs[param_index].m_vec_ofs != -1;
631 inline const void *get_param_client_memory_ptr(uint param_index) const
633 VOGL_ASSERT(param_index < m_total_params);
634 int ofs = m_client_memory_descs[param_index].m_vec_ofs;
635 return (ofs < 0) ? NULL : &m_client_memory[ofs];
637 inline void *get_param_client_memory_ptr(uint param_index)
639 VOGL_ASSERT(param_index < m_total_params);
640 int ofs = m_client_memory_descs[param_index].m_vec_ofs;
641 return (ofs < 0) ? NULL : &m_client_memory[ofs];
643 inline uint get_param_client_memory_data_size(uint param_index) const
645 VOGL_ASSERT(param_index < m_total_params);
646 return m_client_memory_descs[param_index].m_data_size;
648 inline vogl_ctype_t get_param_client_memory_ctype(uint param_index) const
650 VOGL_ASSERT(param_index < m_total_params);
651 return static_cast<vogl_ctype_t>(m_client_memory_descs[param_index].m_pointee_ctype);
653 inline const vogl_ctype_desc_t &get_param_client_memory_ctype_desc(uint param_index) const
655 return trace_ctypes()[get_param_client_memory_ctype(param_index)];
658 template <typename T>
659 inline const T *get_param_client_memory(uint param_index) const
663 VOGL_ASSUME(!Loki::type_is_ptr<T>::result);
664 return static_cast<const T *>(get_param_client_memory_ptr(param_index));
667 template <typename T>
668 inline T *get_param_client_memory(uint param_index)
672 VOGL_ASSUME(!Loki::type_is_ptr<T>::result);
673 return static_cast<T *>(get_param_client_memory_ptr(param_index));
676 inline const vogl_client_memory_array get_param_client_memory_array(uint param_index) const
680 const vogl_ctype_desc_t &ctype_desc = get_param_client_memory_ctype_desc(param_index);
681 uint element_size = ctype_desc.m_size;
682 uint data_size = get_param_client_memory_data_size(param_index);
683 if (element_size <= 0)
684 return vogl_client_memory_array(get_param_client_memory_ctype(param_index), get_param_client_memory_ptr(param_index), data_size, 1);
687 VOGL_ASSERT((data_size % element_size) == 0);
688 return vogl_client_memory_array(get_param_client_memory_ctype(param_index), get_param_client_memory_ptr(param_index), element_size, data_size / element_size);
692 // return client memory accessors
693 inline bool has_return_client_memory() const
695 VOGL_ASSERT(m_has_return_value);
696 return m_client_memory_descs[m_total_params].m_vec_ofs != -1;
698 inline const void *get_return_client_memory_ptr() const
700 VOGL_ASSERT(m_has_return_value);
701 int ofs = m_client_memory_descs[m_total_params].m_vec_ofs;
702 return (ofs < 0) ? NULL : &m_client_memory[ofs];
704 inline int get_return_client_memory_data_size() const
706 VOGL_ASSERT(m_has_return_value);
707 return m_client_memory_descs[m_total_params].m_data_size;
709 inline vogl_ctype_t get_return_client_memory_ctype() const
711 VOGL_ASSERT(m_has_return_value);
712 return static_cast<vogl_ctype_t>(m_client_memory_descs[m_total_params].m_pointee_ctype);
714 inline const vogl_ctype_desc_t &get_return_client_memory_ctype_desc() const
716 return trace_ctypes()[get_return_client_memory_ctype()];
719 inline const vogl_client_memory_array get_return_client_memory_array() const
723 const vogl_ctype_desc_t &ctype_desc = get_return_client_memory_ctype_desc();
724 uint element_size = ctype_desc.m_size;
725 uint data_size = get_return_client_memory_data_size();
726 if (element_size <= 0)
727 return vogl_client_memory_array(get_return_client_memory_ctype(), get_return_client_memory_ptr(), data_size, 1);
730 VOGL_ASSERT((data_size % element_size) == 0);
731 return vogl_client_memory_array(get_return_client_memory_ctype(), get_return_client_memory_ptr(), element_size, data_size / element_size);
736 const vogl_ctypes *m_pCTypes;
738 inline const vogl_ctypes &trace_ctypes() const
743 // the "_size" fields in m_packet are not valid until binary serialization
744 vogl_trace_gl_entrypoint_packet m_packet;
747 bool m_has_return_value;
754 uint64_t m_param_data[cMaxParams];
755 uint8 m_param_size[cMaxParams];
756 vogl_ctype_t m_param_ctype[cMaxParams];
758 uint8_vec m_client_memory;
760 key_value_map m_key_value_map;
764 struct client_memory_desc_t
768 uint8 m_pointee_ctype; // vogl_ctype_t
774 m_pointee_ctype = VOGL_VOID;
779 client_memory_desc_t m_client_memory_descs[cMaxParams];
781 mutable uint8_vec m_packet_buf;
783 bool validate_value_conversion(uint dest_type_size, uint dest_type_loki_type_flags, int param_index) const;
785 static bool should_always_write_as_blob_file(const char *pFunc_name);
787 void ctype_to_json_value(json_value &val, gl_entrypoint_id_t entrypoint_id, int param_index, uint64_t data, vogl_ctype_t ctype) const;
789 bool json_serialize_param(
790 const char *pFunc_name,
791 json_node &gl_params_node, int param_index, const char *pName, const uint64_t param_data, const uint param_size, vogl_ctype_t param_ctype,
792 const void *pClient_mem, uint client_mem_size, vogl_ctype_t client_mem_ctype,
793 const json_serialize_params ¶ms) const;
795 bool convert_json_value_to_ctype_data(uint64_t &data, const json_value &val, vogl_ctype_t ctype, const char *pName, int param_iter, gl_entrypoint_param_class_t param_class, bool permit_client_strings, const json_node &node, const char *pDocument_filename);
797 bool json_deserialize_param(
798 uint64_t cur_call_counter, const char *pFunc_name,
799 const json_node ¶ms_node, uint param_iter, const char *pParam_name, gl_entrypoint_param_class_t param_class, const vogl_ctype_desc_t ¶m_ctype_desc,
800 const char *pDocument_filename, const vogl_blob_manager *pBlob_manager);
802 static bool get_uint64_from_json_node(const json_node &node, const char *pKey, uint64_t &val, uint64_t def = 0);
804 static bool force_value_to_type(value &val, value_data_type type);
806 bool fixup_manually_edited_params(gl_entrypoint_id_t gl_entrypoint_id, const char *pGL_func_name, uint64_t cur_call_counter);
809 bool vogl_does_packet_refer_to_program(const vogl_trace_packet &gl_packet, GLuint &program);
810 bool vogl_write_glInternalTraceCommandRAD(data_stream &stream, const vogl_ctypes *pCTypes, GLuint cmd, GLuint size, const GLubyte *data);
812 #endif // VOGL_TRACE_PACKET_H