Vulkan, pipeline creation (pipeline cache / VK_EXT_graphics_pipeline_library)

Hi.

While examining possible pipeline creation speedup there is VkPipelineCache and VK_EXT_graphics_pipeline_library extension.

Does VkPipelineCache work in a similar way as VK_EXT_graphics_pipeline_library? I mean let's say we have two pipelines that have the same fragment shader: Pipeline#0 (VS#0, FS#0, ...) and Pipeline#1(VS#1, FS#0, ...). Pipeline#0 gets created first and is added to the VkPipelineCache. Is it so that creation of Pipeline#1 withVkPipelineCache will reuse FS#0 from already compiled Pipeline#0 (in other words no spirv -> platform binaries compilation will happen for FS#0)?

Basically what I am aiming here is warming up shader parts of the pipelines in a similar manner that is recommended VK_EXT_graphics_pipeline_library but only via VkPipelineCache. Would that approach work?

And the second question: Is it so that spirv->platform binaries compilation is the most time consuming part of pipeline creation?

Regards,
Aleksei

Parents
  • Second part is easy: Yes, spirv->platform binaries compilation is the most time consuming part of pipeline creation.

    First part is more "it depends". The pipeline cache keeps track of individual stages. However, API state and other linked stages may influence compilation for another stage and result in a different binary, and prevent reuse. In general though, yes, where the same binary would be generated, a cached entry would be retrieved.

Reply
  • Second part is easy: Yes, spirv->platform binaries compilation is the most time consuming part of pipeline creation.

    First part is more "it depends". The pipeline cache keeps track of individual stages. However, API state and other linked stages may influence compilation for another stage and result in a different binary, and prevent reuse. In general though, yes, where the same binary would be generated, a cached entry would be retrieved.

Children