Skip to content

fix(vk-gen): generate image layout, clear image and fd properties wrappers - #376

Merged
kolkov merged 3 commits into
gogpu:mainfrom
stubbedev:fix/vk-gen-missing-signatures
Nov 2, 2026
Merged

kolkov merged 3 commits into
gogpu:mainfrom
stubbedev:fix/vk-gen-missing-signatures

Conversation

@stubbedev

Copy link
Copy Markdown
Contributor

vk-gen skipped vkGetImageSubresourceLayout, vkCmdClearColorImage and vkGetMemoryFdPropertiesKHR as unsupported signatures, so the vk package could not call them. Their signatures now map to new call interfaces (C int params classify as i32), which also generates vkGetImageSparseMemoryRequirements, vkGetImageSubresourceLayout2, vkGetMicromapBuildSizesEXT and vkCmdClearDepthStencilImage. Builds on #372 (the int32 fd type); the GPU tests skip without a Vulkan driver.

vk-gen had no mapping for C int, so it fell through to Go's 64-bit int.
vkGetMemoryFdKHR, vkGetSemaphoreFdKHR and vkGetFenceFdKHR wrote a 32-bit
fd into the low half of an int64, leaving the upper half undefined, and
the import fd structs and VkNativeBufferANDROID had the wrong layout.
…ppers

vk-gen skipped vkGetImageSubresourceLayout, vkCmdClearColorImage and
vkGetMemoryFdPropertiesKHR as unsupported signatures, so the vk package
had no way to call them. Map their signatures to new call interfaces and
classify C int as i32. The same signatures also cover
vkGetImageSparseMemoryRequirements, vkGetImageSubresourceLayout2,
vkGetMicromapBuildSizesEXT and vkCmdClearDepthStencilImage.
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

syscall.Close takes a syscall.Handle on Windows, so the shared test file did
not compile there. Dma-buf file descriptors exist only on Linux; move
TestGetMemoryFdPropertiesKHR and its structure type into
generated_wrappers_linux_test.go.
@kolkov
kolkov merged commit 686248e into gogpu:main Nov 2, 2026
15 checks passed
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.

2 participants