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

api_dump: Prevent crash in VkDescriptorDataEXT union #1848

Merged

Conversation

charles-lunarg
Copy link
Contributor

The VK_EXT_descriptor_buffer extension adds a union with pointer elements. Because API Dumps union logic is naive, it prints the value of every element in the union regardless of whichever the 'active' element is, as it is not always possible to easily get the active element. VkDescriptorDataEXT contains pointers which are dereferenced resulting in a crash. Fixing it is straightforward because the parent structure VkDescriptorGetInfoEXT contains the type to use, so it is just a matter using the PARAMETER_STATE and VALIDITY_CHECKS functionality to set & get the type when printing out the contents of the union.

The VK_EXT_descriptor_buffer extension adds a union with pointer elements.
Because API Dumps union logic is naive, it prints the value of every element
in the union regardless of whichever the 'active' element is, as it is not
always possible to easily get the active element. VkDescriptorDataEXT
contains pointers which are dereferenced resulting in a crash. Fixing it is
straightforward because the parent structure VkDescriptorGetInfoEXT contains
the type to use, so it is just a matter using the PARAMETER_STATE and
VALIDITY_CHECKS functionality to set & get the type when printing out the
contents of the union.
@ci-tester-lunarg
Copy link

CI VulkanTools build queued with queue ID 23965.

@ci-tester-lunarg
Copy link

CI VulkanTools build # 2624 running.

@ci-tester-lunarg
Copy link

CI VulkanTools build # 2624 failed.

@charles-lunarg
Copy link
Contributor Author

I reran the CI job, and it has succeeded. Going to go ahead and merge.

@charles-lunarg charles-lunarg merged commit f68090c into LunarG:main Aug 18, 2023
7 checks passed
@charles-lunarg charles-lunarg deleted the api_dump_respect_descriptor_type branch August 18, 2023 22:21
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.

API_Dump layer does not properly handle the union in VkDescriptorDataEXT
2 participants