-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is Vulkan renderer supposed to be working with LZDoom? #20
Comments
You mean the master branch? Yes, but it's vid_preferbackend 1. |
@drfrag666 I mean the master branch in this LZDoom fork, yes. |
Try adding +vid_preferbackend 1 on the command line. And does it work with GZDoom? I think it's pretty much the same code tough. |
If Vulkan fails it will fall back to OpenGL, probably your card doesn't support Vulkan properly. |
Put a breakpoint at the following line, and check if
If breakpoint isn't hit, check SDL2 library loading at the following line.
|
This is what happens when I pass the
The Pi4 supports Vulkan and it's certified for it: Other Vulkan games, like vkQuake, vkQuake3, etc... work here, so it doesn't seem to be a problem with the platform itself. |
Where is the exception thrown exactly? |
@alexey-lysiuk after
I am puzzled because (appart from the Pi4 working fine with the likes of vQuake, vQuaye3, rtc) I don't see any call to KMSDRM_Vulkan_CreateSurface(), which means you are not using SDL2 calls to create the Vulkan surface, are you? |
The "No Vulkan device supports the minimum requirements of this application" message means that while it did detect a vulkan device, the device did not support the feature set required. Those requirements are: VkPhysicalDeviceFeatures.samplerAnisotropy must be true, The question is, which of those does the Pi4 not support? |
I set a bp on
I don't even know what depthClamp is, to be honest. |
The Vulkan code is the same as in GZDoom. I don't know if anyone is running Vulkan on the Pi4. |
The depth clamp (it's the feature provided by glEnable(GL_DEPTH_CLAMP) in OpenGL) is used for portals. GZDoom should be able to run without it, although portals will then have visual glitches. If you just want to test things, you could remove the check for depthClamp. There may be a need to check if the feature is available when depthClamp is enabled if you remove the check though. Knowing Vulkan it will probably be an undefined behavior to set depthClamp to true in the pipeline if it's not requested on device creation. |
@dpjudas I tried to remove the check, and I get this:
So I guess it's not enough and it's trying to use something that doesn't exist, right? My guess is that, as I said, you are not using the X11-less VK extension, as SDL2 does. |
It crashes inside Vulkan driver's implementation of
GZDoom uses extensions reported by SDL_Vulkan_GetInstanceExtensions() function. |
I got this after doing
Let me insist on SDL2 Vulkan code: you are using This is how SDL2 manages Vulkan surface creation WITHOUT X11: vkQuake3 uses It's better for you too, since it makes the code simpler as you don't have to create the Vulkan surface yourself. |
That fatal error message doesn’t tell me anything without a backtrace. Regarding surface creation, Vulkan renderer works for me when running GZDoom on Ubuntu 20.04 x64 with open source Intel and proprietary NVIDIA drivers. |
I see no errors at all while debugging functions in that block. I have however been debugging The segfault is caused by the This is the state of the parameters passed to vkCreateImageView(), just before the call that causes the segfault:
After that, it comes the |
Number of times
Also, may I ask you to post output of |
Based on the call stack of the crash point, the problem seems to be that either the vulkan driver has a faulty VK_FORMAT_A2R10G10B10_UNORM_PACK32 image format implementation or doesn't support this image format at all. I couldn't quickly find where it states in the vulkan spec what formats are required to support (if any). It may be that gzdoom needs to call vkGetPhysicalDeviceFormatProperties on every VK_FORMAT that it intends to use to figure out if it can be used at all? You can check if it indeed is a problem with this format by using a different one. Replace VK_FORMAT_A2R10G10B10_UNORM_PACK32 with VK_FORMAT_R8G8B8A8_UNORM in the following locations: src\common\rendering\vulkan\renderer\vk_renderbuffers.cpp(215): builder.setFormat(VK_FORMAT_A2R10G10B10_UNORM_PACK32); |
Okay, I found the place in the spec where it lists the required formats to support and VK_FORMAT_A2R10G10B10_UNORM_PACK32 is indeed not among them. So that's what the problem is. |
I created a PR with those changes to GZDoom: ZDoom#1359 |
Merged. |
Boots on the Pi4 now. Looks fine until a game is started: then screen appears totally garbled (except for HUD, which looks fine). Am I the only person trying this on a Pi4 in Vulkan mode? |
I didn't test it as I don't own a Pi4. My PR was purely based on the issues that were identified by your initial debugging (the missing depthclamp support and the image creation crash) and fixing those things to be in line with the vulkan spec. Is there no validation layer (vk_debug 1) for the pi4? I can only repeat what alexy said: this requires active debugging from someone with the device and the interest to figure out where things go wrong. Garbled output of only the 3D scene indicates it could be a problem with the vertex format, or the uniform buffers, or more. It's hard to say for sure. |
Works fine for me on GZDoom. It is slow, however, and requires you to enter It works fine outside of a few glitches. However, it is extremely slow and that is to be expected with the Pi. I'm sure you'll have to disable a lot of shaders to get it running at a decent speed. At 768x400 using X11 I got 15 fps. It was magnitudes slower at any higher resolution. |
But did it work before dpjudas' PR? I suspect @vanfanel is not using the latest driver. |
For me? No it did not. |
@drfrag666 I am using the latest driver here. I wouldn't report anything without building and installing latest libDRM and MESA. |
The garbled screen could be due to the different default light mode then. I dunno, try setting gl_lightmode to 3. |
I have built current GIT version to try @drfrag666 suggestion, and now I see this exception being thrown:
It wasn't happening before. Any idea on what has changed? |
That means you are running on a system that does not support Vulkan, and no one bothered to put in a |
Ah, got it working. Now, even in-game graphics look good! :) |
Well, no. Vulkan works fine here, thanks :) |
It threw an unhandled exception which is a bug which still needs to be fixed. It should error out gracefully with the message instead of forcing you to dig the message out of a backtrace. |
Hi there!
I have just build LZDoom from current GIT on my Pi4, which has a working Vulkan MESA implementation (many other games work with it).
Looking at CMakeLists.txt, it seems that VULKAN support is enabled by default.
However, if I lauch LZDoom, and change the video renderer to "vulkan", and launch it again, I get:
At least OpenGL 3.3 is required...
So, is VULKAN supposed to be working?
Also, I believe VULKAN's
vid_rendermode
value in lzdoom.ini is 4, right?The text was updated successfully, but these errors were encountered: