Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: how to debug vkCreateInstance exception/crash

  1. #11
    Junior Member
    Join Date
    Feb 2018
    Posts
    7
    As for service packs, my VS says its fully updated, it is at version 14.0.25431.01 update 3

    As for platform target it is at win kit 8.1 which is what I want and what my app targets.

    I tried the templates again and yes they work in and of themselves. Looking at the simplest example I do not see a difference in the code with my case. So it is likely the environment or something else.

    I got the pdb loading so that I can step into the function, and subsequently I see that the values of the VkInstanceCreateInfo struct and the VkApplicationInfo struct (if I pass it) become garbled when the vkCreateInstance function reads them, so for example in my code I set enabledExtensionCount to 0 before passing it, yet on the other side it was showing having a value of 3435973836 in the debugger. So that explains the crash but I have no idea why this happens.

  2. #12
    Junior Member
    Join Date
    Feb 2018
    Posts
    7
    Finally figured it out. I noticed that the sizeof the vk struct types in my project differed from the sdk template project's, and I found the culprit: the compiler option /Zp4 was being set (forces struct alignment to packing to 4 byte boundaries) so I removed that so that it uses the default of 8, and now vkCreateInstance returns success!

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean