Vulkan bindings

Nicholas Wilson via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 24 04:45:13 PST 2016


On Thursday, 18 February 2016 at 04:11:39 UTC, ZombineDev wrote:
> On Thursday, 18 February 2016 at 03:27:55 UTC, Alex Parrill 
> wrote:
>> [...]
>
> I started working on that. I've been reading the Python C 
> Header generator code and I'm wondering if would be easier to 
> just re-implement it in D, rather than trying to extend it. 
> Currently the XML is very C oriented (e.g. has C macros in it), 
> unlike the OpenGL spec which was written in a language agnostic 
> way.
>
> The advantages of using the vk.xml is that once the generator 
> is complete you can easily adapt it for newer revisions of the 
> spec. Also you have much more freedom in how you can organize 
> the bindings (split by functions/structs/enums or logically by 
> e.g. instance, device, command recording, queues, 
> synchronization, shaders, pipelines, etc.), also it's easier to 
> do other stuff like using D's builtin types instead of cstdint, 
> generating ddoc-formatted function/struct/enum documentation 
> and also ddoc-ed unittests from the spec examples. And maybe 
> also provide two versions - one with vanilla names (easier if 
> you are following tutorials) and one that's written in D style 
> (http://dlang.org/dstyle.html) for those who prefer a more 
> uniform syntax with the rest of the other D libraries out there.
>
> I have completed the SPIR-V D header (which was trivial to 
> generate from the .json file) and I'm also hoping to translate 
> the other stuff from the LunarG SDK like the debug layers (no 
> auto-generation would be possible there).
>
> Given the advancements in the recent years of the D ecosystem 
> (dub, high quality doc generators, CT generation of 
> boilerplate, etc.), I think that D can offer even better 
> developer experience than C++ for which the API was primary 
> targeted.

Hey I've started work on a more D like vulkan

http://dpaste.dzfl.pl/1ecfa367b966

I switched to adapting Satoshi bindings
(I gave up on trying to gen it from the xml too much like hard 
work
Waaaaay too many inconsistencies )

If you have any further ideas for improvements let me know!
(I think a tool to autogen the descriptor layouts would be awesome
But that will take a while and Uni starts soon so I probably 
won't have time)

Nic



More information about the Digitalmars-d mailing list