Closed cacophany53 closed 2 years ago
Your issue is somewhat inconsistent. The title says "Vulkan NullPointerException on Ubuntu with AMD Radeon" however in your text you are writing "LWJGL application running Vulkan code on Apple M1 chip (MacOS) throws a NullPointerException here". Which OS does the error occur? Linux/Ubuntu or macOS?
If macOS, then note that macOS does not provide a Vulkan 1.3 implementation natively. When you run your Vulkan/LWJGL3 application under macOS, the adaptation layer https://github.com/KhronosGroup/MoltenVK is being used, which translates Vulkan 1.1 API calls to Metal. MotelVK does not provide a Vulkan 1.3 implementation. Only Vulkan 1.1, and that also with certain restrictions. So, the MoltenVK Vulkan instance simply does not expose that function (i.e. "dynamic graphics pipelines").
My apologies, that was a copy and paste error from a previous issue submission. In this case it is indeed Ubuntu (original post updated).
Thanks for the information regarding MoltenVK for MAC, as that likely applies to my other issue.
With regards to Linux, do you have any advice on this NullPointerException?
Thanks.
Hey @cacophany53,
The most likely reason is that the AMD driver on Linux does not support Vulkan 1.3 (or did not when you tested it). When using versioned APIs like OpenGL or Vulkan, applications should examine the flags in the "capabilities" classes before using the corresponding core or extension functionality. In this case, see the VKCapabilitiesDevice.Vulkan13
flag.
Version
3.3.0 (nightly)
Platform
Linux x64
JDK
openjdk version "11.0.14" 2022-01-18
Module
Vulkan
Bug description
LWJGL application running Vulkan code on Ubuntu (AMD) throws a NullPointerException here:
The exact same code runs fine on Windows 10 and 11 with Nvidia and AMD respectively. Using version 3.3.1.
It looks like it is stemming from this code in VK13.java:
Under what circumstances would commandBuffer.getCapabilities().vkCmdSetDepthTestEnable; return null?
Stacktrace or crash log output
No response