(self, var, parent)
| 905 | return True |
| 906 | |
| 907 | def write_value(self, var, parent): |
| 908 | custom_fullType = get_fulltype(var) |
| 909 | custom_type = get_type(var) |
| 910 | object_access = 'object.' if isinstance(parent, Struct) else '' |
| 911 | call_type = self.get_unaliased_type(var.type) |
| 912 | if isinstance(parent, Command): |
| 913 | indent = '(Format == ApiDumpFormat::Json ? 4 : 1)' |
| 914 | else: |
| 915 | indent = 'indents + (Format == ApiDumpFormat::Json ? 2 : 1)' |
| 916 | |
| 917 | value = f'{object_access}{var.name}' |
| 918 | if self.get_is_array(var): |
| 919 | element_type = f'dump_type<Format, {custom_type}>' |
| 920 | if var.type == 'char': |
| 921 | element_type = 'dump_char<Format>' |
| 922 | if custom_type == 'uint8_t': # ostream << treats uint8_t as char which we dont want |
| 923 | element_type = 'dump_type<Format, uint32_t>' |
| 924 | elif custom_type == 'int8_t': # ostream << treats int8_t as char which we dont want |
| 925 | element_type = 'dump_type<Format, int32_t>' |
| 926 | |
| 927 | elif call_type in self.vulkan_defined_types: |
| 928 | element_type = f'dump_{call_type}<Format>' |
| 929 | |
| 930 | if parent.name in ['VkShaderModuleCreateInfo', 'VkShaderCreateInfoEXT'] and var.name == 'pCode': |
| 931 | array_len = f'{object_access}{var.length}' |
| 932 | self.write(f''' |
| 933 | if(settings.showShader()) {{ |
| 934 | dump_spirv<Format>({value}, {array_len}, settings, "{custom_fullType}", "{var.name}", {indent}); |
| 935 | }} else {{ |
| 936 | dump_special<Format>("SHADER DATA", settings, "{var.fullType}", "{var.name}", {indent}); |
| 937 | }}''') |
| 938 | |
| 939 | elif len(var.fixedSizeArray) > 2: |
| 940 | raise RuntimeError("Unhandled fixed array dimentionality") |
| 941 | elif len(var.fixedSizeArray) == 2: |
| 942 | self.write(f'dump_double_array<Format>({value}, {var.fixedSizeArray[0]}, {var.fixedSizeArray[1]}, settings, "{custom_fullType}", "{var.name}", "{custom_type}", {indent}, {element_type});') |
| 943 | |
| 944 | elif len(var.fixedSizeArray) == 1 and isinstance(parent, Struct): # Fixed length array's passed as parameters are treated as void*, so only match when printing members |
| 945 | fixed_array_len = get_fixed_array_length(var.fixedSizeArray[0], var, parent) |
| 946 | self.write(f'dump_single_array<Format>({value}, {fixed_array_len}, settings, "{custom_fullType}", "{var.name}", "{custom_type}", {indent}, {element_type});') |
| 947 | |
| 948 | else: |
| 949 | array_len = get_array_length(var, parent) |
| 950 | if var.fullType.count('*') > 1 and var.type not in ['void', 'char'] and (call_type in self.vulkan_defined_types): |
| 951 | self.write(f'dump_double_pointer_array<Format>({value}, {array_len}, settings, "{custom_fullType}", "{var.name}", "{custom_type}", {indent}, {element_type});') |
| 952 | else: |
| 953 | self.write(f'dump_pointer_array<Format>({value}, {array_len}, settings, "{custom_fullType}", "{var.name}", "{custom_type}", {indent}, {element_type});') |
| 954 | else: |
| 955 | if var.pointer and var.type not in self.only_use_as_pointer_types and var.type not in self.vk.funcPointers.keys() and var.type not in ['void', 'char'] and not (var.name == 'pNext' and var.fullType in ['void*', 'const void*']): |
| 956 | pointer_type = f'dump_type<Format, {custom_type}>' |
| 957 | if (call_type in self.vulkan_defined_types): |
| 958 | pointer_type = f'dump_{call_type}<Format>' |
| 959 | |
| 960 | self.write(f'dump_pointer<Format>({value}, settings, "{custom_fullType}", "{var.name}", {indent}, {pointer_type});') |
| 961 | else: |
| 962 | value_type = f'dump_type<Format, {var.fullType}>' |
| 963 | if var.name == 'apiVersion': |
| 964 | value_type = 'dump_api_version<Format>' |
no test coverage detected