Vulkan Layer Factory simplifies Vulkan validation layer creation.

LunarG creates tools to help simplify Vulkan development. The LunarG Vulkan Layer Factory (VLF), our latest offering, is a framework based on the canonical Vulkan layer model that facilitates the creation of Vulkan Layers. 

Overview

The layer factory hides the majority of the loader-layer interface, layer boilerplate, setup and initialization, and complexities of layer development. The VLF can be found as part of the LunarG Vulkan SDK.

A developer uses VLF to create a complete layer with the attendant support files by 1) using the included Vulkan Layer Factory Visual Studio template to generate a new layer project and 2) adding the specific intercepts for the functions targeted for the layer. This layer can be used just as any other Vulkan layer.

The Vulkan Layer Factory framework produces ‘Factory Layers’ comprising one or more ‘interceptor’ objects. Interceptor objects override functions to be called before (PreCallApiName) or after (PostCallApiName) each Vulkan entry point of interest. Each interceptor is independent of all others within a single Factory layer. If multiple interceptors attach to the same API call, the calling order is indeterminate.

Three Factory Layer Options

The base installation of the layer factory contains the source code for three factory layers including the Vulkan Assistant Layer, Starter Layer, and Demo Layer. For the most simple and basic example, see the Starter Layer. The Demo Layer serves as a slightly more featured example of a layer implementation, exhibiting some new VLF ease-of-use features including global intercepts and various output options. The Assistant Layer is a production layer that uses multiple interceptors and functions to highlight performance issues and to enforce best-practices for applications.

Source for all three layers is included with the LunarG Vulkan SDK, while the Demo Layer is additionally included in the Visual Studio Demos project, allowing easy inspection of the layer’s operation and source. The Assistant Layer is also provided as a binary located alongside the other production layers.

To help with Layer Factory creation and use, a Visual Studio Layer Factory Template has also been included, and its use is described in the Layer Factory Docs section of LunarXchange. Refer to this Docs section for more information about the VLF and to see sample code illustrating its use in creating new layers.

In addition to Windows, the Vulkan Layer Factory (VLF) is available and fully supported on Linux and Android. With this list of supported platforms expanding in the near future.

Info about LunarG, Inc.

LunarG’s software engineering experts create innovative products and services using leading-edge 3D graphics and compute technologies, including OpenGL, Vulkan, OpenXR, and SPIR-V. We have strengths in performance analysis and tuning, runtime and tools development, shader optimizations, driver development, and porting engines and applications to Vulkan. Our software engineering team is based in Fort Collins, Colorado. LunarG was founded by graphics experts who are passionate about 3D graphics.

For more information about LunarG, check out our website.