77import os
88import argparse
99import struct
10+ import vkconfig as vk
1011
1112# New functions that we implement
1213fake_functions = [ 'vkAssertBufferARM' , 'vkSyncBufferTRACETOOLTEST' , 'vkGetDeviceTracingObjectPropertyTRACETOOLTEST' ,
@@ -100,14 +101,14 @@ def out(lst, str=''):
100101out ([wrh ], '\t trace_records();' )
101102out ([wrh ])
102103for name in spec .all_handles :
103- out ([wrh ], '\t trace_remap<%s, %s> %s_index;' % (name , util .trackable_type_map_trace .get (name , 'trackable' ), name ))
104+ out ([wrh ], '\t trace_remap<%s, %s> %s_index;' % (name , vk .trackable_type_map_trace .get (name , 'trackable' ), name ))
104105 if name != 'VkDeviceMemory' :
105106 out (targets_read , 'replay_remap<%s> index_to_%s;' % (name , name ))
106107 out (targets_read_headers , 'extern replay_remap<%s> index_to_%s;' % (name , name ))
107108for name in spec .all_handles :
108109 if name != 'VkDeviceMemory' :
109- out (targets_read , 'std::vector<%s> %s_index;' % (util .trackable_type_map_replay .get (name , 'trackable' ), name ))
110- out (targets_read_headers , 'extern std::vector<%s> %s_index;' % (util .trackable_type_map_replay .get (name , 'trackable' ), name ))
110+ out (targets_read , 'std::vector<%s> %s_index;' % (vk .trackable_type_map_replay .get (name , 'trackable' ), name ))
111+ out (targets_read_headers , 'extern std::vector<%s> %s_index;' % (vk .trackable_type_map_replay .get (name , 'trackable' ), name ))
111112
112113out ([wrh , wr ] + targets_read )
113114out ([wrh ], '\t const std::unordered_map<std::string, uint16_t> function_table;' )
@@ -436,7 +437,7 @@ def out(lst, str=''):
436437out (targets_read , '\t {' )
437438idx = 0
438439for f in spec .functions :
439- if f in util .functions_noop or f in spec .disabled_functions or spec .str_contains_vendor (f ):
440+ if f in vk .functions_noop or f in spec .disabled_functions or spec .str_contains_vendor (f ):
440441 out (targets_read , '\t case %d:' % idx )
441442 out (targets_read , '\t \t DLOG3("Attempt to use retrace_getcall on unimplemented function %s with index %d.");' % (f , idx ))
442443 out (targets_read , '\t \t return nullptr;' )
@@ -469,7 +470,7 @@ def out(lst, str=''):
469470for f in spec .functions :
470471 if f in spec .protected_funcs :
471472 out ([wr ], '#ifdef %s' % spec .protected_funcs [f ])
472- if f in util .functions_noop or f in spec .disabled_functions or spec .str_contains_vendor (f ):
473+ if f in vk .functions_noop or f in spec .disabled_functions or spec .str_contains_vendor (f ):
473474 out ([wr ], '\t case %d:' % idx )
474475 out ([wr ], '\t \t DLOG("Attempt to use trace_getcall on unimplemented function %s with index %s.");' % (f , idx ))
475476 out ([wr ], '\t \t return nullptr;' )
@@ -510,9 +511,9 @@ def out(lst, str=''):
510511 out (targets_write , '\t if (instance->records.%s_index.size())' % name )
511512 out (targets_write , '\t {' )
512513 out (targets_write , '\t \t v["%s"] = Json::arrayValue;' % name )
513- out (targets_write , '\t \t for (const %s* data : instance->records.%s_index.iterate())' % (util .trackable_type_map_trace .get (name , 'trackable' ), name ))
514+ out (targets_write , '\t \t for (const %s* data : instance->records.%s_index.iterate())' % (vk .trackable_type_map_trace .get (name , 'trackable' ), name ))
514515 out (targets_write , '\t \t {' )
515- out (targets_write , '\t \t \t Json::Value vv = %s_json(data);' % util .trackable_type_map_trace .get (name , 'trackable' ))
516+ out (targets_write , '\t \t \t Json::Value vv = %s_json(data);' % vk .trackable_type_map_trace .get (name , 'trackable' ))
516517 out (targets_write , '\t \t \t vv["index"] = data->index;' )
517518 out (targets_write , '\t \t \t v["%s"].append(vv);' % name )
518519 out (targets_write , '\t \t }' )
@@ -532,7 +533,7 @@ def out(lst, str=''):
532533 continue
533534 name = v .find ('name' ).text
534535 if spec .str_contains_vendor (name ): continue
535- out (targets_read , '\t if (v.isMember("%s")) for (const auto& i : v["%s"]) %s_index.push_back(%s_json(i));' % (name , name , name , util .trackable_type_map_replay .get (name , 'trackable' )))
536+ out (targets_read , '\t if (v.isMember("%s")) for (const auto& i : v["%s"]) %s_index.push_back(%s_json(i));' % (name , name , name , vk .trackable_type_map_replay .get (name , 'trackable' )))
536537for e in extra_tracked_structs :
537538 out (targets_read , '\t if (v.isMember("%s")) { has_%s = true; read%s(v["%s"], stored_%s); }' % (e , e , e , e , e ))
538539out (targets_read , '}' )
0 commit comments