Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: Add vk_struct_helper.hpp #110

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

charles-lunarg
Copy link
Collaborator

@charles-lunarg charles-lunarg commented Sep 13, 2023

Move the vk_struct_helper.h file in Vulkan-ValidationLayers over to this repo.

Changes from that include:

  • Renaming functions
  • Placing them in the vku namespace
  • Adding the InitStructHelper class which deduces the type based on the variable that is being initialized
  • If a type isn't defined then compiler error is emitted

Resolves #74

@charles-lunarg
Copy link
Collaborator Author

vk_typemap_helper.hpp is not a great name, since there isn't a 'typemap' in the code anywhere. vk_struct_init.hpp is better but I'm not sold.

@juan-lunarg
Copy link
Contributor

What about vk_struct_helper.hpp? Since this also does pNext searching?

@charles-lunarg
Copy link
Collaborator Author

Thats a good idea due to the inclusion of pNext chain helpers as well.

Copy link
Contributor

@juan-lunarg juan-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update the chromium build.

Copy link
Contributor

@juan-lunarg juan-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall aside from chromium build issue.

@charles-lunarg
Copy link
Collaborator Author

build.gn has been updated.

Copy link
Contributor

@juan-lunarg juan-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update PR title with correct header file

@charles-lunarg charles-lunarg changed the title util: Add vk_typemap_helper.hpp util: Add vk_struct_helper.hpp Sep 19, 2023
Move the vk_typemap_helper.h file in Vulkan-ValidationLayers over to this
repo with a different name to reflect the use of it

Changes from that include:
 * Rename the functions to be more obvious as to what they do
 * Placing them in the `vku` namespace
 * Adding the `InitStructHelper` class which deduces the type based on the
   variable that is being initialized
 * Compiler error if there is no corresponding sType
@charles-lunarg charles-lunarg merged commit 6774c9b into KhronosGroup:main Sep 19, 2023
@charles-lunarg charles-lunarg deleted the vk_typemap_helper branch September 19, 2023 16:10
@juan-lunarg
Copy link
Contributor

FWIW I'd start with updating the extension layer instead of vvl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vk_typemap_helper.h
2 participants