Vulkan and D3D12 to RI
A conversion chart: each Vulkan and D3D12 concept, its RI counterpart, and how RI maps it. Use
it to read RI with Vulkan or D3D12 in mind, or to port code to RI. "—" means the concept has
no RI form: RI hides it, or leaves it to native access.
Features RI v1 does not have at all, with what to do instead, are listed at the end:
Not in RI v1.
Devices and setup
| Vulkan |
D3D12 |
RI |
How RI maps it |
VkInstance |
IDXGIFactory |
— |
Hidden: each device makes its own. |
VkPhysicalDevice |
IDXGIAdapter |
RI::Gpu, listGpus |
A portable description; gpu.id is the device UUID / adapter LUID. |
VkDevice |
ID3D12Device |
RI::Device |
Every feature the GPU reports is enabled (except robustness and capture/replay), along with the extensions RI uses. |
| Features, properties, limits |
CheckFeatureSupport |
device.limits |
Flags for asymmetric features and the limits RI needs. |
vkGetPhysicalDeviceFormatProperties |
CheckFeatureSupport(FORMAT_SUPPORT) |
formatSupported |
Per format, usage, and sample count. |
VkQueue (graphics) |
ID3D12CommandQueue (direct) |
device.graphicsQueue |
One queue in v1. |
| Validation layer, GPU-AV |
Debug layer, GBV |
EQUINE_VALIDATION builds |
Both turned on with RI's own checks. |
Memory and resources
| Vulkan |
D3D12 |
RI |
How RI maps it |
VkDeviceMemory |
ID3D12Heap |
RI::Memory |
A block of one memory kind; you place resources in it. |
Memory types (DEVICE_LOCAL, HOST_VISIBLE, …) |
Heap types (DEFAULT, UPLOAD, READBACK, GPU_UPLOAD) |
MemoryKind (eGPU, eUpload, eReadback, eGPUUpload) |
RI picks the native type per kind. |
vkMapMemory |
ID3D12Resource::Map |
memory.mapped, buffer.mapped |
Every kind except eGPU (eUpload, eReadback, eGPUUpload) stays mapped for its lifetime. |
vkGet*MemoryRequirements |
GetResourceAllocationInfo |
bufferRequirements, textureRequirements |
Size, alignment, and the kinds that can hold it. |
VkBuffer + vkBindBufferMemory |
CreatePlacedResource (buffer) |
RI::Buffer |
Placed at an offset you choose; always has a GPU address. |
vkGetBufferDeviceAddress |
GetGPUVirtualAddress |
buffer.gpuAddress |
Always available. |
VkImage + vkBindImageMemory |
CreatePlacedResource (texture) |
RI::Texture |
Usage flags decide its hidden resting layout. |
| Buffer and image usage flags |
Resource flags |
BufferUsage, TextureUsage |
Explicit; TextureUsage also selects the texture's resting layout. |
VK_IMAGE_TYPE_3D, CUBE_COMPATIBLE |
TEXTURE3D, TEXTURECUBE views |
TextureShape::e3D, eCube |
Cubes are 6 layers per cube; views of whole cubes read as cubes (shapes). |
VkImageView |
SRV / UAV / RTV / DSV |
RI::TextureView |
One view object; RI makes the RTV/DSV descriptors it needs. |
| Dedicated allocation |
Committed resource |
— |
Not in RI; allocate an RI::Memory block for that single resource. |
| Sparse binding |
Reserved resources |
— |
Not in v1. |
Descriptors and binding
| Vulkan |
D3D12 |
RI |
How RI maps it |
| Descriptor set + layout + pool |
Shader-visible descriptor heap |
RI::DescriptorHeap |
One resource heap and one sampler heap; shaders index them (ResourceDescriptorHeap[i]). |
vkUpdateDescriptorSets |
CreateShaderResourceView … into a heap |
writeDescriptors |
You choose the slot. |
| Sampled image / storage buffer (read) |
SRV |
RI::ReadView |
|
| Storage image / storage buffer |
UAV |
RI::ReadWriteView |
|
| Uniform buffer |
CBV |
RI::ConstantBufferView |
|
| Acceleration structure descriptor |
SRV (raytracing AS) |
RI::AccelerationStructureView |
|
VkSampler |
Sampler descriptor |
RI::SamplerDesc, writeSamplers |
No sampler object: the description goes into a sampler-heap slot; Vulkan samplers are cached per description. |
vkCmdBindDescriptorSets |
SetDescriptorHeaps |
cmdSetHeap |
Call before the first cmdSetPipeline in the command list. |
| Push constants |
Root constants |
Root data, cmdSetRootData |
Declared in the shader with EQ_ROOT_DATA (root data). |
VkPipelineLayout |
Root signature |
— |
Built by RI from the shader. |
| Bound vertex buffers |
Vertex buffer views |
— |
Vertex pulling: read vertices from buffers in the shader. |
vkCmdBindIndexBuffer |
IASetIndexBuffer |
cmdSetIndexBuffer |
|
Pipelines and shaders
| Vulkan |
D3D12 |
RI |
How RI maps it |
SPIR-V VkShaderModule |
DXIL bytecode |
RI::Bytecode |
RI takes bytecode only; one HLSL source, compiled for both (compiling shaders). |
| Compute pipeline |
Compute PSO |
createComputePipeline |
|
| Graphics pipeline (dynamic rendering) |
Graphics PSO |
createGraphicsPipeline |
Formats, blend, depth, stencil (reference included), cull, topology. |
| Mesh / task pipeline |
Mesh shader PSO |
createGraphicsPipeline with task and mesh shaders |
device.limits.meshShaders. |
| Tessellation, geometry shaders |
HS, DS, GS |
hull, domain, geometry in GraphicsPipelineDesc |
device.limits.tessellation, geometryShaders. |
| Polygon mode, depth bias, depth clamp |
FillMode, DepthBias, DepthClipEnable |
fill, depthBias, depthClamp |
Fixed in the pipeline. |
| Dynamic state |
Command-list state |
— |
Fixed in the pipeline, except viewport, scissor, and stencil reference: viewport and scissor start at the attachment size and stencil reference starts at the pipeline's value until cmdSetViewport, cmdSetScissor, cmdSetStencilReference override them. |
| Pipeline cache |
Pipeline library |
— |
Not in RI. |
vkCmdBindPipeline |
SetPipelineState + root signature |
cmdSetPipeline |
|
Commands and synchronization
| Vulkan |
D3D12 |
RI |
How RI maps it |
VkCommandPool + VkCommandBuffer |
Allocator + command list |
RI::CommandList |
Each CommandList owns its own pool; record, submit once, and reset after its timeline point is reached. |
| Secondary command buffers |
Bundles |
— |
Not in RI. |
vkQueueSubmit2 |
ExecuteCommandLists + Signal |
submit |
Returns a timeline point. |
| Timeline semaphore |
Fence |
RI::TimelinePoint, wait, isReached |
One timeline per queue. |
| Binary semaphores |
— |
— |
Hidden inside swapchains. |
VkEvent |
— |
— |
Not in RI. |
vkCmdPipelineBarrier2 (memory barrier) |
Global barrier |
cmdBarrier(cmd, before, after) |
Stage masks only: you name what must finish and what waits (barriers). |
| Image layouts, layout transitions |
Resource states, layouts |
— |
Never visible: textures rest in one layout; RI switches around its own operations (layouts). |
VK_IMAGE_LAYOUT_UNDEFINED to drop contents |
DISCARD barrier, DiscardResource |
cmdDiscard |
Required when a texture takes over memory. |
Rendering
| Vulkan |
D3D12 |
RI |
How RI maps it |
vkCmdBeginRendering |
OMSetRenderTargets |
cmdBeginRendering / cmdEndRendering |
A rendering section with load and store operations (rendering). |
| Render pass, subpasses, framebuffer |
Render pass (BeginRenderPass) |
— |
Not in RI: rendering sections only. |
loadOp / storeOp |
Beginning / ending access |
LoadOp, StoreOp |
|
| Resolve attachments |
ResolveSubresource(Region) |
resolveTo on an attachment, cmdResolve |
Color averages; depth and stencil use the modes the GPU reports. |
vkCmdDraw, vkCmdDrawIndexed |
DrawInstanced, DrawIndexedInstanced |
cmdDraw, cmdDrawIndexed |
|
vkCmdDrawMeshTasksEXT |
DispatchMesh |
cmdDrawMesh |
|
vkCmdDispatch |
Dispatch |
cmdDispatch |
|
vkCmdClearColorImage, vkCmdFillBuffer |
Clear*View |
cmdClearTexture, cmdClearBuffer |
No heap slot needed. |
| Clip space y-down (Vulkan) |
Clip space y-up |
— |
Clip space is y-up on both: RI flips Vulkan's viewport. |
Copies, queries, indirect
| Vulkan |
D3D12 |
RI |
How RI maps it |
vkCmdCopyBuffer |
CopyBufferRegion |
cmdCopyBuffer |
|
vkCmdCopyBufferToImage / ImageToBuffer |
CopyTextureRegion (footprint) |
cmdCopyBufferToTexture, cmdCopyTextureToBuffer, copyLayout |
copyLayout gives the row pitch both backends accept. |
vkCmdCopyImage |
CopyTextureRegion |
cmdCopyTexture |
|
VkQueryPool |
ID3D12QueryHeap |
RI::QueryPool |
Timestamps, occlusion, pipeline statistics, and mesh statistics or primitives. |
vkCmdWriteTimestamp2 |
EndQuery(TIMESTAMP) |
cmdWriteTimestamp |
|
vkCmdCopyQueryPoolResults |
ResolveQueryData |
cmdResolveQueries |
Into a buffer you own. |
vkCmdDraw*Indirect(Count) |
ExecuteIndirect |
cmdExecuteIndirect |
Level 1. |
VK_EXT_device_generated_commands |
ExecuteIndirect with root constants |
cmdExecuteIndirectWithRootData |
Level 2: root data per indirect command; you supply the scratch buffer (indirectScratchRequirements). |
Ray tracing and work graphs
| Vulkan |
D3D12 |
RI |
How RI maps it |
VkAccelerationStructureKHR |
Acceleration structure in a buffer |
RI::AccelerationStructure |
Placed in your memory. |
vkCmdBuildAccelerationStructuresKHR |
BuildRaytracingAccelerationStructure |
cmdBuildBlas, cmdBuildTlas |
Supports in-place updates; you supply the scratch buffer. |
Ray query (VK_KHR_ray_query) |
Inline ray tracing (tier 1.1) |
RayQuery in any shader |
Inline only. |
| Ray tracing pipelines, SBT |
State objects, shader tables |
— |
Not in v1. |
(VK_AMDX_shader_enqueue) |
Work graphs |
RI::WorkGraph |
D3D12 only. |
Presentation and debugging
| Vulkan |
D3D12 |
RI |
How RI maps it |
VkSurfaceKHR |
HWND |
RI::Window |
OS handles; RI creates no window. |
VkSwapchainKHR |
IDXGISwapChain |
RI::Swapchain |
|
vkAcquireNextImageKHR |
GetCurrentBackBufferIndex |
acquire |
Returns the screen texture, ready to render. |
vkQueuePresentKHR |
Present |
present |
|
vkSetDebugUtilsObjectNameEXT |
SetName |
setName |
|
| Debug labels |
PIX events |
cmdBeginMarker, cmdEndMarker |
|
| Device fault |
DRED |
— |
Printed when the device is lost (validation builds). |
| Any native handle |
Any native object |
RI::Vk::native(...), RI::D3D12::native(...) |
Through the backend's Native.hpp (native access). |
Not in RI v1
What a Vulkan or D3D12 program may use that RI v1 does not offer. "Native" means a
native pipeline (importPipeline) or a
native section, written once per backend.
| Vulkan |
D3D12 |
Instead |
| Compressed formats (BC, ETC2, ASTC) |
BC formats |
Uncompressed formats (Format); decompress when loading. |
| Line width, point size |
— (1 pixel only) |
Quads: one per point or line segment. |
| Alpha to coverage, sample mask, conservative rasterization, shading rate |
The same |
Native. |
vkCmdBlitImage, mip generation |
— |
A compute or pixel shader that downsamples; cmdCopyTexture copies at the same size only. |
| Specialization constants |
— |
Root data, or #defines with the shader compiler helper. |
| Multiview, viewport arrays |
View instancing, viewport arrays |
One viewport per draw: cmdSetViewport between draws, or one section per view. |
| Recording on several threads |
Recording on several threads |
One device thread records and submits in v1 (threads, timeline). |
| Compute and transfer queues |
Compute and copy queues |
The graphics queue only. |
| Ray tracing pipelines |
State objects |
Inline ray queries. |