LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: pNext and enabledLayerCount  (Read 305 times)

Matthew_VK

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
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.
Logged

Cornix

  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 470
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.
Logged

Matthew_VK

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
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
Logged

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1888
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).
Logged

Matthew_VK

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
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.
Logged

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1888
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).
Logged

Matthew_VK

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
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
Logged