www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - having troubles with D and Vulkan.

reply Danni Coy <danni.coy gmail.com> writes:
I am trying to run through the basic Vulkan triangle demo. I am getting stuck at
vkGetDeviceQueue which segfaults for me.
I have written the same tutorial to about the same point in C and I am
not getting the segfault.
I have enabled validation layers and they are not picking up anything.

Any suggestions?
Jul 18 2023
parent reply harakim <harakim gmail.com> writes:
On Wednesday, 19 July 2023 at 02:50:05 UTC, Danni Coy wrote:
 I am trying to run through the basic Vulkan triangle demo. I am 
 getting stuck at
 vkGetDeviceQueue which segfaults for me.
 I have written the same tutorial to about the same point in C 
 and I am
 not getting the segfault.
 I have enabled validation layers and they are not picking up 
 anything.

 Any suggestions?
I was able to get through the triangle demo a while back. I feel like it's more of a D question than a Vulkan library question. You'll have to post your code so people can tell what it is. Just a hunch, but it's probably something that the gc is collecting before it is used.
Jul 18 2023
next sibling parent Danni Coy <danni.coy gmail.com> writes:
 I was able to get through the triangle demo a while back. I feel
 like it's more of a D question than a Vulkan library question.
 You'll have to post your code so people can tell what it is. Just
 a hunch, but it's probably something that the gc is collecting
 before it is used.
What's the best way to post code? I am mostly not using the GC, using std.experimental.allocator specifically mallocator to allocate other than using std.exception.enforce.
Jul 19 2023
prev sibling parent reply Danni Coy <danni.coy gmail.com> writes:
https://pastebin.com/JxxJufNB
Jul 19 2023
parent reply Mike Shah <mshah.475 gmail.com> writes:
On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
 https://pastebin.com/JxxJufNB
What platform are you using, and how are you trying to build? I can try to replicate on my end.
Jul 19 2023
next sibling parent Danni Coy <danni.coy gmail.com> writes:
On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via Digitalmars-d-learn
<digitalmars-d-learn puremagic.com> wrote:
 On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
 https://pastebin.com/JxxJufNB
What platform are you using, and how are you trying to build? I can try to replicate on my end.
I am on Manjaro Linux with an AMD RX 6600 using the open source driver. I am building with visual studio code and dub. I get segfaults when building with dmd or ldc. The following C code https://pastebin.com/2XJbjzMw does not cause a segfault on the same system. Other code you will need to build https://pastebin.com/hx2GD1DL Build settings (from dub.json) { "dependencies": { "bindbc-opengl": "~>1.0", "bindbc-sdl": "~>1.0", "erupted": "~>2.1.98+v1.3.248" }, "versions": [ "SDL_206", "GL_32", "validateVulkan" ], "name": "subterrainian" }
Jul 19 2023
prev sibling next sibling parent Danni Coy <danni.coy gmail.com> writes:
https://pastebin.com/Jc9ZaFFs
Redid the code as an almost exact translation of the C code.
should be easier to test and compare. Same issue is occurring.

On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via Digitalmars-d-learn
<digitalmars-d-learn puremagic.com> wrote:
 On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
 https://pastebin.com/JxxJufNB
What platform are you using, and how are you trying to build? I can try to replicate on my end.
Jul 19 2023
prev sibling parent reply Danni Coy <danni.coy gmail.com> writes:
ok found it, I am an idiot, (really not used to working with dynamic libraries).

erupted needs a call to load device level functions.

loadDeviceLevelFunctions(instance);

On Thu, Jul 20, 2023 at 4:22 PM Danni Coy <danni.coy gmail.com> wrote:
 https://pastebin.com/Jc9ZaFFs
 Redid the code as an almost exact translation of the C code.
 should be easier to test and compare. Same issue is occurring.

 On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via Digitalmars-d-learn
 <digitalmars-d-learn puremagic.com> wrote:
 On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
 https://pastebin.com/JxxJufNB
What platform are you using, and how are you trying to build? I can try to replicate on my end.
Jul 19 2023
parent reply harakim <harakim gmail.com> writes:
On Thursday, 20 July 2023 at 06:27:13 UTC, Danni Coy wrote:
 ok found it, I am an idiot, (really not used to working with 
 dynamic libraries).

 erupted needs a call to load device level functions.

 loadDeviceLevelFunctions(instance);

 On Thu, Jul 20, 2023 at 4:22 PM Danni Coy <danni.coy gmail.com> 
 wrote:
 https://pastebin.com/Jc9ZaFFs
 Redid the code as an almost exact translation of the C code.
 should be easier to test and compare. Same issue is occurring.

 On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via 
 Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:
 On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
 https://pastebin.com/JxxJufNB
What platform are you using, and how are you trying to build? I can try to replicate on my end.
Good work! Now I can rest in peace tonight. :D
Jul 20 2023
parent Mike Shah <mshah.475 gmail.com> writes:
On Friday, 21 July 2023 at 02:22:56 UTC, harakim wrote:
 On Thursday, 20 July 2023 at 06:27:13 UTC, Danni Coy wrote:
 ok found it, I am an idiot, (really not used to working with 
 dynamic libraries).

 erupted needs a call to load device level functions.

 loadDeviceLevelFunctions(instance);

 On Thu, Jul 20, 2023 at 4:22 PM Danni Coy 
 <danni.coy gmail.com> wrote:
 https://pastebin.com/Jc9ZaFFs
 Redid the code as an almost exact translation of the C code.
 should be easier to test and compare. Same issue is occurring.

 On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via 
 Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:
 [...]
Good work! Now I can rest in peace tonight. :D
Same for me :) Great to see folks working in Vulkan with D.
Jul 23 2023