www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Vulkan Tutorial Code uploaded to Github

reply Doug Clayton <dougclayton0242 gmail.com> writes:
Hi All,

I just uploaded a working example of Vulkan working in D (With a 
Hello World triangle) on Github for anyone interested: 
https://github.com/DougClayton4231/VulkanTutorialD

I couldn't find a working binding for Vulkan, so I hope this will 
help people get up and running and building their own 
applications.

I only set up the Vulkan and GLFW3 bindings for Windows, so 
anyone on other OSes will need to extend those bindings with the 
appropriate functions and variables for those platforms.

Big thanks to evilrat for helping me get those string arrays 
pointed to char**.
May 17 2019
next sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Friday, 17 May 2019 at 12:19:11 UTC, Doug Clayton wrote:
 Hi All,

 I just uploaded a working example of Vulkan working in D (With 
 a Hello World triangle) on Github for anyone interested: 
 https://github.com/DougClayton4231/VulkanTutorialD

 I couldn't find a working binding for Vulkan, so I hope this 
 will help people get up and running and building their own 
 applications.

 I only set up the Vulkan and GLFW3 bindings for Windows, so 
 anyone on other OSes will need to extend those bindings with 
 the appropriate functions and variables for those platforms.
Great work.
 Big thanks to evilrat for helping me get those string arrays 
 pointed to char**.
Ah yes, the old arr.map!(toStringz).array.ptr;
May 17 2019
prev sibling next sibling parent reply evilrat <evilrat666 gmail.com> writes:
On Friday, 17 May 2019 at 12:19:11 UTC, Doug Clayton wrote:
 I couldn't find a working binding for Vulkan, so I hope this 
 will help people get up and running and building their own 
 applications.
"erupted" was the only one that worked for me in the past, it was then suspended, but now it seems it's up to date again (haven't tried). Did you had any issues using it? Also in repo readme it says "Native Debug" extension needed for VS Code, well, it isn't. Just enable "allow breakpoints everywhere" in settings. Other than that it does nothing useful (at least nothing noticeable).
May 17 2019
parent reply Doug Clayton <dougclayton0242 gmail.com> writes:
On Friday, 17 May 2019 at 13:29:18 UTC, evilrat wrote:
 On Friday, 17 May 2019 at 12:19:11 UTC, Doug Clayton wrote:
 I couldn't find a working binding for Vulkan, so I hope this 
 will help people get up and running and building their own 
 applications.
"erupted" was the only one that worked for me in the past, it was then suspended, but now it seems it's up to date again (haven't tried). Did you had any issues using it? Also in repo readme it says "Native Debug" extension needed for VS Code, well, it isn't. Just enable "allow breakpoints everywhere" in settings. Other than that it does nothing useful (at least nothing noticeable).
I couldn't get the erupted bindings to work for the life of me, no matter what I tried. Also, that's good to know that the Native Debug extension isn't needed to debug the project. I'll remove that from the readme and add your info :)
May 17 2019
parent reply GoaLitiuM <goalitium dforums.mail.kapsi.fi> writes:
On Friday, 17 May 2019 at 14:46:23 UTC, Doug Clayton wrote:
 On Friday, 17 May 2019 at 13:29:18 UTC, evilrat wrote:
 On Friday, 17 May 2019 at 12:19:11 UTC, Doug Clayton wrote:
[...]
"erupted" was the only one that worked for me in the past, it was then suspended, but now it seems it's up to date again (haven't tried). Did you had any issues using it? Also in repo readme it says "Native Debug" extension needed for VS Code, well, it isn't. Just enable "allow breakpoints everywhere" in settings. Other than that it does nothing useful (at least nothing noticeable).
I couldn't get the erupted bindings to work for the life of me, no matter what I tried. Also, that's good to know that the Native Debug extension isn't needed to debug the project. I'll remove that from the readme and add your info :)
I've been using ErupteD on Windows quite a while with no problems here. What kind of issues were you having with it?
May 17 2019
parent reply Doug Clayton <dougclayton0242 gmail.com> writes:
On Friday, 17 May 2019 at 15:04:27 UTC, GoaLitiuM wrote:
 On Friday, 17 May 2019 at 14:46:23 UTC, Doug Clayton wrote:
 On Friday, 17 May 2019 at 13:29:18 UTC, evilrat wrote:
 [...]
I couldn't get the erupted bindings to work for the life of me, no matter what I tried. Also, that's good to know that the Native Debug extension isn't needed to debug the project. I'll remove that from the readme and add your info :)
I've been using ErupteD on Windows quite a while with no problems here. What kind of issues were you having with it?
Linking issues. For some reason, I couldn't get it to link with the static or dynamic libraries.
May 17 2019
parent GoaLitiuM <goalitium dforums.mail.kapsi.fi> writes:
On Friday, 17 May 2019 at 18:30:49 UTC, Doug Clayton wrote:
 On Friday, 17 May 2019 at 15:04:27 UTC, GoaLitiuM wrote:
 On Friday, 17 May 2019 at 14:46:23 UTC, Doug Clayton wrote:
 On Friday, 17 May 2019 at 13:29:18 UTC, evilrat wrote:
 [...]
I couldn't get the erupted bindings to work for the life of me, no matter what I tried. Also, that's good to know that the Native Debug extension isn't needed to debug the project. I'll remove that from the readme and add your info :)
I've been using ErupteD on Windows quite a while with no problems here. What kind of issues were you having with it?
Linking issues. For some reason, I couldn't get it to link with the static or dynamic libraries.
ErupteD doesn't require any additional linking because it also operates as the loader, replacing "vulkan-1.lib" (which is the import library for the Vulkan loader supplied by Vulkan runtime) completely. Assuming the project is using dub, you just add it as a dependency and run the required functions (shown in the example) in runtime, and you should be good to go.
May 18 2019
prev sibling parent reply KnightMare <black80 bk.ru> writes:
 I just uploaded a working example of Vulkan working in D (With 
 a Hello World triangle) on Github for anyone interested...
about enums: enum SpvCapability_ { SpvCapabilityMatrix = 0, ... }; // code sample obj.someCaps = SpvCapability_.SpvCapabilityMatrix; IMO better/understandable_enough: enum SpvCapability { Matrix = 0, ... }; // code sample obj.someCaps = SpvCapability.Matrix;
May 18 2019
parent Doug Clayton <dougclayton0242 gmail.com> writes:
On Saturday, 18 May 2019 at 14:25:27 UTC, KnightMare wrote:
 I just uploaded a working example of Vulkan working in D (With 
 a Hello World triangle) on Github for anyone interested...
about enums: enum SpvCapability_ { SpvCapabilityMatrix = 0, ... }; // code sample obj.someCaps = SpvCapability_.SpvCapabilityMatrix; IMO better/understandable_enough: enum SpvCapability { Matrix = 0, ... }; // code sample obj.someCaps = SpvCapability.Matrix;
Ah, I actually forgot to alias all of the enums in the spirv bindings correctly so that they can be accessed globally, like they would be in C++. I'll upload the fixes today. I didn't alter any of the enum names from the original source in order to maintain a 1:1 binding. Otherwise, when people are following other people's code, the names would be completely different. Thanks, Doug
May 21 2019