Vulkan Productivity Feature: Shader Validation Caching

Shader validation caching is a feature recently added to the Vulkan Validation Layers. It is useful because it avoids the delays involved in re-validating shaders that have already been previously validated.

Shader validation caching works by keeping a file with a hash of all shaders that have been validated by the current version of the spirv-tools shader validation code. When a Vulkan application runs with validation at CreateShaderModule time, if the hash of the shader about to be validated is in the shader validation cache file, the validation layer skips validating that shader. If the hash of the shader is not in the cache, the shader is validated, and if no problems are found, the hash of the shader is added to the cache and written to the cache file at the end of execution.

Shader validation caching is enabled by default. It can be disabled by setting VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT programmatically, or in a vk_layer_settiings.txt file. The Vulkan Configurator (VkConfig) can also be used to disable it.

  • Need Help with
    3D Graphics Software?

    Let’s talk about your project and how our industry leading team of 3D software engineers can help you build something amazing.