Home | History | Annotate | Download | only in vulkan-validation-layers

Lines Matching full:struct_dict

67 # struct_dict['struct_basename'] = the base (non-typedef'd) name of the struct
78 struct_dict = {}
101 self.struct_dict = {}
117 return self.struct_dict
200 del self.struct_dict['tmp_struct']
203 self.struct_dict[base_type] = self.struct_dict['tmp_struct']
204 self.struct_dict.pop('tmp_struct', 0)
298 if not struct_type in self.struct_dict:
299 self.struct_dict[struct_type] = {}
307 self.struct_dict[struct_type][num] = {}
308 self.struct_dict[struct_type][num]['full_type'] = member_type
309 self.struct_dict[struct_type][num]['dyn_array'] = False
311 self.struct_dict[struct_type][num]['ptr'] = True
316 self.struct_dict[struct_type][num]['ptr'] = False
318 self.struct_dict[struct_type][num]['const'] = True
321 self.struct_dict[struct_type][num]['const'] = False
325 self.struct_dict[struct_type][num]['struct'] = True
327 self.struct_dict[struct_type][num]['struct'] = False
328 self.struct_dict[struct_type][num]['type'] = member_type
332 # self.struct_dict[struct_type][num]['array'] = False
333 # self.struct_dict[struct_type][num]['array_size'] = 0
334 # self.struct_dict[struct_type][num]['ptr'] = True
336 self.struct_dict[struct_type][num]['array'] = True
337 self.struct_dict[struct_type][num]['array_size'] = array_size.strip(']')
338 elif self._is_dynamic_array(self.struct_dict[struct_type][num]['full_type'], member_name):
340 self.struct_dict[struct_type][num]['array'] = True
341 self.struct_dict[struct_type][num]['dyn_array'] = True
342 self.struct_dict[struct_type][num]['array_size'] = self.last_struct_count_name
343 elif not 'array' in self.struct_dict[struct_type][num]:
344 self.struct_dict[struct_type][num]['array'] = False
345 self.struct_dict[struct_type][num]['array_size'] = 0
346 self.struct_dict[struct_type][num]['name'] = member_name
360 for struct_name in struct_dict:
362 for mem_num in sorted(struct_dict[struct_name]):
364 if struct_dict[struct_name][mem_num]['const']:
366 #if struct_dict[struct_name][mem_num]['struct']:
368 sys.stdout.write (struct_dict[struct_name][mem_num]['type'])
369 if struct_dict[struct_name][mem_num]['ptr']:
372 sys.stdout.write(struct_dict[struct_name][mem_num]['name'])
373 if struct_dict[struct_name][mem_num]['array']:
375 sys.stdout.write(struct_dict[struct_name][mem_num]['array_size'])
446 self.struct_dict = in_struct_dict
615 for s in sorted(self.struct_dict):
643 if struct_name not in self.struct_dict:
735 for s in sorted(self.struct_dict):
744 for s in sorted(self.struct_dict):
749 for m in sorted(self.struct_dict[s]):
750 if 'pNext' == self.struct_dict[s][m]['name'] or is_type(self.struct_dict[s][m]['type'], 'struct'):
751 stp_list.append(self.struct_dict[s][m])
814 for m in sorted(self.struct_dict[s]):
815 (p_out1, p_args1) = self._get_struct_print_formatted(self.struct_dict[s][m])
843 if struct_name not in self.struct_dict:
876 for s in sorted(self.struct_dict):
889 for s in sorted(self.struct_dict):
890 num_non_enum_elems = [(is_type(self.struct_dict[s][elem]['type'], 'enum') and not self.struct_dict[s][elem]['ptr']) for elem in self.struct_dict[s]].count(False)
893 for m in sorted(self.struct_dict[s]):
894 if 'pNext' == self.struct_dictstruct_dict[s][m]['type'], 'struct') or self.struct_dict[s][m]['array']:
896 if 'ppActiveLayerNames' not in self.struct_dict[s][m]['name']:
897 stp_list.append(self.struct_dict[s][m])
968 #value_print = 'string_%s(%spStruct->%s)' % (self.struct_dict[s][m]['type'], deref, self.struct_dict[s][m]['name'])
1040 for m in sorted(self.struct_dict[s]):
1041 if not is_type(self.struct_dict[s][m]['type'], 'enum'):
1042 if is_type(self.struct_dict[s][m]['type'], 'struct') and not self.struct_dict[s][m]['ptr']:
1048 sh_funcs.append(' ss[%u] << &pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1049 elif self.struct_dict[s][m]['array']:
1051 sh_funcs.append(' ss[%u] << (void*)pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1052 elif 'bool' in self.struct_dict[s][m]['type'].lower():
1054 sh_funcs.append(' ss[%u].str(pStruct->%s ? "TRUE" : "FALSE");' % (index, self.struct_dict[s][m]['name']))
1055 elif 'uint8' in self.struct_dict[s][m]['type'].lower():
1057 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1058 elif 'void' in self.struct_dict[s][m]['type'].lower() and self.struct_dict[s][m]['ptr']:
1061 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1064 elif 'char' in self.struct_dict[s][m]['type'].lower() and self.struct_dict[s][m]['ptr']:
1066 sh_funcs.append(' if (pStruct->%s != NULL) {' % self.struct_dict[s][m]['name'])
1067 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1073 (po, pa) = self._get_struct_print_formatted(self.struct_dict[s][m])
1074 if "addr" in po: # or self.struct_dict[s][m]['ptr']:
1076 elif not self.struct_dict[s][m]['ptr'] and self.struct_dict[s][m]['type'] in vulkan.core.objects:
1077 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1079 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1084 if self.struct_dict[s][m]['ptr']:
1086 sh_funcs.append(' if (pStruct->%s)' % (self.struct_dict[s][m]['name']))
1087 sh_funcs.append(' ss[%u] << pStruct->%s << " (See individual array values below)";' % (index, self.struct_dict[s][m]['name']))
1094 value_print = 'string_%s(pStruct->%s)' % (self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name'])
1095 final_str += ' + prefix + "%s = " + %s + "\\n"' % (self.struct_dict[s][m]['name'], value_print)
1145 if struct_name not in self.struct_dict:
1161 (p_out, p_arg) = self._get_struct_print_formatted(self.struct_dict[s][member], pre_var_name="&m_dummy_prefix", struct_var_name="m_struct", struct_ptr=False, print_array=True)
1165 if is_type(self.struct_dict[s][member]['type'], 'struct'): # print struct address for now
1166 struct_array.insert(0, self.struct_dict[s][member])
1167 elif self.struct_dict[s][member]['ptr']:
1169 if "void" in self.struct_dict[s][member]['type'] and "pNext" == self.struct_dict[s][member]['name']:
1170 struct_array.insert(0, self.struct_dict[s][member])
1185 for member in sorted(self.struct_dict[s]):
1190 if self.struct_dict[s][member]['array']:
1195 disp_def.append(' for (i = 0; i<%s; i++) {' % self.struct_dict[s][member]['array_size'])
1307 for s in sorted(self.struct_dict):
1319 for s in sorted(self.struct_dict):
1327 for m in sorted(self.struct_dict[s]):
1329 if is_type(self.struct_dict[s][m]['type'], 'enum') and not self.struct_dict[s][m]['ptr']:
1330 sh_funcs.append(' if (!validate_%s(pStruct->%s))\n return 0;' % (self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name']))
1332 if is_type(self.struct_dict[s][m]['type'], 'struct'):
1333 if (self.struct_dict[s][m]['ptr']):
1334 sh_funcs.append(' if (pStruct->%s && !%s((const %s*)pStruct->%s))\n return 0;' % (self.struct_dict[s][m]['name'], self._get_vh_func_name(self.struct_dict[s][m]['type']), self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name']))
1336 sh_funcs.append(' if (!%s((const %s*)&pStruct->%s))\n return 0;' % (self._get_vh_func_name(self.struct_dict[s][m]['type']), self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name']))
1366 for s in sorted(self.struct_dict):
1391 for s in sorted(self.struct_dict):
1402 for m in sorted(self.struct_dict[s]):
1405 if self.struct_dict[s][m]['dyn_array']:
1406 if self.struct_dict[s][m]['full_type'].count('*') > 1:
1407 if not is_type(self.struct_dict[s][m]['type'], 'struct') and not 'char' in self.struct_dict[s][m]['type'].lower():
1408 if 'ppMemoryBarriers' == self.struct_dict[s][m]['name']:
1410 sh_funcs.append('%sstructSize += pStruct->%s*(sizeof(%s*) + sizeof(VkImageMemoryBarrier));' % (indent, self.struct_dict[s][m]['array_size'], self.struct_dict[s][m]['type']))
1412 sh_funcs.append('%sstructSize += pStruct->%s*(sizeof(%s*) + sizeof(%s));' % (indent, self.struct_dict[s][m]['array_size'], self.struct_dict[s][m]['type'], self.struct_dict[s][m]['type']))
1417 sh_funcs.append('%sfor (i = 0; i < pStruct->%s; i++) {' % (indent, self.struct_dict[s][m]['array_size']))
1419 if is_type(self.struct_dict[s][m]['type'], 'struct'):
1420 sh_funcs.append('%sstructSize += (sizeof(%s*) + %s(pStruct->%s[i]));' % (indent, self.struct_dict[s][m]['type'], self._get_size_helper_func_name(self.struct_dict[s][m]['type']), self.struct_dict[s][m]['name']))
1422 sh_funcs.append('%sstructSize += (sizeof(char*) + (sizeof(char) * (1 + strlen(pStruct->%s[i]))));' % (indent, self.struct_dict[s][m]['name']))
1426 if is_type(self.struct_dict[s][m]['type'], 'struct'):
1430 sh_funcs.append('%sfor (i = 0; i < pStruct->%s; i++) {' % (indent, self.struct_dict[s][m]['array_size']))
1432 sh_funcs.append('%sstructSize += %s(&pStruct->%s[i]);' % (indent, self._get_size_helper_func_name(self.struct_dict[s][m]['type']), self.struct_dict[s][m]['name']))
1436 sh_funcs.append('%sstructSize += pStruct->%s*sizeof(%s);' % (indent, self.struct_dict[s][m]['array_size'], self.struct_dict[s][m]['type']))
1437 elif self.struct_dict[s][m]['ptr'] and 'pNext' != self.struct_dict[s][m]['name']:
1438 if 'char' in self.struct_dict[s][m]['type'].lower():
1439 sh_funcs.append('%sstructSize += (pStruct->%s != NULL) ? sizeof(%s)*(1+strlen(pStruct->%s)) : 0;' % (indent, self.struct_dict[s][m]['name'], self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name']))
1440 elif is_type(self.struct_dict[s][m]['type'], 'struct'):
1441 sh_funcs.append('%sstructSize += %s(pStruct->%s);' % (indent, self._get_size_helper_func_name(self.struct_dict[s][m]['type']), self.struct_dict[s][m]['name']))
1442 elif 'void' not in self.struct_dict[s][m]['type'].lower():
1443 if (self.struct_dict[s][m]['type'] != 'xcb_connection_t'):
1444 sh_funcs.append('%sstructSize += sizeof(%s);' % (indent, self.struct_dict[s][m]['type']))
1445 elif 'size_t' == self.struct_dict[s][m]['type'].lower():
1446 sh_funcs.append('%sstructSize += pStruct->%s;' % (indent, self.struct_dict[s][m]['name']))
1472 if struct_name not in self.struct_dict:
1539 for member in sorted(self.struct_dict[s]):
1541 if self.struct_dict[s][member]['array']:
1543 get_set.append(" %s get_%s() { return m_struct.%s; }\n" % (self.struct_dict[s][member]['full_type'], self.struct_dict[s][member]['name'], self.struct_dict[s][member]['name']))
1544 if not self.struct_dict[s][member]['const']:
1545 get_set.append(" void set_%s(%s inValue) { m_struct.%s = inValue; }\n" % (self.struct_dict[s][member]['name'], self.struct_dict[s][member]['full_type'], self.struct_dict[s][member]['name']))
1560 for s in sorted(self.struct_dict):
1582 if 'sType' == self.struct_dict[s][0]['name']:
1584 for m in self.struct_dict[s]:
1585 if self.struct_dict[s][m]['ptr']:
1600 for m in self.struct_dict[ty]:
1601 if self.struct_dict[ty][m]['type'] in obj:
1614 for m in sorted(self.struct_dict[s]):
1615 m_type = self.struct_dict[s][m]['type']
1618 if self.struct_dict[s][m]['array_size'] != 0 and not self.struct_dict[s][m]['dyn_array']:
1619 ss_decls.append(" %s %s[%s];" % (m_type, self.struct_dict[s][m]['name'], self.struct_dict[s][m]['array_size']))
1620 elif self.struct_dict[s][m]['ptr'] and 'safe_' not in m_type and not self._typeHasObject(m_type, vulkan.object_non_dispatch_list):#m_type in ['char', 'float', 'uint32_t', 'void', 'VkPhysicalDeviceFeatures']: # We'll never overwrite char* so it can remain const
1621 ss_decls.append(" %s %s;" % (self.struct_dict[s][m]['full_type'], self.struct_dict[s][m]['name']))
1622 elif self.struct_dict[s][m]['array']:
1623 ss_decls.append(" %s* %s;" % (m_type, self.struct_dict[s][m]['name']))
1624 elif self.struct_dict[s][m]['ptr']:
1625 ss_decls.append(" %s* %s;" % (m_type, self.struct_dict[s][m]['name']))
1627 ss_decls.append(" %s %s;" % (m_type, self.struct_dict[s][m]['name']))
1694 for m in self.struct_dict[s]:
1695 m_name = self.struct_dict[s][m]['name']
1696 m_type = self.struct_dict[s][m]['type']
1699 if self.struct_dict[s][m]['ptr'] and 'safe_' not in m_type and not self._typeHasObject(m_type, vulkan.object_non_dispatch_list):# in ['char', 'float', 'uint32_t', 'void', 'VkPhysicalDeviceFeatures']) or 'pp' == self.struct_dict[s][m]['name'][0:1]:
1702 elif self.struct_dict[s][m]['array']:
1707 if is_type(self.struct_dict[s][m]['type'], 'struct') and self._hasSafeStruct(self.struct_dict[s][m]['type']):
1708 array_element = '%s(&pInStruct->%s[i])' % (self._getSafeStructName(self.struct_dict[s][m]['type']), m_name)
1709 construct_txt += ' if (%s && pInStruct->%s) {\n' % (self.struct_dict[s][m]['array_size'], m_name)
1710 construct_txt += ' %s = new %s[%s];\n' % (m_name, m_type, self.struct_dict[s][m]['array_size'])
1713 construct_txt += ' for (uint32_t i=0; i<%s; ++i) {\n' % (self.struct_dict[s][m]['array_size'])
1720 elif self.struct_dict[s][m]['ptr']:
1833 def __init__(self, struct_dict, prefix, out_dir):
1834 self.struct_dict = struct_dict
1931 for s in sorted(self.struct_dict):
1939 struct_dict):
1947 for m in sorted(self.struct_dict[s]):
1948 if 'pNext' == self.struct_dict[s][m]['name'] or is_type(self.struct_dict[s][m]['type'], 'struct'):
1949 stp_list.append(self.struct_dict[s][m])
1950 if 'pNext' == self.struct_dict[s][m]['name']:
1998 for m in sorted(self.struct_dict[s]):
2002 (p_out1, p_args1) = self._get_struct_gv_print_formatted(self.struct_dict[s][m], port_label=plabel)
2030 for m in sorted(self.struct_dict[s]):
2032 (p_out1, p_args1) = self._get_struct_gv_print_formatted(self.struct_dict[s][m], port_label=plabel)
2034 p_out1 = '%s<TD ROWSPAN=\\"%i\\" PORT=\\"slot%%u\\">%%u</TD></TR>' % (p_out1[:-5], len(self.struct_dict[s]))
2059 if struct_name not in self.struct_dict:
2112 global struct_dict
2118 struct_dict = hfp.get_struct_dict()
2125 #print(struct_dict)
2148 #for struct in struct_dict:
2151 sw = StructWrapperGen(struct_dict, os.path.basename(opts.input_file).strip(".h"), os.path.dirname(enum_sh_filename))
2175 st = StructWrapperGen(struct_dict, os.path.basename(opts.input_file).strip(".h"), os.path.dirname(enum_sh_filename))
2183 gv = GraphVizGen(struct_dict, os.path.basename(opts.input_file).strip(".h"), os.path.dirname(enum_sh_filename))