Closed ghost closed 2 years ago
Just type
VkBufferCreateInfo buffer_info = {0};
Thank you very much and sorry for my stupidness :). Didn't knew that that was exsisting in C, quite confusing, because I never saw that anywere. Anyways, thank you very much for your support!
Hi,
I am not sure if you care about people using C, but I want to report it anyway.
Lets take this code for example (Vulkan tutorial, Vertex buffers -> Vertex buffer creation):
In C it looks something like that:
However, this leads to a segfault inside the validation layers when calling vkCreateBuffer() without having pNext set. When looking at the other code of the tutorial, I could see that it also doesn't set the
flags
orpNext
values, but that wasn't a problem (at least for me).I have two suggestions to solve this: 1: You could say in the beggining of the tutorial something like
Be aware, if you are using C, you will always need to set the flags and pNext field to 0 and NULL because there are no default values in C.
(Not exactly like that, but you get the idea.) An FAQ entry with this text would proabtly also be a good alternative.2: Always set the pNext and flags field. I think this might also be a good approch for other programming languages because people might run into similar problems when not setting these fields.
I think this might be a very nasty bug for people to fix and thats why I think it would be a good idea to do something about it. Myself, and probatly others too, assume that the code in the tutorial is correct.
-Lorenz