Lines Matching refs:sh_funcs
755 sh_funcs = []
758 sh_funcs.append('char* %s(const %s* pStruct, const char* prefix);' % (self._get_sh_func_name(s), typedef_fwd_dict[s]))
759 sh_funcs.append('')
760 sh_funcs.append('#if defined(_WIN32)')
761 sh_funcs.append('// Microsoft did not implement C99 in Visual Studio; but started adding it with')
762 sh_funcs.append('// VS2013. However, VS2013 still did not have snprintf(). The following is a')
763 sh_funcs.append('// work-around.')
764 sh_funcs.append('#define snprintf _snprintf')
765 sh_funcs.append('#endif // _WIN32\n')
774 sh_funcs.append('char* %s(const %s* pStruct, const char* prefix)\n{\n char* str;' % (self._get_sh_func_name(s), typedef_fwd_dict[s]))
775 sh_funcs.append(" size_t len;")
779 sh_funcs.append(" char* tmpStr;")
780 sh_funcs.append(' char* extra_indent = (char*)malloc(strlen(prefix) + 3);')
781 sh_funcs.append(' strcpy(extra_indent, " ");')
782 sh_funcs.append(' strncat(extra_indent, prefix, strlen(prefix));')
783 sh_funcs.append(' char* stp_strs[%i];' % num_stps)
792 sh_funcs.append(' if (pStruct->%s) {' % stp_list[index]['name'])
794 sh_funcs.append(' tmpStr = dynamic_display((void*)pStruct->pNext, prefix);')
795 sh_funcs.append(' len = 256+strlen(tmpStr);')
796 sh_funcs.append(' stp_strs[%i] = (char*)malloc(len);' % index)
798 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%spNext (addr)\\n%%s", prefix, tmpStr);' % index)
800 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%spNext (0x%%p)\\n%%s", prefix, (void*)pStruct->pNext, tmpStr);' % index)
801 sh_funcs.append(' free(tmpStr);')
805 sh_funcs.append(' tmpStr = %s(&pStruct->%s[0], extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
807 sh_funcs.append(' tmpStr = %s(pStruct->%s, extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
808 sh_funcs.append(' len = 256+strlen(tmpStr)+strlen(prefix);')
809 sh_funcs.append(' stp_strs[%i] = (char*)malloc(len);' % (index))
811 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%s%s (addr)\\n%%s", prefix, tmpStr);' % (index, stp_list[index]['name']))
813 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%s%s (0x%%p)\\n%%s", prefix, (void*)pStruct->%s, tmpStr);' % (index, stp_list[index]['name'], stp_list[index]['name']))
814 sh_funcs.append(' }')
815 sh_funcs.append(" else\n stp_strs[%i] = \"\";" % (index))
817 sh_funcs.append(' tmpStr = %s(&pStruct->%s[0], extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
818 sh_funcs.append(' len = 256+strlen(tmpStr);')
819 sh_funcs.append(' stp_strs[%i] = (char*)malloc(len);' % (index))
821 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%s%s[0] (addr)\\n%%s", prefix, tmpStr);' % (index, stp_list[index]['name']))
823 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%s%s[0] (0x%%p)\\n%%s", prefix, (void*)&pStruct->%s[0], tmpStr);' % (index, stp_list[index]['name'], stp_list[index]['name']))
825 sh_funcs.append(' tmpStr = %s(&pStruct->%s, extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
826 sh_funcs.append(' len = 256+strlen(tmpStr);')
827 sh_funcs.append(' stp_strs[%i] = (char*)malloc(len);' % (index))
829 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%s%s (addr)\\n%%s", prefix, tmpStr);' % (index, stp_list[index]['name']))
831 sh_funcs.append(' snprintf(stp_strs[%i], len, " %%s%s (0x%%p)\\n%%s", prefix, (void*)&pStruct->%s, tmpStr);' % (index, stp_list[index]['name'], stp_list[index]['name']))
833 sh_funcs.append(' len = %ssizeof(char)*1024;' % (total_strlen_str))
834 sh_funcs.append(' str = (char*)malloc(len);')
835 sh_funcs.append(' snprintf(str, len, "')
842 sh_funcs[-1] = '%s%s%s' % (sh_funcs[-1], p_out, p_args)
844 sh_funcs.append(' for (int32_t stp_index = %i; stp_index >= 0; stp_index--) {' % (num_stps-1))
845 sh_funcs.append(' if (0 < strlen(stp_strs[stp_index])) {')
846 sh_funcs.append(' strncat(str, stp_strs[stp_index], strlen(stp_strs[stp_index]));')
847 sh_funcs.append(' free(stp_strs[stp_index]);')
848 sh_funcs.append(' }')
849 sh_funcs.append(' }')
850 sh_funcs.append(' free(extra_indent);')
851 sh_funcs.append(" return str;\n}")
853 sh_funcs.append("char* dynamic_display(const void* pStruct, const char* prefix)\n{")
854 sh_funcs.append(" // Cast to APP_INFO ptr initially just to pull sType off struct")
855 sh_funcs.append(" if (pStruct == NULL) {")
856 sh_funcs.append(" return NULL;")
857 sh_funcs.append(" }")
858 sh_funcs.append(" VkStructureType sType = ((VkApplicationInfo*)pStruct)->sType;")
859 sh_funcs.append(' char indent[100];\n strcpy(indent, " ");\n strcat(indent, prefix);')
860 sh_funcs.append(" switch (sType)\n {")
868 sh_funcs.append(' case %s:\n {' % (v))
869 sh_funcs.append(' return %s((%s*)pStruct, indent);' % (print_func_name, struct_name))
870 sh_funcs.append(' }')
871 sh_funcs.append(' break;')
872 sh_funcs.append(" default:")
873 sh_funcs.append(" return NULL;")
874 sh_funcs.append(" }")
875 sh_funcs.append("}")
876 return "\n".join(sh_funcs)
885 sh_funcs = []
889 sh_funcs.append('%s' % lineinfo.get())
892 add_platform_wrapper_entry(sh_funcs, typedef_fwd_dict[s])
893 sh_funcs.append('std::string %s(const %s* pStruct, const std::string prefix);' % (self._get_sh_func_name(s), typedef_fwd_dict[s]))
894 add_platform_wrapper_exit(sh_funcs, typedef_fwd_dict[s])
896 sh_funcs.append('\n')
897 sh_funcs.append('%s' % lineinfo.get())
907 sh_funcs.append('%s' % lineinfo.get())
910 sh_funcs, typedef_fwd_dict[s])
912 sh_funcs.append('std::string %s(const %s* pStruct, const std::string prefix)\n{' % (self._get_sh_func_name(s), typedef_fwd_dict[s]))
913 sh_funcs.append('%s' % lineinfo.get())
915 sh_funcs.append('%susing namespace StreamControl;' % (indent))
916 sh_funcs.append('%susing namespace std;' % (indent))
917 sh_funcs.append('%sstring final_str;' % (indent))
918 sh_funcs.append('%sstring tmp_str;' % (indent))
919 sh_funcs.append('%sstring extra_indent = " " + prefix;' % (indent))
921 sh_funcs.append('%sstringstream ss[%u];' % (indent, num_non_enum_elems))
925 sh_funcs.append('%sstring stp_strs[%u];' % (indent, num_stps))
932 sh_funcs.append('%s' % lineinfo.get())
934 sh_funcs.append('%s' % lineinfo.get())
937 sh_funcs.append('%s' % lineinfo.get())
939 sh_funcs.append('%s' % lineinfo.get())
940 sh_funcs.append('%sstp_strs[%u] = "";' % (indent, index))
942 sh_funcs.append('%sstringstream index_ss;' % (indent))
946 sh_funcs.append('%sif (pStruct->imageSharingMode == VK_SHARING_MODE_CONCURRENT) {' % (indent))
948 sh_funcs.append('%sif (pStruct->sharingMode == VK_SHARING_MODE_CONCURRENT) {' % (indent))
951 sh_funcs.append('%sif ((pStruct->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER) ||' % (indent))
952 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) ||' % (indent))
953 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) ||' % (indent))
954 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE)) {' % (indent))
957 sh_funcs.append('%sif ((pStruct->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) ||' % (indent))
958 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) ||' % (indent))
959 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) ||' % (indent))
960 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) {' % (indent))
963 sh_funcs.append('%sif ((pStruct->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) ||' % (indent))
964 sh_funcs.append('%s (pStruct->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)) {' % (indent))
967 sh_funcs.append('%sif (pStruct->%s) {' % (indent, stp_list[index]['name']))
969 sh_funcs.append('%sfor (uint32_t i = 0; i < %s; i++) {' % (indent, array_count))
971 sh_funcs.append('%sindex_ss.str("");' % (indent))
972 sh_funcs.append('%sindex_ss << i;' % (indent))
974 sh_funcs.append('%s' % lineinfo.get())
977 sh_funcs.append('%sss[%u] << string_%s(pStruct->%s[i]);' % (indent, index, stp_list[index]['type'], stp_list[index]['name']))
978 sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] = " + ss[%u].str() + "\\n";' % (indent, index, stp_list[index]['name'], index))
980 sh_funcs.append('%s' % lineinfo.get())
981 sh_funcs.append('%sss[%u] << "0x" << %spStruct->%s[i];' % (indent, index, addr_char, stp_list[index]['name']))
982 sh_funcs.append('%stmp_str = %s(%spStruct->%s[i], extra_indent);' % (indent, self._get_sh_func_name(stp_list[index]['type']), addr_char, stp_list[index]['name']))
984 sh_funcs.append('%s' % lineinfo.get())
985 sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] (addr)\\n" + tmp_str;' % (indent, index, stp_list[index]['name']))
987 sh_funcs.append('%s' % lineinfo.get())
988 sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] (" + ss[%u].str() + ")\\n" + tmp_str;' % (indent, index, stp_list[index]['name'], index))
990 sh_funcs.append('%s' % lineinfo.get())
993 sh_funcs.append('%sss[%u] << "0x" << %spStruct->%s[i];' % (indent, index, addr_char, stp_list[index]['name']))
995 sh_funcs.append('%sss[%u] << %spStruct->%s[i];' % (indent, index, addr_char, stp_list[index]['name']))
997 sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "].handle = " + ss[%u].str() + "\\n";' % (indent, index, stp_list[index]['name'], index))
999 sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] = " + ss[%u].str() + "\\n";' % (indent, index, stp_list[index]['name'], index))
1000 sh_funcs.append('%s' % lineinfo.get())
1001 sh_funcs.append('%sss[%u].str("");' % (indent, index))
1003 sh_funcs.append('%s}' % (indent))
1006 sh_funcs.append('%s}' % (indent))
1010 sh_funcs.append('%s}' % (indent))
1012 sh_funcs.append('%s' % lineinfo.get())
1013 sh_funcs.append('%sif (pStruct->%s) {' % (indent, stp_list[index]['name']))
1016 sh_funcs.append('%s' % lineinfo.get())
1017 sh_funcs.append(' tmp_str = dynamic_display((void*)pStruct->pNext, prefix);')
1021 sh_funcs.append('%s' % lineinfo.get())
1022 sh_funcs.append(' tmp_str = %s(&pStruct->%s[0], extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
1024 sh_funcs.append('%s' % lineinfo.get())
1025 sh_funcs.append(' tmp_str = %s(pStruct->%s, extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
1026 sh_funcs.append(' ss[%u] << "0x" << %spStruct->%s;' % (index, addr_char, stp_list[index]['name']))
1028 sh_funcs.append('%s' % lineinfo.get())
1029 sh_funcs.append(' stp_strs[%u] = " " + prefix + "%s (addr)\\n" + tmp_str;' % (index, stp_list[index]['name']))
1031 sh_funcs.append('%s' % lineinfo.get())
1032 sh_funcs.append(' stp_strs[%u] = " " + prefix + "%s (" + ss[%u].str() + ")\\n" + tmp_str;' % (index, stp_list[index]['name'], index))
1033 sh_funcs.append(' ss[%u].str("");' % (index))
1034 sh_funcs.append(' }')
1035 sh_funcs.append(' else')
1036 sh_funcs.append(' stp_strs[%u] = "";' % index)
1038 sh_funcs.append('%s' % lineinfo.get())
1039 sh_funcs.append(' tmp_str = %s(&pStruct->%s, extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
1040 sh_funcs.append(' ss[%u] << "0x" << %spStruct->%s;' % (index, addr_char, stp_list[index]['name']))
1042 sh_funcs.append(' stp_strs[%u] = " " + prefix + "%s (addr)\\n" + tmp_str;' % (index, stp_list[index]['name']))
1043 sh_funcs.append('%s' % lineinfo.get())
1045 sh_funcs.append(' stp_strs[%u] = " " + prefix + "%s (" + ss[%u].str() + ")\\n" + tmp_str;' % (index, stp_list[index]['name'], index))
1046 sh_funcs.append('%s' % lineinfo.get())
1047 sh_funcs.append(' ss[%u].str("");' % index)
1055 sh_funcs.append('%s' % lineinfo.get())
1056 sh_funcs.append(' ss[%u].str("addr");' % (index))
1058 sh_funcs.append('%s' % lineinfo.get())
1059 sh_funcs.append(' ss[%u] << "0x" << &pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1061 sh_funcs.append('%s' % lineinfo.get())
1062 sh_funcs.append(' ss[%u] << "0x" << (void*)pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1064 sh_funcs.append('%s' % lineinfo.get())
1065 sh_funcs.append(' ss[%u].str(pStruct->%s ? "TRUE" : "FALSE");' % (index, self.struct_dict[s][m]['name']))
1067 sh_funcs.append('%s' % lineinfo.get())
1068 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1070 sh_funcs.append('%s' % lineinfo.get())
1071 sh_funcs.append(' if (StreamControl::writeAddress)')
1072 sh_funcs.append(' ss[%u] << "0x" << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1073 sh_funcs.append(' else')
1074 sh_funcs.append(' ss[%u].str("address");' % (index))
1076 sh_funcs.append('%s' % lineinfo.get())
1077 sh_funcs.append(' if (pStruct->%s != NULL) {' % self.struct_dict[s][m]['name'])
1078 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1079 sh_funcs.append(' } else {')
1080 sh_funcs.append(' ss[%u] << "";' % index)
1081 sh_funcs.append(' }')
1086 sh_funcs.append('%s' % lineinfo.get())
1087 sh_funcs.append(' ss[%u] << "0x" << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1090 sh_funcs.append('%s: NB: Edit here to choose hex vs dec output by variable name' % lineinfo.get())
1091 sh_funcs.append(' ss[%u] << "0x" << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1093 sh_funcs.append('%s: NB Edit this section to choose hex vs dec output by variable name' % lineinfo.get())
1094 sh_funcs.append(' ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
1100 sh_funcs.append('%s' % lineinfo.get())
1101 sh_funcs.append(' if (pStruct->%s)' % (self.struct_dict[s][m]['name']))
1102 sh_funcs.append(' ss[%u] << "0x" << pStruct->%s << " (See individual array values below)";' % (index, self.struct_dict[s][m]['name']))
1103 sh_funcs.append(' else')
1104 sh_funcs.append(' ss[%u].str("NULL");' % (index))
1113 sh_funcs.append('%s' % lineinfo.get())
1115 sh_funcs.append(' final_str = final_str %s;' % final_str_part)
1116 sh_funcs.append(' return final_str;\n}')
1119 add_platform_wrapper_exit(sh_funcs, typedef_fwd_dict[s])
1122 sh_funcs.append('%s' % lineinfo.get())
1123 sh_funcs.append("std::string string_convert_helper(const void* toString, const std::string prefix)\n{")
1124 sh_funcs.append(" using namespace StreamControl;")
1125 sh_funcs.append(" using namespace std;")
1126 sh_funcs.append(" stringstream ss;")
1127 sh_funcs.append(' ss << toString;')
1128 sh_funcs.append(' string final_str = prefix + ss.str();')
1129 sh_funcs.append(" return final_str;")
1130 sh_funcs.append("}")
1131 sh_funcs.append('%s' % lineinfo.get())
1133 sh_funcs.append("std::string string_convert_helper(const uint64_t toString, const std::string prefix)\n{")
1134 sh_funcs.append(" using namespace StreamControl;")
1135 sh_funcs.append(" using namespace std;")
1136 sh_funcs.append(" stringstream ss;")
1137 sh_funcs.append(' ss << toString;')
1138 sh_funcs.append(' string final_str = prefix + ss.str();')
1139 sh_funcs.append(" return final_str;")
1140 sh_funcs.append("}")
1141 sh_funcs.append('%s' % lineinfo.get())
1143 sh_funcs.append("std::string string_convert_helper(VkSurfaceFormatKHR toString, const std::string prefix)\n{")
1144 sh_funcs.append(" using namespace std;")
1145 sh_funcs.append(' string final_str = prefix + "format = " + string_VkFormat(toString.format) + "format = " + string_VkColorSpaceKHR(toString.colorSpace);')
1146 sh_funcs.append(" return final_str;")
1147 sh_funcs.append("}")
1148 sh_funcs.append('%s' % lineinfo.get())
1150 sh_funcs.append("std::string dynamic_display(const void* pStruct, const std::string prefix)\n{")
1151 sh_funcs.append(" using namespace std;")
1152 sh_funcs.append(" // Cast to APP_INFO ptr initially just to pull sType off struct")
1153 sh_funcs.append(" if (pStruct == NULL) {\n")
1154 sh_funcs.append(" return string();")
1155 sh_funcs.append(" }\n")
1156 sh_funcs.append(" VkStructureType sType = ((VkApplicationInfo*)pStruct)->sType;")
1157 sh_funcs.append(' string indent = " ";')
1158 sh_funcs.append(' indent += prefix;')
1159 sh_funcs.append(" switch (sType)\n {")
1167 #sh_funcs.append('string %s(const %s* pStruct, const string prefix);' % (self._get_sh_func_name(s), typedef_fwd_dict[s]))
1168 sh_funcs.append(' case %s:\n {' % (v))
1169 sh_funcs.append(' return %s((%s*)pStruct, indent);' % (print_func_name, struct_name))
1170 sh_funcs.append(' }')
1171 sh_funcs.append(' break;')
1172 sh_funcs.append(" default:")
1173 sh_funcs.append(" return string();")
1174 sh_funcs.append('%s' % lineinfo.get())
1175 sh_funcs.append(" }")
1176 sh_funcs.append("}")
1177 return "\n".join(sh_funcs)
1314 sh_funcs = []
1319 add_platform_wrapper_entry(sh_funcs, typedef_fwd_dict[s])
1320 sh_funcs.append('uint32_t %s(const %s* pStruct);' % (self._get_vh_func_name(s), typedef_fwd_dict[s]))
1321 add_platform_wrapper_exit(sh_funcs, typedef_fwd_dict[s])
1323 sh_funcs.append('\n')
1327 add_platform_wrapper_entry(sh_funcs, typedef_fwd_dict[s])
1329 sh_funcs.append('uint32_t %s(const %s* pStruct)\n{' % (self._get_vh_func_name(s), typedef_fwd_dict[s]))
1333 sh_funcs.append(' if (!validate_%s(pStruct->%s))\n return 0;' % (self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name']))
1337 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']))
1339 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']))
1340 sh_funcs.append(" return 1;\n}")
1343 add_platform_wrapper_exit(sh_funcs, typedef_fwd_dict[s])
1345 return "\n".join(sh_funcs)
1358 sh_funcs = []
1363 add_platform_wrapper_entry(sh_funcs, typedef_fwd_dict[s])
1364 sh_funcs.append('size_t %s(const %s* pStruct);' % (self._get_size_helper_func_name(s), typedef_fwd_dict[s]))
1365 add_platform_wrapper_exit(sh_funcs, typedef_fwd_dict[s])
1367 return "\n".join(sh_funcs)
1371 sh_funcs = []
1376 add_platform_wrapper_entry(sh_funcs, typedef_fwd_dict[s])
1379 sh_funcs.append('size_t %s(const %s* pStruct)\n{' % (self._get_size_helper_func_name(s), typedef_fwd_dict[s]))
1381 sh_funcs.append('%ssize_t structSize = 0;' % (indent))
1382 sh_funcs.append('%sif (pStruct) {' % (indent))
1384 sh_funcs.append('%sstructSize = sizeof(%s);' % (indent, typedef_fwd_dict[s]))
1394 sh_funcs.append('%sstructSize += pStruct->%s*(sizeof(%s*) + sizeof(VkImageMemoryBarrier));' % (indent, self.struct_dict[s][m]['array_size'], self.struct_dict[s][m]['type']))
1396 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']))
1399 sh_funcs.append('%suint32_t i = 0;' % (indent))
1401 sh_funcs.append('%sfor (i = 0; i < pStruct->%s; i++) {' % (indent, self.struct_dict[s][m]['array_size']))
1404 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']))
1406 sh_funcs.append('%sstructSize += (sizeof(char*) + (sizeof(char) * (1 + strlen(pStruct->%s[i]))));' % (indent, self.struct_dict[s][m]['name']))
1408 sh_funcs.append('%s}' % (indent))
1412 sh_funcs.append('%suint32_t i = 0;' % (indent))
1414 sh_funcs.append('%sfor (i = 0; i < pStruct->%s; i++) {' % (indent, self.struct_dict[s][m]['array_size']))
1416 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']))
1418 sh_funcs.append('%s}' % (indent))
1420 sh_funcs.append('%sstructSize += pStruct->%s*sizeof(%s);' % (indent, self.struct_dict[s][m]['array_size'], self.struct_dict[s][m]['type']))
1423 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']))
1425 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']))
1428 sh_funcs.append('%sstructSize += sizeof(%s);' % (indent, self.struct_dict[s][m]['type']))
1430 sh_funcs.append('%sstructSize += pStruct->%s;' % (indent, self.struct_dict[s][m]['name']))
1433 sh_funcs.append('%s}' % (indent))
1434 sh_funcs.append("%sreturn structSize;\n}" % (indent))
1437 add_platform_wrapper_exit(sh_funcs, typedef_fwd_dict[s])
1442 sh_funcs.append('%s' % self.lineinfo.get())
1444 sh_funcs.append('size_t get_struct_chain_size(const void* pStruct)\n{')
1446 sh_funcs.append('size_t get_dynamic_struct_size(const void* pStruct)\n{')
1448 sh_funcs.append('%s// Just use VkApplicationInfo as struct until actual type is resolved' % (indent))
1449 sh_funcs.append('%sVkApplicationInfo* pNext = (VkApplicationInfo*)pStruct;' % (indent))
1450 sh_funcs.append('%ssize_t structSize = 0;' % (indent))
1452 sh_funcs.append('%swhile (pNext) {' % (indent))
1454 sh_funcs.append('%sswitch (pNext->sType) {' % (indent))
1463 sh_funcs.append('%scase %s:' % (indent, v))
1464 sh_funcs.append('%s{' % (indent))
1466 sh_funcs.append('%sstructSize += %s((%s*)pNext);' % (indent, self._get_size_helper_func_name(struct_name), struct_name))
1467 sh_funcs.append('%sbreak;' % (indent))
1469 sh_funcs.append('%s}' % (indent))
1470 sh_funcs.append('%sdefault:' % (indent))
1472 sh_funcs.append('%sassert(0);' % (indent))
1473 sh_funcs.append('%sstructSize += 0;' % (indent))
1476 sh_funcs.append('%s}' % (indent))
1478 sh_funcs.append('%spNext = (VkApplicationInfo*)pNext->pNext;' % (indent))
1480 sh_funcs.append('%s}' % (indent))
1481 sh_funcs.append('%sreturn structSize;\n}' % indent)
1482 return "\n".join(sh_funcs)