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

Binding allocated return vals need to be Vulkanized before trampoline #23

Closed
bbredesen opened this issue Feb 27, 2023 · 0 comments · Fixed by #27
Closed

Binding allocated return vals need to be Vulkanized before trampoline #23

bbredesen opened this issue Feb 27, 2023 · 0 comments · Fixed by #27
Assignees
Labels
bug/med Needs fixing but there is a possible workaround

Comments

@bbredesen
Copy link
Owner

bbredesen commented Feb 27, 2023

Error found with GetPhysicalDeviceFeatures2, bug presumably affects any command that requires a structure to be populated by Vulkan.

Current code:

var pFeatures _vkPhysicalDeviceFeatures2
ptr_pFeatures := &pFeatures

execTrampoline(keyvkGetPhysicalDeviceFeatures2, uintptr(physicalDevice), uintptr(unsafe.Pointer(ptr_pFeatures)))

features = *(pFeatures.Goify())

In the example above, Vulkan will silently fail and not modify the struct because pFeatures does not have sType set. (Not sure why it isn't caught by validation layers, but that isn't the issue here.)

Need to modify vk-gen output to allocate that struct and call Vulkanize() before the trampoline call, something like:

pFeatures := (&PhysicalDeviceFeatures2{}).Vulkanize()

execTrampoline(keyvkGetPhysicalDeviceFeatures2, uintptr(physicalDevice), uintptr(unsafe.Pointer(pFeatures)))

features = *(pFeatures.Goify())
return
@bbredesen bbredesen added the bug/med Needs fixing but there is a possible workaround label Feb 27, 2023
@bbredesen bbredesen self-assigned this Feb 27, 2023
@bbredesen bbredesen transferred this issue from bbredesen/go-vk Mar 8, 2023
bbredesen added a commit that referenced this issue Mar 9, 2023
Internal conv. of vk-populated vals. Fixes #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/med Needs fixing but there is a possible workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant