www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Vulkan

reply Ivan Trombley <itrombley dot-borg.org> writes:
I wanted to do some experimentation with Vulkan using D. None of 
the projects that I found (derelict-vulkan, d-vulkan and erupted) 
work.

Are there D bindings to Vulkan that actually work?
Feb 13 2018
next sibling parent reply Danni Coy <danni.coy gmail.com> writes:
On Wed, Feb 14, 2018 at 8:20 AM, Ivan Trombley via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 I wanted to do some experimentation with Vulkan using D. None of the
 projects that I found (derelict-vulkan, d-vulkan and erupted) work.

 Are there D bindings to Vulkan that actually work?
strictly speaking you don't need a binding, you can access C code directly as long as you write compatible header definitions for the parts of vulkan you are actually using in your code. eg extern(C) int someExternalCLibraryFunction (); auto a = someExternalCLibraryFunction(); Just make sure that you link to that C Library when you build. If you do this on an as needed basis It's not too painful.
Feb 13 2018
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 13/02/2018 10:54 PM, Danni Coy wrote:
 
 On Wed, Feb 14, 2018 at 8:20 AM, Ivan Trombley via Digitalmars-d 
 <digitalmars-d puremagic.com <mailto:digitalmars-d puremagic.com>> wrote:
 
     I wanted to do some experimentation with Vulkan using D. None of the
     projects that I found (derelict-vulkan, d-vulkan and erupted) work.
 
     Are there D bindings to Vulkan that actually work?
 
 
 strictly speaking you don't need a binding, you can access C code 
 directly as long as you write compatible header definitions for the 
 parts of vulkan you are actually using in your code.
Which is then called a binding ;)
Feb 13 2018
next sibling parent Danni Coy <danni.coy gmail.com> writes:
On Wed, Feb 14, 2018 at 2:26 PM, rikki cattermole via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 On 13/02/2018 10:54 PM, Danni Coy wrote:

 On Wed, Feb 14, 2018 at 8:20 AM, Ivan Trombley via Digitalmars-d <
 digitalmars-d puremagic.com <mailto:digitalmars-d puremagic.com>> wrote:

     I wanted to do some experimentation with Vulkan using D. None of the
     projects that I found (derelict-vulkan, d-vulkan and erupted) work.

     Are there D bindings to Vulkan that actually work?


 strictly speaking you don't need a binding, you can access C code
 directly as long as you write compatible header definitions for the parts
 of vulkan you are actually using in your code.
Which is then called a binding ;)
The programmers I work with like to differentiate between situations where you can call code directly and when you have to do stuff like marshalling to get code in one language to talk to code in another language so I tend not to think of writing header definitions as making bindings.
Feb 16 2018
prev sibling parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Saturday, February 17, 2018 13:52:06 Danni Coy via Digitalmars-d wrote:
 On Wed, Feb 14, 2018 at 2:26 PM, rikki cattermole via Digitalmars-d <

 digitalmars-d puremagic.com> wrote:
 On 13/02/2018 10:54 PM, Danni Coy wrote:
 On Wed, Feb 14, 2018 at 8:20 AM, Ivan Trombley via Digitalmars-d <

 digitalmars-d puremagic.com <mailto:digitalmars-d puremagic.com>> 
wrote:
     I wanted to do some experimentation with Vulkan using D. None of
     the
     projects that I found (derelict-vulkan, d-vulkan and erupted) work.

     Are there D bindings to Vulkan that actually work?

 strictly speaking you don't need a binding, you can access C code
 directly as long as you write compatible header definitions for the
 parts
 of vulkan you are actually using in your code.
Which is then called a binding ;)
The programmers I work with like to differentiate between situations where you can call code directly and when you have to do stuff like marshalling to get code in one language to talk to code in another language so I tend not to think of writing header definitions as making bindings.
Well, in D-speak, C header definitions rewritten as D so that D can call the C functions are exactly what bindings are, whereas if bindings are wrapped in D code to make them more D-like, those are called wrappers. I don't know that there's a specific term for a case where marshalling is involved. - Jonathan M Davis
Feb 16 2018
parent rumbu <rumbu rumbu.ro> writes:
On Saturday, 17 February 2018 at 05:52:38 UTC, Jonathan M Davis 
wrote:

 Well, in D-speak, C header definitions rewritten as D so that D 
 can call the C functions are exactly what bindings are, whereas 
 if bindings are wrapped in D code to make them more D-like, 
 those are called wrappers. I don't know that there's a specific 
 term for a case where marshalling is involved.
Dynamic binding?
Feb 16 2018
prev sibling next sibling parent reply flamencofantasy <flamencofantasy gmail.com> writes:
On Tuesday, 13 February 2018 at 22:20:15 UTC, Ivan Trombley wrote:
 I wanted to do some experimentation with Vulkan using D. None 
 of the projects that I found (derelict-vulkan, d-vulkan and 
 erupted) work.

 Are there D bindings to Vulkan that actually work?
Maybe these work, not sure; https://github.com/Rikarin/VulkanizeD
Feb 13 2018
parent Ivan Trombley <itrombley dot-borg.org> writes:
On Wednesday, 14 February 2018 at 00:22:25 UTC, flamencofantasy 
wrote:
 Maybe these work, not sure;

 https://github.com/Rikarin/VulkanizeD
Thanks, I'll check this out.
Feb 16 2018
prev sibling next sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Tuesday, 13 February 2018 at 22:20:15 UTC, Ivan Trombley wrote:
 I wanted to do some experimentation with Vulkan using D. None 
 of the projects that I found (derelict-vulkan, d-vulkan and 
 erupted) work.

 Are there D bindings to Vulkan that actually work?
What doesn't it mean to say they don't work? Have you reported any issues? I don't see any in the DerelictVulkan repo. If something's broken, please report it so it can be fixed.
Feb 13 2018
next sibling parent Mike Parker <aldacron gmail.com> writes:
On Wednesday, 14 February 2018 at 02:40:18 UTC, Mike Parker wrote:

 What doesn't it mean
Eh, what *does* it mean.
Feb 13 2018
prev sibling parent reply Ivan Trombley <itrombley dot-borg.org> writes:
On Wednesday, 14 February 2018 at 02:40:18 UTC, Mike Parker wrote:
 What [does] it mean to say they don't work? Have you reported 
 any issues? I don't see any in the DerelictVulkan repo. If 
 something's broken, please report it so it can  be fixed.
Derelict-vulkan is Windows only ATM.
Feb 16 2018
next sibling parent Zoadian <no no.no> writes:
On Friday, 16 February 2018 at 22:58:30 UTC, Ivan Trombley wrote:
 On Wednesday, 14 February 2018 at 02:40:18 UTC, Mike Parker 
 wrote:
 What [does] it mean to say they don't work? Have you reported 
 any issues? I don't see any in the DerelictVulkan repo. If 
 something's broken, please report it so it can  be fixed.
Derelict-vulkan is Windows only ATM.
Actually someone added posix support. Just forgot to flag a new release. (I did not test posix support myself yet). If there are other issues please file them on GitHub.
Feb 16 2018
prev sibling parent Rubn <where is.this> writes:
On Friday, 16 February 2018 at 22:58:30 UTC, Ivan Trombley wrote:
 On Wednesday, 14 February 2018 at 02:40:18 UTC, Mike Parker 
 wrote:
 What [does] it mean to say they don't work? Have you reported 
 any issues? I don't see any in the DerelictVulkan repo. If 
 something's broken, please report it so it can  be fixed.
Derelict-vulkan is Windows only ATM.
The only difference is the one specific function for creating the surface. You are better off using something like SDL2 for creating the window anyways, which takes care of the only OS specific code of vulkan. None of the types also have default value set to the proper value. https://github.com/Zoadian/DerelictVulkan/blob/master/source/derelict/vulkan/types.d#L1102 It's not that difficult to add though, the name of the struct name is pretty much the type enum name but with all caps and underscores. A simple regex replace and formatting easily adds most of them.
Feb 16 2018
prev sibling parent Peter Campbell <peter spcampbell.co.uk> writes:
On Tuesday, 13 February 2018 at 22:20:15 UTC, Ivan Trombley wrote:
 I wanted to do some experimentation with Vulkan using D. None 
 of the projects that I found (derelict-vulkan, d-vulkan and 
 erupted) work.

 Are there D bindings to Vulkan that actually work?
I had success using Vulkan in University by using Derelict-GLFW3 and Erupted, what issues did you have with them?
Feb 17 2018