destrostudios / ice-tea-engine

A 3D engine written in Java using Vulkan via LWJGL.
8 stars 1 forks source link

Crash on launching #1

Open Protoxy22 opened 2 months ago

Protoxy22 commented 2 months ago

Hi, your engine looks promising and I wanted to test it

I get a crash when starting TestImGui, or others Tests classes I may think it's because of a Vulkan validation layer or something like that, but I don't know how to configure it Have you any idea ? Thanks

---------------  S U M M A R Y ------------

Command Line: -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2024.1\lib\idea_rt.jar=51063:C:\Program Files\JetBrains\IntelliJ IDEA 2024.1\bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.destrostudios.icetea.test.TestImGui

Host: AMD Ryzen 9 7900X 12-Core Processor            , 24 cores, 31G,  Windows 10 , 64 bit Build 19041 (10.0.19041.3636)
Time: Mon Jun 24 21:06:02 2024 Romance Summer Time elapsed time: 0.610354 seconds (0d 0h 0m 0s)

---------------  T H R E A D  ---------------

Current thread (0x00000273df583990):  JavaThread "main"             [_thread_in_native, id=9604, stack(0x000000fdcaa00000,0x000000fdcab00000) (1024K)]

Stack: [0x000000fdcaa00000,0x000000fdcab00000],  sp=0x000000fdcaafdb28,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x000000fdcaafee80  (no source info available)

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.system.JNI.callPPPPI(JJJJJ)I+0
j  org.lwjgl.vulkan.KHRSwapchain.nvkCreateSwapchainKHR(Lorg/lwjgl/vulkan/VkDevice;JJJ)I+31
j  org.lwjgl.vulkan.KHRSwapchain.vkCreateSwapchainKHR(Lorg/lwjgl/vulkan/VkDevice;Lorg/lwjgl/vulkan/VkSwapchainCreateInfoKHR;Lorg/lwjgl/vulkan/VkAllocationCallbacks;Ljava/nio/LongBuffer;)I+24
j  com.destrostudios.icetea.core.SwapChain.initSwapChain()V+463
j  com.destrostudios.icetea.core.SwapChain.initNative()V+15
j  com.destrostudios.icetea.core.object.NativeObject.updateNative(Lcom/destrostudios/icetea/core/Application;)V+13
j  com.destrostudios.icetea.core.Application.create()V+271
j  com.destrostudios.icetea.core.Application.start()V+1
j  com.destrostudios.icetea.test.TestImGui.main([Ljava/lang/String;)V+7
v  ~StubRoutines::call_stub 0x00000273eed2100d

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), data execution prevention violation at address 0x000000fdcaafee80
destroflyer commented 1 month ago

Hi @Protoxy22,

sadly this stack trace doesn't provide a lot of info. What makes you think the error is related to validation layers? The validation layers can be enabled in the configs via config.setEnableValidationLayer(true); (e.g. in the application class constructor) - The test classes I added usually set this to true, so maybe it helps to turn it off? To use the validation layers, you need to have them installed on your machine, maybe you didn't do this first. They can be installed with the Vulkan SDK (https://www.lunarg.com/vulkan-sdk).

In fact, that you didn't provide any errors from said validation layers makes me think, that they are indeed not properly setup/installed. Because these validation layers print warnings if some Vulkan methods like the vkCreateSwapchainKHR that crashes your application get called with arguments that aren't in the proper state. In other words: Usually, if a Vulkan method like vkCreateSwapchainKHR crashes, there will be a warning from the validation layer in the application logs with some details. But your post also doesn't contain the "normal" logs from the engine, so I wonder if those are printed correctly in your setup/IDE.

If all of this doesn't help, I can also add a bunch of logging so we can see what your hardware specs exactly are and what might not be supported in my default setup, but I doubt it will be super helpful.

In general, I'm not a huge Vulkan expert and am learning along the way - The engine is currently setup in a way that runs on my machine and a few others where I have been able to test it. But there will be for sure some things, that will not run immediately on all hardwares and that need to be abstracted. Let's hope this is not the case here :)

Kind regards