VkPipelineCacheCreateInfo structures with the aim of improving the predictability of pipeline creation cost. The goal is to provide information about potentially expensive hazards within the client driver during pipeline creation to the application before carrying them out rather than after.
Pipeline creation is a costly operation, and the explicit nature of the Vulkan design means that cost is not hidden from the developer. Applications are also expected to schedule, prioritize, and load balance all calls for pipeline creation. It is strongly advised that applications create pipelines sufficiently ahead of their usage. Failure to do so will result in an unresponsive application, intermittent stuttering, or other poor user experiences. Proper usage of pipeline caches and/or derivative pipelines help mitigate this but is not assured to eliminate disruption in all cases. In the event that an ahead-of-time creation is not possible, considerations should be taken to ensure that the current execution context is suitable for the workload of pipeline creation including possible shader compilation.
Applications making API calls to create a pipeline must be prepared for any of the following to occur:
pAllocator passed to vkCreate*PipelinesThe job or task based game engines that are being developed to take advantage of explicit graphics APIs like Vulkan may behave exceptionally poorly if any of the above scenarios occur. However, most game engines are already built to “stream” in assets dynamically as the user plays the game. By adding control by way of VkPipelineCreateFlags, we can require an ICD to report back a failure in critical execution paths rather than forcing an unexpected wait.
Applications can prevent unexpected compilation by setting PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT on stext:Vk*PipelineCreateInfo::flags. When set, an ICD must not attempt pipeline or shader compilation to create the pipeline object. In such a case, if the implementation fails to create a pipeline without compilation, the implementation must return the result PIPELINE_COMPILE_REQUIRED_EXT and return NULL_HANDLE for the pipeline.
By default vkCreate*Pipelines calls must attempt to create all pipelines before returning. Setting PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT on stext:Vk*PipelineCreateInfo::flags can be used as an escape hatch for batched pipeline creates.
Hidden locks also add to the unpredictability of the cost of pipeline creation. The most common case of locks inside the stext:vkCreate*Pipelines is internal synchronization of the VkPipelineCache object. PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT can be set when calling CreatePipelineCache to state the cache is externally synchronized.
The hope is that armed with this information application and engine developers can leverage existing asset streaming systems to recover from "just-in-time" pipeline creation stalls.
Functionality in this extension is included in core Vulkan 1.3, with the EXT suffix omitted. The original type, enum and command names are still available as aliases of the core functionality.
VK_EXT_pipeline_creation_cache_controlVK_KHR_get_physical_device_properties2| Modifier and Type | Field and Description |
|---|---|
| public static final int | VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT
Extends |
| public static final String | VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME
The extension name. |
| public static final int | VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION
The extension specification version. |
| public static final int | VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT
Extends |
| public static final int | VK_PIPELINE_COMPILE_REQUIRED_EXT
Extends |
| public static final int | VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT
Extends |
| public static final int | VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT
Extends |
| public static final int | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT
Extends |
| Access | Constructor and Description |
|---|---|
| private |
| VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT | back to summary |
|---|---|
| public static final int VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT Extends Enum values: | |
| VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME The extension name. | |
| VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION The extension specification version. | |
| VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT | back to summary |
|---|---|
| public static final int VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT Extends | |
| VK_PIPELINE_COMPILE_REQUIRED_EXT | back to summary |
|---|---|
| public static final int VK_PIPELINE_COMPILE_REQUIRED_EXT Extends Enum values: | |
| VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT | back to summary |
|---|---|
| public static final int VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT Extends Enum values: | |
| VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT | back to summary |
|---|---|
| public static final int VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT Extends Enum values: | |
| VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT Extends | |
| EXTPipelineCreationCacheControl | back to summary |
|---|---|
| private EXTPipelineCreationCacheControl() | |