LunarG/VulkanTools

API_Dump layer does not properly handle the union in VkDescriptorDataEXT

MagicPoncho opened this issue · 4 comments

When using the accelerationStructure member of VkDescriptorDataEXT, the layer crashes trying to resolve the pointers for the other members of the union. The layer should switch and only show information on the appropriate member of the union.

Thank you for reporting the bug!

So API dump's union implementation will print the values of every member because there is not an obvious way to determine the active union member. Most unions active member is determined by external mechanisms, whether that is in the parent structure or even stored in various vulkan objects. That is to say - API Dump's current implementation is naive but wasn't a problem because there hasn't been pointers in unions until now.

Fixing this is an involved change since it requires piping information around. Not impossible, but not a quick fix either.

@MagicPoncho Are you able to build & run API Dump locally? Because it'd be great if you could check if the PR fixes the crash.

Absolutely, I'll have a look as soon as I get a chance!

I see no more crash! And it only outputs the relevant part of the union, I'd call that a win. Thanks!