Hello Guest

pNext and enabledLayerCount

  • 6 Replies
  • 8550 Views
pNext and enabledLayerCount
« on: August 29, 2017, 23:39:21 »
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.

*

Offline Cornix

  • *****
  • 488
Re: pNext and enabledLayerCount
« Reply #1 on: August 30, 2017, 00:28:51 »
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.
« Last Edit: August 30, 2017, 00:31:00 by Cornix »

Re: pNext and enabledLayerCount
« Reply #2 on: August 30, 2017, 01:29:28 »
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

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: pNext and enabledLayerCount
« Reply #3 on: August 30, 2017, 09:16:45 »
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).

Re: pNext and enabledLayerCount
« Reply #4 on: August 30, 2017, 12:13:33 »
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.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: pNext and enabledLayerCount
« Reply #5 on: August 30, 2017, 12:19:00 »
No, VkResult is mapped to a Java int. This won't change until we get value types in Java (see Project Valhalla).

Re: pNext and enabledLayerCount
« Reply #6 on: August 30, 2017, 12:32:22 »
Okay thank You for help :D If You need help with somethink write to me, I will try to help You :D