Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////// |
| 2 | // |
| 3 | // Copyright (c) 2015-2016 The Khronos Group Inc. |
| 4 | // Copyright (c) 2015-2016 Valve Corporation |
| 5 | // Copyright (c) 2015-2016 LunarG, Inc. |
| 6 | // Copyright (c) 2015-2016 Google, Inc. |
| 7 | // |
| 8 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | // you may not use this file except in compliance with the License. |
| 10 | // You may obtain a copy of the License at |
| 11 | // |
| 12 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | // |
| 14 | // Unless required by applicable law or agreed to in writing, software |
| 15 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | // See the License for the specific language governing permissions and |
| 18 | // limitations under the License. |
| 19 | /////////////////////////////////////////////////////////////////////////////// |
| 20 | |
| 21 | #ifndef VKJSON_H_ |
| 22 | #define VKJSON_H_ |
| 23 | |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 24 | #include <string.h> |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 25 | #include <vulkan/vulkan.h> |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 26 | |
| 27 | #include <map> |
| 28 | #include <string> |
| 29 | #include <vector> |
| 30 | |
| 31 | #ifdef WIN32 |
| 32 | #undef min |
| 33 | #undef max |
| 34 | #endif |
| 35 | |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 36 | struct VkJsonLayer { |
| 37 | VkLayerProperties properties; |
| 38 | std::vector<VkExtensionProperties> extensions; |
| 39 | }; |
| 40 | |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 41 | struct VkJsonKHRVariablePointers { |
| 42 | VkJsonKHRVariablePointers() { |
| 43 | reported = false; |
| 44 | memset(&variable_pointer_features_khr, 0, |
| 45 | sizeof(VkPhysicalDeviceVariablePointerFeaturesKHR)); |
| 46 | memset(&variable_pointers_features_khr, 0, |
| 47 | sizeof(VkPhysicalDeviceVariablePointersFeaturesKHR)); |
| 48 | } |
| 49 | bool reported; |
| 50 | VkPhysicalDeviceVariablePointerFeaturesKHR variable_pointer_features_khr; |
| 51 | VkPhysicalDeviceVariablePointersFeaturesKHR variable_pointers_features_khr; |
| 52 | }; |
| 53 | |
| 54 | struct VkJsonKHRShaderFloat16Int8 { |
| 55 | VkJsonKHRShaderFloat16Int8() { |
| 56 | reported = false; |
| 57 | memset(&shader_float16_int8_features_khr, 0, |
| 58 | sizeof(VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)); |
| 59 | memset(&float16_int8_features_khr, 0, |
| 60 | sizeof(VkPhysicalDeviceFloat16Int8FeaturesKHR)); |
| 61 | } |
| 62 | bool reported; |
| 63 | VkPhysicalDeviceShaderFloat16Int8FeaturesKHR shader_float16_int8_features_khr; |
| 64 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8_features_khr; |
| 65 | }; |
| 66 | |
| 67 | struct VkJsonExtImage2dViewOf3d { |
| 68 | VkJsonExtImage2dViewOf3d() { |
| 69 | reported = false; |
| 70 | memset(&image_2d_view_of_3d_features_ext, 0, |
| 71 | sizeof(VkPhysicalDeviceImage2DViewOf3DFeaturesEXT)); |
| 72 | } |
| 73 | bool reported; |
| 74 | VkPhysicalDeviceImage2DViewOf3DFeaturesEXT image_2d_view_of_3d_features_ext; |
| 75 | }; |
| 76 | |
| 77 | struct VkJsonExtCustomBorderColor { |
| 78 | VkJsonExtCustomBorderColor() { |
| 79 | reported = false; |
| 80 | memset(&custom_border_color_features_ext, 0, |
| 81 | sizeof(VkPhysicalDeviceCustomBorderColorFeaturesEXT)); |
| 82 | } |
| 83 | bool reported; |
| 84 | VkPhysicalDeviceCustomBorderColorFeaturesEXT custom_border_color_features_ext; |
| 85 | }; |
| 86 | |
| 87 | struct VkJsonExtPrimitiveTopologyListRestart { |
| 88 | VkJsonExtPrimitiveTopologyListRestart() { |
| 89 | reported = false; |
| 90 | memset(&primitive_topology_list_restart_features_ext, 0, |
| 91 | sizeof(VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT)); |
| 92 | } |
| 93 | bool reported; |
| 94 | VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT |
| 95 | primitive_topology_list_restart_features_ext; |
| 96 | }; |
| 97 | |
| 98 | struct VkJsonExtProvokingVertex { |
| 99 | VkJsonExtProvokingVertex() { |
| 100 | reported = false; |
| 101 | memset(&provoking_vertex_features_ext, 0, |
| 102 | sizeof(VkPhysicalDeviceProvokingVertexFeaturesEXT)); |
| 103 | } |
| 104 | bool reported; |
| 105 | VkPhysicalDeviceProvokingVertexFeaturesEXT provoking_vertex_features_ext; |
| 106 | }; |
| 107 | |
| 108 | struct VkJsonKHRIndexTypeUint8 { |
| 109 | VkJsonKHRIndexTypeUint8() { |
| 110 | reported = false; |
| 111 | memset(&index_type_uint8_features_khr, 0, |
| 112 | sizeof(VkPhysicalDeviceIndexTypeUint8FeaturesKHR)); |
| 113 | } |
| 114 | bool reported; |
| 115 | VkPhysicalDeviceIndexTypeUint8FeaturesKHR index_type_uint8_features_khr; |
| 116 | }; |
| 117 | |
| 118 | struct VkJsonExtIndexTypeUint8 { |
| 119 | VkJsonExtIndexTypeUint8() { |
| 120 | reported = false; |
| 121 | memset(&index_type_uint8_features_ext, 0, |
| 122 | sizeof(VkPhysicalDeviceIndexTypeUint8FeaturesEXT)); |
| 123 | } |
| 124 | bool reported; |
| 125 | VkPhysicalDeviceIndexTypeUint8FeaturesEXT index_type_uint8_features_ext; |
| 126 | }; |
| 127 | |
| 128 | struct VkJsonKHRVertexAttributeDivisor { |
| 129 | VkJsonKHRVertexAttributeDivisor() { |
| 130 | reported = false; |
| 131 | memset(&vertex_attribute_divisor_features_khr, 0, |
| 132 | sizeof(VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR)); |
| 133 | } |
| 134 | bool reported; |
| 135 | VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR |
| 136 | vertex_attribute_divisor_features_khr; |
| 137 | }; |
| 138 | |
| 139 | struct VkJsonExtVertexAttributeDivisor { |
| 140 | VkJsonExtVertexAttributeDivisor() { |
| 141 | reported = false; |
| 142 | memset(&vertex_attribute_divisor_features_ext, 0, |
| 143 | sizeof(VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT)); |
| 144 | } |
| 145 | bool reported; |
| 146 | VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT |
| 147 | vertex_attribute_divisor_features_ext; |
| 148 | }; |
| 149 | |
| 150 | struct VkJsonExtTransformFeedback { |
| 151 | VkJsonExtTransformFeedback() { |
| 152 | reported = false; |
| 153 | memset(&transform_feedback_features_ext, 0, |
| 154 | sizeof(VkPhysicalDeviceTransformFeedbackFeaturesEXT)); |
| 155 | } |
| 156 | bool reported; |
| 157 | VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback_features_ext; |
| 158 | }; |
| 159 | |
| 160 | struct VkJsonKHRShaderSubgroupUniformControlFlow { |
| 161 | VkJsonKHRShaderSubgroupUniformControlFlow() { |
| 162 | reported = false; |
| 163 | memset(&shader_subgroup_uniform_control_flow_features_khr, 0, |
| 164 | sizeof(VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR)); |
| 165 | } |
| 166 | bool reported; |
| 167 | VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR |
| 168 | shader_subgroup_uniform_control_flow_features_khr; |
| 169 | }; |
| 170 | |
| 171 | struct VkJsonKHRShaderSubgroupExtendedTypes { |
| 172 | VkJsonKHRShaderSubgroupExtendedTypes() { |
| 173 | reported = false; |
| 174 | memset(&shader_subgroup_extended_types_features_khr, 0, |
| 175 | sizeof(VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)); |
| 176 | } |
| 177 | bool reported; |
| 178 | VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR |
| 179 | shader_subgroup_extended_types_features_khr; |
| 180 | }; |
| 181 | |
| 182 | struct VkJsonKHR8bitStorage { |
| 183 | VkJsonKHR8bitStorage() { |
| 184 | reported = false; |
| 185 | memset(&bit8_storage_features_khr, 0, |
| 186 | sizeof(VkPhysicalDevice8BitStorageFeaturesKHR)); |
| 187 | } |
| 188 | bool reported; |
| 189 | VkPhysicalDevice8BitStorageFeaturesKHR bit8_storage_features_khr; |
| 190 | }; |
| 191 | |
| 192 | struct VkJsonKHRShaderIntegerDotProduct { |
| 193 | VkJsonKHRShaderIntegerDotProduct() { |
| 194 | reported = false; |
| 195 | memset(&shader_integer_dot_product_features_khr, 0, |
| 196 | sizeof(VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR)); |
| 197 | } |
| 198 | bool reported; |
| 199 | VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR |
| 200 | shader_integer_dot_product_features_khr; |
| 201 | }; |
| 202 | |
| 203 | struct VkJsonIMGRelaxedLineRasterization { |
| 204 | VkJsonIMGRelaxedLineRasterization() { |
| 205 | reported = false; |
| 206 | memset(&relaxed_line_rasterization_features_img, 0, |
| 207 | sizeof(VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG)); |
| 208 | } |
| 209 | bool reported; |
| 210 | VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG |
| 211 | relaxed_line_rasterization_features_img; |
| 212 | }; |
| 213 | |
| 214 | struct VkJsonKHRLineRasterization { |
| 215 | VkJsonKHRLineRasterization() { |
| 216 | reported = false; |
| 217 | memset(&line_rasterization_features_khr, 0, |
| 218 | sizeof(VkPhysicalDeviceLineRasterizationFeaturesKHR)); |
| 219 | } |
| 220 | bool reported; |
| 221 | VkPhysicalDeviceLineRasterizationFeaturesKHR line_rasterization_features_khr; |
| 222 | }; |
| 223 | |
| 224 | struct VkJsonExtLineRasterization { |
| 225 | VkJsonExtLineRasterization() { |
| 226 | reported = false; |
| 227 | memset(&line_rasterization_features_ext, 0, |
| 228 | sizeof(VkPhysicalDeviceLineRasterizationFeaturesEXT)); |
| 229 | } |
| 230 | bool reported; |
| 231 | VkPhysicalDeviceLineRasterizationFeaturesEXT line_rasterization_features_ext; |
| 232 | }; |
| 233 | |
| 234 | struct VkJsonExtPrimitivesGeneratedQuery { |
| 235 | VkJsonExtPrimitivesGeneratedQuery() { |
| 236 | reported = false; |
| 237 | memset(&primitives_generated_query_features_ext, 0, |
| 238 | sizeof(VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT)); |
| 239 | } |
| 240 | bool reported; |
| 241 | VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT |
| 242 | primitives_generated_query_features_ext; |
| 243 | }; |
| 244 | |
| 245 | struct VkJsonKHRShaderFloatControls { |
| 246 | VkJsonKHRShaderFloatControls() { |
| 247 | reported = false; |
| 248 | memset(&float_controls_properties_khr, 0, |
| 249 | sizeof(VkPhysicalDeviceFloatControlsPropertiesKHR)); |
| 250 | } |
| 251 | bool reported; |
| 252 | VkPhysicalDeviceFloatControlsPropertiesKHR float_controls_properties_khr; |
| 253 | }; |
| 254 | |
| 255 | struct VkJsonKHRDriverProperties { |
| 256 | VkJsonKHRDriverProperties() { |
Yiwei Zhang | 7b4169d | 2018-10-02 18:58:31 -0700 | [diff] [blame] | 257 | reported = false; |
| 258 | memset(&driver_properties_khr, 0, |
| 259 | sizeof(VkPhysicalDeviceDriverPropertiesKHR)); |
| 260 | } |
| 261 | bool reported; |
| 262 | VkPhysicalDeviceDriverPropertiesKHR driver_properties_khr; |
| 263 | }; |
| 264 | |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 265 | struct VkJsonCore11 { |
| 266 | VkPhysicalDeviceVulkan11Properties properties; |
| 267 | VkPhysicalDeviceVulkan11Features features; |
Peiyong Lin | c1b5ffb | 2020-02-27 19:31:51 -0800 | [diff] [blame] | 268 | }; |
| 269 | |
Trevor David Black | d35f0f6 | 2021-09-07 23:39:36 +0000 | [diff] [blame] | 270 | struct VkJsonCore12 { |
| 271 | VkPhysicalDeviceVulkan12Properties properties; |
| 272 | VkPhysicalDeviceVulkan12Features features; |
| 273 | }; |
| 274 | |
Trevor David Black | 7988379 | 2021-11-04 23:46:31 +0000 | [diff] [blame] | 275 | struct VkJsonCore13 { |
| 276 | VkPhysicalDeviceVulkan13Properties properties; |
| 277 | VkPhysicalDeviceVulkan13Features features; |
| 278 | }; |
| 279 | |
Tom Murphy | 80d9ca7 | 2024-10-17 09:52:47 +0000 | [diff] [blame] | 280 | struct VkJsonCore14 { |
| 281 | VkPhysicalDeviceVulkan14Properties properties; |
| 282 | VkPhysicalDeviceVulkan14Features features; |
| 283 | }; |
| 284 | |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 285 | struct VkJsonDevice { |
| 286 | VkJsonDevice() { |
| 287 | memset(&properties, 0, sizeof(VkPhysicalDeviceProperties)); |
| 288 | memset(&features, 0, sizeof(VkPhysicalDeviceFeatures)); |
| 289 | memset(&memory, 0, sizeof(VkPhysicalDeviceMemoryProperties)); |
| 290 | memset(&subgroup_properties, 0, sizeof(VkPhysicalDeviceSubgroupProperties)); |
| 291 | memset(&point_clipping_properties, 0, |
| 292 | sizeof(VkPhysicalDevicePointClippingProperties)); |
| 293 | memset(&multiview_properties, 0, |
| 294 | sizeof(VkPhysicalDeviceMultiviewProperties)); |
| 295 | memset(&id_properties, 0, sizeof(VkPhysicalDeviceIDProperties)); |
| 296 | memset(&maintenance3_properties, 0, |
| 297 | sizeof(VkPhysicalDeviceMaintenance3Properties)); |
| 298 | memset(&bit16_storage_features, 0, |
| 299 | sizeof(VkPhysicalDevice16BitStorageFeatures)); |
| 300 | memset(&multiview_features, 0, sizeof(VkPhysicalDeviceMultiviewFeatures)); |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 301 | memset(&variable_pointers_features, 0, |
| 302 | sizeof(VkPhysicalDeviceVariablePointersFeatures)); |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 303 | memset(&protected_memory_features, 0, |
| 304 | sizeof(VkPhysicalDeviceProtectedMemoryFeatures)); |
| 305 | memset(&sampler_ycbcr_conversion_features, 0, |
| 306 | sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures)); |
| 307 | memset(&shader_draw_parameter_features, 0, |
| 308 | sizeof(VkPhysicalDeviceShaderDrawParameterFeatures)); |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 309 | memset(&core11, 0, sizeof(VkJsonCore11)); |
Trevor David Black | d35f0f6 | 2021-09-07 23:39:36 +0000 | [diff] [blame] | 310 | memset(&core12, 0, sizeof(VkJsonCore12)); |
Trevor David Black | 7988379 | 2021-11-04 23:46:31 +0000 | [diff] [blame] | 311 | memset(&core13, 0, sizeof(VkJsonCore13)); |
Tom Murphy | 80d9ca7 | 2024-10-17 09:52:47 +0000 | [diff] [blame] | 312 | memset(&core14, 0, sizeof(VkJsonCore14)); |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 313 | } |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 314 | VkJsonKHRVariablePointers khr_variable_pointers; |
| 315 | VkJsonKHRShaderFloat16Int8 khr_shader_float16_int8; |
| 316 | VkJsonExtImage2dViewOf3d ext_image_2d_view_of_3d; |
| 317 | VkJsonExtCustomBorderColor ext_custom_border_color; |
| 318 | VkJsonExtPrimitiveTopologyListRestart ext_primitive_topology_list_restart; |
| 319 | VkJsonExtProvokingVertex ext_provoking_vertex; |
| 320 | VkJsonKHRIndexTypeUint8 khr_index_type_uint8; |
| 321 | VkJsonExtIndexTypeUint8 ext_index_type_uint8; |
| 322 | VkJsonKHRVertexAttributeDivisor khr_vertex_attribute_divisor; |
| 323 | VkJsonExtVertexAttributeDivisor ext_vertex_attribute_divisor; |
| 324 | VkJsonExtTransformFeedback ext_transform_feedback; |
| 325 | VkJsonKHRShaderSubgroupUniformControlFlow |
| 326 | khr_shader_subgroup_uniform_control_flow; |
| 327 | VkJsonKHRShaderSubgroupExtendedTypes khr_shader_subgroup_extended_types; |
| 328 | VkJsonKHR8bitStorage khr_8bit_storage; |
| 329 | VkJsonKHRShaderIntegerDotProduct khr_shader_integer_dot_product; |
| 330 | VkJsonIMGRelaxedLineRasterization img_relaxed_line_rasterization; |
| 331 | VkJsonKHRLineRasterization khr_line_rasterization; |
| 332 | VkJsonExtLineRasterization ext_line_rasterization; |
| 333 | VkJsonExtPrimitivesGeneratedQuery ext_primitives_generated_query; |
| 334 | VkJsonKHRShaderFloatControls khr_shader_float_controls; |
| 335 | VkJsonKHRDriverProperties khr_driver_properties; |
| 336 | VkJsonCore11 core11; |
| 337 | VkJsonCore12 core12; |
| 338 | VkJsonCore13 core13; |
| 339 | VkJsonCore14 core14; |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 340 | VkPhysicalDeviceProperties properties; |
| 341 | VkPhysicalDeviceFeatures features; |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 342 | VkPhysicalDeviceMemoryProperties memory; |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 343 | VkPhysicalDeviceSubgroupProperties subgroup_properties; |
| 344 | VkPhysicalDevicePointClippingProperties point_clipping_properties; |
| 345 | VkPhysicalDeviceMultiviewProperties multiview_properties; |
| 346 | VkPhysicalDeviceIDProperties id_properties; |
| 347 | VkPhysicalDeviceMaintenance3Properties maintenance3_properties; |
| 348 | VkPhysicalDevice16BitStorageFeatures bit16_storage_features; |
| 349 | VkPhysicalDeviceMultiviewFeatures multiview_features; |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 350 | VkPhysicalDeviceVariablePointersFeatures variable_pointers_features; |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 351 | VkPhysicalDeviceProtectedMemoryFeatures protected_memory_features; |
| 352 | VkPhysicalDeviceSamplerYcbcrConversionFeatures |
| 353 | sampler_ycbcr_conversion_features; |
| 354 | VkPhysicalDeviceShaderDrawParameterFeatures shader_draw_parameter_features; |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 355 | std::vector<VkQueueFamilyProperties> queues; |
| 356 | std::vector<VkExtensionProperties> extensions; |
| 357 | std::vector<VkLayerProperties> layers; |
| 358 | std::map<VkFormat, VkFormatProperties> formats; |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 359 | std::map<VkExternalFenceHandleTypeFlagBits, VkExternalFenceProperties> |
| 360 | external_fence_properties; |
| 361 | std::map<VkExternalSemaphoreHandleTypeFlagBits, VkExternalSemaphoreProperties> |
| 362 | external_semaphore_properties; |
| 363 | }; |
| 364 | |
| 365 | struct VkJsonDeviceGroup { |
| 366 | VkJsonDeviceGroup() { |
| 367 | memset(&properties, 0, sizeof(VkPhysicalDeviceGroupProperties)); |
| 368 | } |
| 369 | VkPhysicalDeviceGroupProperties properties; |
| 370 | std::vector<uint32_t> device_inds; |
| 371 | }; |
| 372 | |
| 373 | struct VkJsonInstance { |
| 374 | VkJsonInstance() : api_version(0) {} |
| 375 | uint32_t api_version; |
| 376 | std::vector<VkJsonLayer> layers; |
| 377 | std::vector<VkExtensionProperties> extensions; |
| 378 | std::vector<VkJsonDevice> devices; |
| 379 | std::vector<VkJsonDeviceGroup> device_groups; |
| 380 | }; |
| 381 | |
| 382 | VkJsonInstance VkJsonGetInstance(); |
| 383 | std::string VkJsonInstanceToJson(const VkJsonInstance& instance); |
| 384 | bool VkJsonInstanceFromJson(const std::string& json, |
| 385 | VkJsonInstance* instance, |
| 386 | std::string* errors); |
| 387 | |
Yiwei Zhang | 91fc3dc | 2020-07-05 23:33:22 -0700 | [diff] [blame] | 388 | VkJsonDevice VkJsonGetDevice(VkPhysicalDevice device); |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 389 | std::string VkJsonDeviceToJson(const VkJsonDevice& device); |
| 390 | bool VkJsonDeviceFromJson(const std::string& json, |
| 391 | VkJsonDevice* device, |
| 392 | std::string* errors); |
| 393 | |
| 394 | std::string VkJsonImageFormatPropertiesToJson( |
| 395 | const VkImageFormatProperties& properties); |
| 396 | bool VkJsonImageFormatPropertiesFromJson(const std::string& json, |
| 397 | VkImageFormatProperties* properties, |
| 398 | std::string* errors); |
| 399 | |
| 400 | // Backward-compatibility aliases |
| 401 | typedef VkJsonDevice VkJsonAllProperties; |
| 402 | inline VkJsonAllProperties VkJsonGetAllProperties( |
| 403 | VkPhysicalDevice physicalDevice) { |
Yiwei Zhang | 91fc3dc | 2020-07-05 23:33:22 -0700 | [diff] [blame] | 404 | return VkJsonGetDevice(physicalDevice); |
Yiwei Zhang | f9a57e6 | 2018-04-05 00:17:22 -0700 | [diff] [blame] | 405 | } |
| 406 | inline std::string VkJsonAllPropertiesToJson( |
| 407 | const VkJsonAllProperties& properties) { |
| 408 | return VkJsonDeviceToJson(properties); |
| 409 | } |
| 410 | inline bool VkJsonAllPropertiesFromJson(const std::string& json, |
| 411 | VkJsonAllProperties* properties, |
| 412 | std::string* errors) { |
| 413 | return VkJsonDeviceFromJson(json, properties, errors); |
| 414 | } |
| 415 | |
Nikita Gupta | 3c2535d | 2025-03-10 10:00:27 -0700 | [diff] [blame^] | 416 | #endif // VKJSON_H_ |