pNext and enabledLayerCount

Started by Matthew_VK, August 29, 2017, 23:39:21

Previous topic - Next topic


Hello everyone who's reading this post! I want to learn how to code using vulkan via lwjgl of course. Yesterday I started to code basic app. I've got a little problem. When I want to set VkApplicationInfo's pNext(null) I am getting error like this: "The method pNext(long) in the type VkApplicationInfo is not applicable for the arguments (null)". Kinda simillar thing with enabledLayersCount. I am getting: "The method enabledLayerCount() in the type VkInstanceCreateInfo is not applicable for the arguments (int)". Could anyone help me with this???

Ps1. I am learing vulkan api with Vulkan programming guide by G. Seller.
Ps2. I tired to use the newest lwjgl release, stable and nightly.


Those errors you are getting are not so much Vulkan related but rather java related. Are you sure you have enough experience with Java to start working on something as complicated as a Vulkan application?

The first error says, that you are trying to pass "null" as an argument to a method which expects a long value. This is illegal in java and does not compile. Perhaps you wanted to pass the number zero instead? Or maybe you forgot to import an lwjgl class which defines a public static long named "NULL"?

The second error says you tried to pass an argument of type int to a method which takes no parameters.


Hello again and thank You for help :D I think that I have enough exeperience in java. Just sometimes I forgot about javadocs :D I didn't use MemoryUtil.NULL. About second error in Vk guide, G. Seller writes that enabledLayerCount must be set to 0, so I am kinda confused  ;D


The enabledLayerCount member of VkApplicationInfo is automatically populated by setting ppEnabledLayerNames. This is a feature of the LWJGL bindings, similar to auto-sized parameters in functions. If you'd like to set it to 0, pass null to ppEnabledLayerNames.

If you'd like to set it directly for some reason, you can use the unsafe accessor (VkApplicationInfo.nenabledLayerCount).


Thank You so much for help  :) Do You have idea is there any simillar think to VkResult? Because I don't see it in 3.1.3 overview.


No, VkResult is mapped to a Java int. This won't change until we get value types in Java (see Project Valhalla).


Okay thank You for help :D If You need help with somethink write to me, I will try to help You :D