scripts: Improve SafePNextCopy for unknown structs

If a pNext chain contains unknown structure, the current code will
skip it by not updating prev_pNext. When a known structure is
encountered later, the chain will be re-sewn to exclude the custom
structure. However, if the unknown structure is at the very end,
the current code will not repair the pNext pointer of prev_pNext.
Thus the safe copy of the chain will still contain an unsafe pNext
pointer at the end.

This commit fixes this issue by setting prev_pNext->pNext on every
iteration, even if prev_pNext itself is not updated. If safe_pNext
is itself a nullptr, we should still overwrite prev_pNext->pNext
so as not to leave an unsafe value there. If later a known
structure is seen, this nullptr will be overwritten and the
current functionality will remain the same.
2 files changed
tree: c6e4a35cfbd45f6049ce687ec0c86dc20aa4f5db
  1. .github/
  2. docs/
  3. include/
  4. LICENSES/
  5. scripts/
  6. src/
  7. tests/
  8. .clang-format
  9. .gitattributes
  10. .gitignore
  11. BUILD.gn
  12. BUILD.md
  13. CMakeLists.txt
  14. CODE_OF_CONDUCT.md
  15. CONTRIBUTING.md
  16. LICENSE.md
  17. README.md
  18. REUSE.toml
README.md

Vulkan-Utility-Libraries

This repo was created to share code across various Vulkan repositories, solving long standing issues for Vulkan SDK developers and users.

Historical Context

The Vulkan-ValidationLayers contained many libraries and utilities that were useful for other Vulkan repositories, and became the primary mechanism for code sharing in the Vulkan ecosystem.

This caused the Vulkan-ValidationLayers to have to maintain and export source code which was never intended for that purpose. This not only hindered development of the Vulkan-ValidationLayers, but would frequently break anyone depending on the source code due to the poorly located nature of it. On top of numerous other issues.

This repository was created to facilitate official source deliverables that can be reliably used by developers.

Vulkan::LayerSettings

The Vulkan::LayerSettings library was created to standardize layer configuration code for various SDK layer deliverables.

This is to ensure they all worked consistently with the 3 main methods of layer configuration.

For more information see layer_configuration.md.

Vulkan::UtilityHeaders

The Vulkan::UtilityHeaders library contains header only files that provide useful functionality to developers:

  • vk_dispatch_table.h: Initializing instance/device dispatch tables
  • vk_format_utils.h: Utilities for VkFormat
  • vk_struct_helper.hpp: Utilities for vulkan structs
  • vk_enum_string_helper.h: Converts Vulkan enums into strings