bbredesen / go-vk Goto Github PK
View Code? Open in Web Editor NEWA Go binding around the Vulkan graphics and compute API.
License: MIT License
A Go binding around the Vulkan graphics and compute API.
License: MIT License
Extending structures through pNext is very awkward right now, requiring the developer to set up the structure, call Vulkanize() on it, and then cast the result to unsafe.Pointer before assigning to the base structure.
The XML spec includes a "structextends" property, showing what other structs can be extended with this one. (Note that there could be multiple types, separated by commas.)
For example, VkPhysicalDeviceFeatures2 is extended by many feature extensions like VkPhysicalDevicePrivateDataFeatures, VkPhysicalDeviceVariablePointersFeatures, VkPhysicalDeviceMultiviewFeatures, etc. Each of those public-facing structs could implement a guard interface called PhysicalDeviceFeaturres2Extender (or similar), and then vk.PhysicalDeviceFeatures2.PNext would have its type set to that interface. The Vulkanize function would then handle the recursive Vulkanization and casting to unsafe.Pointer behind the scenes.
Note that there are also 70+ "returnedonly" structs that extend other structs. The fix above does NOT address structs returned from Vulkan.
The readme states that go-vk is untested on Linux, but it's currently not possible to use it at all: All surface extensions are missing. I can see that vk-gen contains the necessary platform mappings, but I don't see any files in go-vk that contain the resulting enums, commands and data structures.
Could you please make sure that all Linux-specific platform code is included in go-vk?
Thanks!
Well, I am not expert to vulkan, but there is ebiten/purego project, which can dlopen C - shared library and call func without cgo, I think that would be nice to implement ...
windows 11
golang 1.20
glfw v3.3
window, err := glfw.CreateWindow(800, 600, "vulkan", nil, nil)
instance, err := vk.CreateInstance(&createInfo, nil)
ptr, err := window.CreateWindowSurface(instance, nil)
call window.CreateWindowSurface, it report an error:
vulkan: instance is not a VkInstance (expected kind Ptr, got uintptr)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.