How to get Vulkan Validation Layers working

I have started working on a Vulkan project in the Odin programming language. I’m basically porting across a working C program.

I have gotten as far as initialising Vulkan, and it works fine without validation layers, but if I enable validation layers it fails to create the instance with error code “ERROR_EXTENSION_NOT_PRESENT”.

I also get the following in the output from the validation layers themselves:

“loader_validate_instance_extensions: Extension VK_LAYER_KHRONOS_validation not found in list of known instance extensions.”

This is an unexpected error because my code previously checks for the validation layer and it does appear to be present through EnumerateInstanceLayerProperties.

I am having the exact same issue on Windows and Arch Linux. Both environments have the Vulkan SDK installed and the C version of my app works on both of them.

I’m totally lost as to where to look next!

OK, this was a skill issue on my part.

When I was porting my code from C to Odin, I accidentally copied the validation layer name instead of the debug utils extension name into my list of extensions.

Maybe porting this code was a little too complicated for my first ever go at building something in Odin!