-
Notifications
You must be signed in to change notification settings - Fork 8
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
Creating swapchain gives SIGSEGV / segfault #5
Comments
I tried to allocate my swapchain variable manually as described here: https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types but that didn't prevent the SIGSEGV either. |
Vulkan wrappers for other languages also implement it differently, for example this haskell binding: http://hackage.haskell.org/package/vulkan-2.1.0.0/docs/src/Graphics.Vulkan.Extensions.VK_KHR_swapchain.html#VkSwapchainKHR_T implements it as a pointer to VkSwapchainKHR_T, while this rust binding: https://docs.rs/vks/0.20.0/src/vks/khr_swapchain.rs.html#26 implements it as a struct to be defined by VK_DEFINE_NON_DISPATCHABLE_HANDLE. |
So according to https://stackoverflow.com/questions/43741998/what-does-vk-define-non-dispatchable-handle-mean and https://github.com/KhronosGroup/Vulkan-Docs/blob/1.0/src/vulkan/vulkan.h#L56 , |
If it helps here is the relevant code: https://gitlab.com/n0tknot/wyven/blob/master/src/engine/window.nim#L221 |
Hey Clyybber, thanks for looking into this - I didn't have time yet to take a look myself, but will try to do so soon! |
In the generated C code the type |
Hey Clybber, sorry, I still haven't had any time to look into this. Too much going on right now :/ |
No worries, thank you anyways. I wish I could fix it myself, but I can't figure it out. |
Had a quick look. First, my definition of Now, the swap chain values that the KHR functions take and return are opaque handles, meaning that we don't actually have to know what they mean under the hood.... could be pointers to structs, could be index numbers into a container, could be a hash value, could be a key into a map, etc. I'm thinking that we should get rid of the Can you give that a try? |
Just tried that, still gives a segfault. Maybe this is an upstream bug, but I can't confirm it since I can't rule out buggy drivers(the examples and demos work though). |
I'm dumb as fuck :D Because I used my own function wrapping the creation of a swapchain wrongly, a physical device was passed to Sry that I have bothered you with this so long |
Maybe we should make some of those alias types for |
@Clyybber make an issue at https://github.com/KhronosGroup/Vulkan-ValidationLayers ? |
EDIT: There never was an issue, I was dumb enough to pass a physical device to
vkCreateSwapchainKHR
If trying to create a swapchain with
vkCreateSwapchainKHR(device, addr createInfo, nil, addr swapchain)
whereswapchain
is of typeVkSwapchainKHR
I getSIGSEGV: Illegal Storage access
.I suppose this is just me being dumb but I really can't figure out what I am doing wrong here.
The text was updated successfully, but these errors were encountered: