Challenge
A AAA game development company that had a DirectX 11-based game engine wanted to add Vulkan support to its software. This objective was going to be met by creating a wrapper from DirectX 11 to Vulkan. The wrapper would be an intermediate step that would be instrumental in understanding how the client’s game engine would need to be re-architected to provide an optimal Vulkan implementation in the future.
Solution
LunarG architected and created a DirectX 11 wrapper, with the goal to help the client understand how to redesign its engine to enable the best possible Vulkan performance.
How the Solution Works
Because DirectX 11 is a C++ API that provides classes to encapsulate the state of various graphics objects (e.g., device, context, textures, shaders, buffers, etc.) with interfaces for managing that state, LunarG implemented C++ classes, which adhered to the DirectX 11 interface, to wrap the Vulkan API.
LunarG’s implementation of the DirectX 11 class interface performed Vulkan API calls to translate DirectX 11 functionality to Vulkan. The solution also:
- Used resource binding calls to determine when to insert pipeline barriers and perform image layout transitions.
- Detected state changes between draw calls to determine when to create graphics and compute pipelines; Stored pipelines in a hash table to filter duplicate pipeline creations and reduce hitching.
- Provided additional, non-DirectX 11 functionality for managing memory allocations, which the game development company could then use to implement the best memory allocation strategy for its engine.
Outcome & Benefits
LunarG provided the client with a product that we believe was instrumental in helping the client understand how a native Vulkan implementation would best be integrated with its game engine.