Skip to content
Vulkan On D3D12
Branch: master
Clone or download
Latest commit b7de013 Feb 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
include/vulkan Add vulkan.hpp and C++ cube demo Feb 9, 2018
src Fix cube demo UWP compile Feb 26, 2018
.clang-format
.gitignore add support of conservative rasterization extension Feb 2, 2018
CMakeLists.txt Require CMake 3.1 for CXX_STANDARD Feb 9, 2018
LICENSE.md Initial commit Jun 27, 2017
README.md Add CI build status to README.md Feb 7, 2018

README.md

Vulkan On D3D12

VulkanOnD3D12 aims to make the Vulkan API available to platforms where only a D3D12 driver is available, such as Windows UWP.

This project is currently a work in progress and as such, some or most things may not work at all.

Build Status

Windows Desktop
Build Status

Windows UWP
Build Status

Building

VulkanOnD3D12 uses the CMake build system and requires a shadowed build root.

mkdir VulkanOnD3D12-build
cd VulkanOnD3D12-build

For Windows Desktop
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION=10.0 ..\VulkanOnD3D12

For Windows UWP
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 ..\VulkanOnD3D12

This will generate a .sln project you can then open with Visual Studio.

Usage

An example using the VK_CHB_uwp_surface extension to create a VkSurface for a Windows::UI::Core::CoreWindow.

void App::SetWindow(CoreWindow^ window)
{
    VkUWPSurfaceCreateInfoCHB surfaceCreateInfo = {};
    surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_UWP_SURFACE_CREATE_INFO_CHB;
    surfaceCreateInfo.pNext = nullptr;
    surfaceCreateInfo.flags = 0;
    surfaceCreateInfo.window = reinterpret_cast<IUnknown*>(window);

    VkResult res;
    VkSurfaceKHR surface;
    res = vkCreateUWPSurfaceCHB(instance, &surfaceCreateInfo, nullptr, &surface);
    if (res != VK_SUCCESS)
    {
        // Handle error here
    }
}
You can’t perform that action at this time.