|
15 | 15 | // limitations under the License. |
16 | 16 | // |
17 | 17 | // Author: Mark Young <marky@lunarg.com> |
| 18 | +// Author: Dave Houlton <daveh@lunarg.com> |
18 | 19 | // |
19 | 20 |
|
20 | 21 | #include "hex_and_handles.h" |
@@ -469,62 +470,50 @@ XrResult ApiDumpLayerXrCreateApiLayerInstance(const XrInstanceCreateInfo *info, |
469 | 470 | contents.emplace_back("XrResult", "xrCreateInstance", ""); |
470 | 471 | contents.emplace_back("const XrInstanceCreateInfo*", "info", PointerToHexString(info)); |
471 | 472 | if (nullptr != info) { |
472 | | - std::string prefix = "info->"; |
| 473 | + std::string info_prefix = "info->"; |
473 | 474 | contents.emplace_back("XrStructureType", "info->type", std::to_string(info->type)); |
474 | | - std::string next_prefix = prefix; |
| 475 | + std::string next_prefix = info_prefix; |
475 | 476 | next_prefix += "next"; |
476 | 477 | // Decode the next chain if it exists |
477 | 478 | if (!ApiDumpDecodeNextChain(nullptr, info->next, next_prefix, contents)) { |
478 | 479 | throw std::invalid_argument("Invalid Operation"); |
479 | 480 | } |
480 | | - std::string flags_prefix = prefix; |
| 481 | + std::string flags_prefix = info_prefix; |
481 | 482 | flags_prefix += "createFlags"; |
482 | 483 | contents.emplace_back("XrInstanceCreateFlags", flags_prefix, std::to_string(info->createFlags)); |
483 | | - std::string applicationinfo_prefix = prefix; |
| 484 | + std::string applicationinfo_prefix = info_prefix; |
484 | 485 | applicationinfo_prefix += "applicationInfo"; |
485 | 486 | if (!ApiDumpOutputXrStruct(nullptr, &info->applicationInfo, applicationinfo_prefix, "XrApplicationInfo", true, |
486 | 487 | contents)) { |
487 | 488 | throw std::invalid_argument("Invalid Operation"); |
488 | 489 | } |
489 | | - std::string enabledapilayercount_prefix = prefix; |
| 490 | + std::string enabledapilayercount_prefix = info_prefix; |
490 | 491 | enabledapilayercount_prefix += "enabledApiLayerCount"; |
491 | 492 | std::ostringstream oss_enabledApiLayerCount; |
492 | 493 | oss_enabledApiLayerCount << "0x" << std::hex << (info->enabledApiLayerCount); |
493 | 494 | contents.emplace_back("uint32_t", enabledapilayercount_prefix, oss_enabledApiLayerCount.str()); |
494 | | - std::string enabledapilayernames_prefix = prefix; |
| 495 | + std::string enabledapilayernames_prefix = info_prefix; |
495 | 496 | enabledapilayernames_prefix += "enabledApiLayerNames"; |
496 | 497 | std::ostringstream oss_enabledApiLayerNames_array; |
497 | 498 | oss_enabledApiLayerNames_array << "0x" << std::hex << (info->enabledApiLayerNames); |
498 | 499 | contents.emplace_back("const char* const*", enabledapilayernames_prefix, oss_enabledApiLayerNames_array.str()); |
499 | | - for (uint32_t info_enabledapilayernames_inc = 0; info_enabledapilayernames_inc < info->enabledApiLayerCount; |
500 | | - ++info_enabledapilayernames_inc) { |
501 | | - std::string enabledapilayernames_array_prefix = enabledapilayernames_prefix; |
502 | | - enabledapilayernames_array_prefix += "["; |
503 | | - enabledapilayernames_array_prefix += std::to_string(info_enabledapilayernames_inc); |
504 | | - enabledapilayernames_array_prefix += "]"; |
505 | | - std::ostringstream oss_enabledApiLayerNames; |
506 | | - oss_enabledApiLayerNames << "0x" << std::hex << (*info->enabledApiLayerNames[info_enabledapilayernames_inc]); |
507 | | - contents.emplace_back("const char* const*", enabledapilayernames_array_prefix, oss_enabledApiLayerNames.str()); |
| 500 | + for (uint32_t i = 0; i < info->enabledApiLayerCount; ++i) { |
| 501 | + std::string prefix = enabledapilayernames_prefix + "[" + std::to_string(i) + "]"; |
| 502 | + contents.emplace_back("const char* const*", prefix, info->enabledApiLayerNames[i]); |
508 | 503 | } |
509 | | - std::string enabledextensioncount_prefix = prefix; |
| 504 | + std::string enabledextensioncount_prefix = info_prefix; |
510 | 505 | enabledextensioncount_prefix += "enabledExtensionCount"; |
511 | 506 | std::ostringstream oss_enabledExtensionCount; |
512 | 507 | oss_enabledExtensionCount << "0x" << std::hex << (info->enabledExtensionCount); |
513 | 508 | contents.emplace_back("uint32_t", enabledextensioncount_prefix, oss_enabledExtensionCount.str()); |
514 | | - std::string enabledextensionnames_prefix = prefix; |
| 509 | + std::string enabledextensionnames_prefix = info_prefix; |
515 | 510 | enabledextensionnames_prefix += "enabledExtensionNames"; |
516 | 511 | std::ostringstream oss_enabledExtensionNames_array; |
517 | 512 | oss_enabledExtensionNames_array << "0x" << std::hex << (info->enabledExtensionNames); |
518 | 513 | contents.emplace_back("const char* const*", enabledextensionnames_prefix, oss_enabledExtensionNames_array.str()); |
519 | | - for (uint32_t info_enabledextensionnames_inc = 0; info_enabledextensionnames_inc < info->enabledExtensionCount; |
520 | | - ++info_enabledextensionnames_inc) { |
521 | | - std::string enabledextensionnames_array_prefix = enabledextensionnames_prefix; |
522 | | - enabledextensionnames_array_prefix += "["; |
523 | | - enabledextensionnames_array_prefix += std::to_string(info_enabledextensionnames_inc); |
524 | | - enabledextensionnames_array_prefix += "]"; |
525 | | - std::ostringstream oss_enabledExtensionNames; |
526 | | - oss_enabledExtensionNames << "0x" << std::hex << (*info->enabledExtensionNames[info_enabledextensionnames_inc]); |
527 | | - contents.emplace_back("const char* const*", enabledextensionnames_array_prefix, oss_enabledExtensionNames.str()); |
| 514 | + for (uint32_t ii = 0; ii < info->enabledExtensionCount; ++ii) { |
| 515 | + std::string prefix = enabledextensionnames_prefix + "[" + std::to_string(ii) + "]"; |
| 516 | + contents.emplace_back("const char* const*", prefix, info->enabledExtensionNames[ii]); |
528 | 517 | } |
529 | 518 | } |
530 | 519 |
|
|
0 commit comments