Skip to content

EquineRI

EquineRI is a research rendering interface over Vulkan and Direct3D 12, written in C++20, with HLSL as the shading language. Its purpose is research velocity: sending work to the GPU should be trivial, while you keep roughly 90% of the control a native API gives you.

Status

The v1 API is implemented on both Vulkan and D3D12: GPUs and devices, memory and placed buffers, textures and views, bindless descriptor heaps and samplers, compute, graphics, and mesh pipelines with root data, command lists, barriers, rendering sections, resolves, clears, copies, submission with timeline points, indirect execution, swapchains, inline ray tracing, queries and timestamps, debugging, native sections and object import, work graphs (D3D12 only), and optional helpers. Start with your first compute dispatch. Each feature gets its page here as it is implemented: a feature is not done until its page exists.

How this site is organised

  1. Getting started: build the library and run the tests.
  2. Concepts: the ideas that cut across functions, such as the error channel and validation.
  3. Reference: pages for the public functions and structures.
  4. Native access: how to reach the Vulkan or D3D12 objects behind RI.
  5. Helpers: optional conveniences built on RI, each replaceable by your own.

Also a teaching resource

Most reference pages show the RI code next to a canonical native version in Vulkan and in D3D12: how you would do the same thing in your own renderer. If you learned on EquineRI and want to write your own Vulkan or D3D12 toy renderer, open the page for the RI feature you know and switch the tabs.

RI::Device device = RI::createDevice({.gpu = chosen});
std::printf("Device created on %s\n", device.gpu.name.c_str());
// 1. Ask which features the GPU supports, with a chain of feature structures.
//    Each structure points to the next through pNext.
VkPhysicalDeviceVulkan13Features v13{.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES};
VkPhysicalDeviceVulkan12Features v12{.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES, .pNext = &v13};
VkPhysicalDeviceVulkan11Features v11{.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES, .pNext = &v12};
VkPhysicalDeviceFeatures2 features{.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, .pNext = &v11};
vkGetPhysicalDeviceFeatures2(chosen, &features);

// 2. The same chain now holds VK_TRUE for every supported feature. Turn off
//    what you do not want: robustness costs performance just by being on.
features.features.robustBufferAccess = VK_FALSE;
v13.robustImageAccess = VK_FALSE;
v12.bufferDeviceAddressCaptureReplay = VK_FALSE; // for capture tools only

// 3. Create the device with one queue, passing the chain in pNext.
//    pEnabledFeatures stays null: the features travel in the chain instead.
const float priority = 1.0f;
const VkDeviceQueueCreateInfo queueInfo{
    .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
    .queueFamilyIndex = queueFamily,
    .queueCount = 1,
    .pQueuePriorities = &priority,
};
const VkDeviceCreateInfo deviceInfo{
    .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
    .pNext = &features,
    .queueCreateInfoCount = 1,
    .pQueueCreateInfos = &queueInfo,
    // Device extensions (e.g. VK_KHR_swapchain) go in ppEnabledExtensionNames,
    // after checking vkEnumerateDeviceExtensionProperties.
};
VkDevice device = VK_NULL_HANDLE;
if (vkCreateDevice(chosen, &deviceInfo, nullptr, &device) != VK_SUCCESS) {
    vkDestroyInstance(instance, nullptr);
    return 1;
}
VkQueue queue = VK_NULL_HANDLE;
vkGetDeviceQueue(device, queueFamily, 0, &queue);
// No feature list: everything the GPU supports is available once the device exists.
ComPtr<ID3D12Device> device;
if (FAILED(D3D12CreateDevice(chosen.Get(), D3D_FEATURE_LEVEL_12_0, IID_PPV_ARGS(&device)))) {
    return 1;
}
// A DIRECT queue accepts graphics, compute and copy work.
const D3D12_COMMAND_QUEUE_DESC queueDesc{.Type = D3D12_COMMAND_LIST_TYPE_DIRECT};
ComPtr<ID3D12CommandQueue> queue;
if (FAILED(device->CreateCommandQueue(&queueDesc, IID_PPV_ARGS(&queue)))) {
    return 1;
}

The tabs are linked: pick Vulkan once and every tab group on the site switches to Vulkan. The native code is not necessarily what RI does internally; it is the plain way to do it with the native API alone.

Using the site

  • Theme: the sun and moon icon in the header switches between light, dark, and your system's setting.
  • Language: the globe icon switches language. Pages that are not translated yet are shown in English.
  • Version: once versions are published, a selector next to the title switches between latest (the newest release), each earlier release by its number, and dev (the development branch).
  • Offline: the built site works without a server. Open index.html from the build folder directly in your browser.