You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to work, but I'm unsure how to correctly convert Ptr (Vk.SomeStruct a) to the type (Vk.Extendss b es) => (a b es), I think I want to use peekSomeCStruct , but the return type is still just SomeStruct?
I'm struggling to piece all the parts together, I don't feel very confident with my understanding of the higher level polymorphic types, and grepping the source code I can't find many examples of my use case.
Any help would be much appreciated.
Also as an aside, I have a hunch due to the nature of vulkan layers, I need to recompile this library with safe calls?
Is there any specific thing that you want to do with the struct or its extensions?
If you only need the first layer and let the rest pass through, then you're set. SomeStruct will hide the chain so you wouldn't be bothered by the rest.
If you want to find some particular extension in the pNext chain that would involve some more dancing.
Try to create an extended structure, poke it to a buffer, then experiment in REPL with whatever the Extends module provides.
You may want to cast your ptr to BaseInStructure and manually iterate on its sType/next until you find the STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO (or other thing) you need, then use its ptr from next to peek a known type.
Activity
dpwiz commentedon Mar 21, 2026
Is there any specific thing that you want to do with the struct or its extensions?
If you only need the first layer and let the rest pass through, then you're set.
SomeStructwill hide the chain so you wouldn't be bothered by the rest.If you want to find some particular extension in the pNext chain that would involve some more dancing.
Try to create an extended structure, poke it to a buffer, then experiment in REPL with whatever the
Extendsmodule provides.YellowOnion commentedon Mar 21, 2026
There's a few things that need to be done with
VkLayerInstanceCreateInfo, from my understanding this is core to making any sort of layer.I eventually got something "working", ended up with this error:
Here's the code:
I guess
VkLayerInstanceCreateInfois missing fromvulkan, this seems to be provided byvk_layer.h, notvulkan.h, this would need a fix right?I can probably create an type class instance for it, but with the way peekChainHead uses pattern matching, it would need a fix in that to fully work.
Edit: corrected to
VkLayerInstanceCreateInfodpwiz commentedon Mar 21, 2026
You may want to cast your ptr to BaseInStructure and manually iterate on its
sType/nextuntil you find theSTRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO(or other thing) you need, then use its ptr from next to peek a known type.dpwiz commentedon Mar 21, 2026
If you manage to get it working, I'm happy to accept a new
vulkan-layerpackage (=YellowOnion commentedon Mar 22, 2026
BTW I found another URI for accessing the matrix channel, so if you want to talk there it might be easier for me.