How to step through Validation-Layers in VS15?

Greetings,
because the validation-layers throw sometimes an exception in my engine, i want to step through them with visual studio 2015, but i don’t know how to achieve this.
I know there are some .pdb files coming along with the installation but they don’t work. Can somebody give me a short tutorial how i can do this?

Thanks in Advance :slight_smile:

Adding the .pdbs to the VS debugging symbols path should usually be enough and works fine for me.

But I build the layers from source instead of using the ones that come with the SDK.

Basic run down

  • Clone layer source (in my case I cloned into E:\Vulkan-LoaderAndValidationLayers)
  • Do a clean debug build
  • In VS go to Tools->Options->Debugging->Symbols
  • Add “E:\Vulkan-LoaderAndValidationLayers\layers\Debug”
  • Enabled Auto-Load of symbols
  • Set your VK_LAYER_PATH env var to the same folder (E:\Vulkan-LoaderAndValidationLayers\layers\Debug)

That’s all I did in order to be able to step through the layers.

Thanks Sascha! Will try it soon :slight_smile:

I also had to compile them myself. The precompiled SDK debug ones wouldn’t work for me.

Can you explain the last step a bit more? I built the layers now but i have no VK_LAYER_PATH env variable anywhere. My Application still uses the .dll’s from the VulkanSDK (btw can i uninstall that?). This whole setup stuff is still new to me :frowning:

There’s no VK_LAYER_PATH. You are supposed to set (create) it yourself to whatever path you want.
If it exists it overrides the default way (looking into specific registry to get layer paths).

If you do not know what “environment variable” is, you can look it up – it is not a Vulkan specific thing.
In Visual Studio specifically you can even conveniently set one in project properties->debugging->environment. E.g. I set it to VK_LAYER_PATH=$(VULKAN_SDK)\Source\lib and overwritten the precompiled debug version layers in my SDK (which didn’t work for me anyway)…

THANKS!
I didn’t even have to build the layers on my own. With “VK_LAYER_PATH=$(VULKAN_SDK)\Source\lib” in the project settings i can step through the layer source and i found my bug!
p.s. Of course i know what environment variables are ._. It’s just the whole setup which is so complicated. There are so many options in visual studio.