LunarG Vulkan Validiation Layer

1 useful link

https://vulkan.lunarg.com/doc/sdk/1.3.211.0/linux/layer_configuration.html

2 Configure Vulkan Layers

Configuring Vulkan Layers using Vulkan Configurator .Developers can configure layers through a graphical user interface. Vulkan Configurator allows full user control of Vulkan layers, including enabling or disabling specific layers, controlling layer order, changing layer settings, etc.

3 Enabling Vulkan Layers

Two following methods to use Vulkan layers

3.1 using VkCreateInstance()

Applications may programmatically activate layers via the vkCreateInstance() entry point. This is done by setting enabledLayerCount and ppEnabledLayerNames in the VkInstanceCreateInfo structure.

3.2 Enabling Vulkan Layers using Environment Variables

  • Layers can be activated by using the VK_INSTANCE_LAYERS environment variable.
$ export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_api_dump:VK_LAYER_KHRONOS_validation

#The api_dump layer will be called before the Khronos validation layer
  • To activate layers located in a particular SDK installation, or layers built locally from source, specify the layer JSON manifest file directory using the VK_LAYER_PATH environment variable.
    LunarG Vulkan Validiation Layer_第1张图片

  • Here we can see setup-env.sh in the directory, it will help you to export the above environment variable, you need also to set VK_INSTANCE_LAYERS

  • execute vkcube result
    LunarG Vulkan Validiation Layer_第2张图片

你可能感兴趣的:(GPU,vulkan)