Skip to content

Commit 653a3a7

Browse files
committed
fix(resolve): seed req_types from command parameter types for Vulkan
Extensions like VK_EXT_shader_object absorb commands from other extensions (e.g. vkCmdSetViewportSwizzleNV from VK_NV_viewport_swizzle) without selecting those extensions or their types. This left parameter types like VkViewportSwizzleNV absent from req_types, causing missing typedef errors when compiling the generated header. Fix by seeding req_types with the type_name of every selected command's parameters before the fixpoint type expansion runs, so transitively required types are included regardless of which extension originally defined them. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
1 parent b419f37 commit 653a3a7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/resolve.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,22 @@ fn resolve_feature_set(
477477
// handle) are also treated as seeds for the expansion.
478478
if is_vulkan {
479479
let type_names: HashSet<&str> = raw.types.iter().map(|t| t.name.as_str()).collect();
480+
481+
// Seed req_types with parameter and return types from all selected commands.
482+
// This catches types that are only referenced as command parameters rather
483+
// than being explicitly listed in <require><type> blocks — e.g.
484+
// VkViewportSwizzleNV appears only as a parameter of vkCmdSetViewportSwizzleNV,
485+
// which VK_EXT_shader_object pulls in without also selecting VK_NV_viewport_swizzle.
486+
for &cmd_name in &all_cmd_names {
487+
if let Some(raw_cmd) = raw.commands.get(cmd_name) {
488+
for param in &raw_cmd.params {
489+
if !param.type_name.is_empty() {
490+
req_types.insert(param.type_name.clone());
491+
}
492+
}
493+
}
494+
}
495+
480496
loop {
481497
let mut added = false;
482498
for t in &raw.types {

0 commit comments

Comments
 (0)