Convert all files to CRLF line endings. authored by Alexandre Julliard's avatar Alexandre Julliard
Vkd3d is considered as work-in-progress, there are known issues that
have to be resolved. Moreover, there are some incompatibilities between
Vulkan and Direct3D 12.
<table>
<thead>
<tr class="header">
<th><p>Issue</p></th>
<th><p>Description</p></th>
<th><p>Current implementation</p></th>
<th><p>Possible solutions</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><p>NULL descriptors</p></td>
<td><p>Vulkan doesn't support NULL descriptors.</p></td>
<td><p>NULL descriptors are currently emulated using dummy resources.
Sparse resources are used when
`residencyNonResidentStrict` is supported. The current
solution doesn't handle `resinfo` and
`bufinfo` instructions correctly.</p></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Indirect draws</p></td>
<td><p>In Direct3D 12 indirect draws can update vertex buffer views,
index buffer views, root constants and root descriptors.</p></td>
<td><p>Not supported in Vulkan.</p></td>
<td><ul>
<li>A Vulkan extension.</li>
<li>It could be emulated in an inefficient way.</li>
</ul></td>
</tr>
<tr class="even">
<td><p>Memory object residency</p></td>
<td><p>Memory object residency management doesn't exist in Vulkan. In
Direct3D 12 resources and heaps can be evicted. Resource descriptors are
still valid after a resource is made resident again.</p></td>
<td></td>
<td><p>We can try to evict memory manually (e.g. using sparse
bindings).</p></td>
</tr>
<tr class="odd">
<td><p>Queries initial state</p></td>
<td><p>Queries are initially in the available state in Direct3D 12.
Results are all equal to zero.</p></td>
<td><p>We track the query state, and fill buffer with zeroes when a
query wasn't issued. The current implementation doesn't handle command
lists executed out-of-order.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>Texture array views</p></td>
<td><p>Texture array views and textures views are incompatible in
Vulkan.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Descriptor heaps</p></td>
<td><p>Direct3D 12 and Vulkan binding models are largely different. It
seems to be implied that Direct3D 12 CBV/SRV/UAV descriptor heaps exist
in GPU memory, but there's no real equivalent for that in Vulkan. Vulkan
descriptor sets are probably the closest match, but among others have
the issue that the descriptor type (CBV, SRV or UAV) would need to be
declared in advance, while in Direct3D 12 these can be mixed freely
within the descriptor heap. Run-time translation from Direct3D 12
binding model to Vulkan binding model is expected to introduce a
noticeable overhead.</p></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><p>CPU descriptor heaps</p></td>
<td><p>Direct3D 12 allows to create and prepare descriptors in CPU
heaps. Descriptors from CPU descriptor heaps can be copied to
shader-visible descriptor heaps. In Vulkan, there are only
shared-visibile descriptor sets, and
`VkCopyDescriptorSet` is implemented very inefficiently
on some drivers.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Descriptor heaps concurrency</p></td>
<td><p>Some apps appear to concurrently overwrite descriptors in
descriptor heaps. We need to confirm that this works reliably on
Windows. It might not be a problem on Windows because implementations
might simply write or copy descriptors data in memory. However, in our
translation layer we have to manage VkImageView objects and potentially
reference count them.</p></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><p>Descriptors for destroyed resources</p></td>
<td><p>Apps keep descriptors for destroyed resources in descriptor
heaps. This is problematic and may lead to invalid usage in
Vulkan.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>ID3D12Fence</p></td>
<td><p>ID3D12Fence have an associated UINT64 value (see also timeline
semaphores). In addition, ID3D12Fence can be signaled by GPU or CPU, and
can also be waited for on CPU or ID3D12CommandQueue. Moreover, it's
possible to signal native Win32 events when a fence reaches a certain
value. In Vulkan, there is no way to signal native synchronization
objects (e.g. HANDLEs to Win32 events or file descriptors) when, e.g.
VkFence is signaled.</p></td>
<td></td>
<td><p>Timeline semaphores.</p></td>
</tr>
<tr class="even">
<td><p>Sampler border color</p></td>
<td><p>In Direct3D 12 the sampler border color is defined as a float4
vector. In Vulkan the border color is constrained by the values of the
VkBorderColor enum. (It might not be that important because we haven't
encountered application which needs this yet).</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Separate resource state for depth-stencil</p></td>
<td><p>In Direct3D, the depth aspect and the stencil aspect of an image
can be in different image layouts.</p></td>
<td></td>
<td><p>Vulkan extension.</p></td>
</tr>
<tr class="even">
<td><p>Out-of-bounds resource access</p></td>
<td><p>Vulkan doesn't give the same guarantees as Direct3D 12 when it
comes to out-of-bounds resource access.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT</p></td>
<td><p>On radv with AMD Polaris GPUs, the required alignment for
textures may be higher than 0x10000
(D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT), e.g. 0x20000 or 0x40000.
World of Warcraft aligns only to
D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT and ignores the alignment
returned from `GetResourceAllocationInfo()`.</p></td>
<td><p>We currently allocate additional device memory when the heap
offset is misaligned.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>Swapchain</p></td>
<td><ul>
<li>sRGB views.</li>
<li>Scaling.</li>
<li>Present mode without recreating.</li>
</ul></td>
<td><p>We currently use additional set of images and blit from them to
the real swapchain.</p></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Conditional rendering</p></td>
<td><p>In D3D12, 64-bit values are used.
`VK_EXT_conditional_rendering` uses 32-bit values. In
D3D12, conditional rendering affects copy commands.</p></td>
<td><p>We do what the `VK_EXT_conditional_rendering`
extension does.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>Binary occlusion queries</p></td>
<td><p>D3D12 guarantees binary occlusion queries result in only 0 and
1.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Strip cut value</p></td>
<td><p>In Vulkan the strip cut value is derived from the index format.
In Direct3D 12 0xffff or 0xffffffff can be used as the strip cut value
with 16-bit and 32-bit index buffer formats.</p></td>
<td><p>Not supported in Vulkan.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>GPU virtual addresses</p></td>
<td><p>In Direct3D 12, vertex buffers, index buffers, stream output
buffers and root descriptors are bound using GPU virtual addresses. In
Vulkan, VkBuffer objects with an offset are used instead.</p></td>
<td><p>Fake virtual addresses are allocated for buffers. Virtual
addresses have to be resolved to VkBuffer and an offset. The resolving
of GPU virtual address introduces unnecessary overhead.</p></td>
<td><ul>
<li>`VK_EXT_device_buffer_address` can be used for root
descriptors. Unfortunately, the extension doesn't help with vertex,
index and stream output buffers. The extension also introduces some
complications, e.g. multiple buffers can be bound to the same virtual
memory address.</li>
<li>Ideally, we could bind vertex, index and stream output buffers using
`VkDeviceAddress` in Vulkan.</li>
</ul></td>
</tr>
<tr class="odd">
<td><p>`GetResourceAllocationInfo()`</p></td>
<td><p>In Vulkan, a resource needs to be created to get allocation
info.</p></td>
<td><p>We create temporary resources to get allocation info.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>`SetEventOnCompletion()` /
`SetEventOnMultipleFenceCompletion()`</p></td>
<td></td>
<td><p>We have a separate thread that signals Win32 events.</p></td>
<td><p>Timeline semaphores.</p></td>
</tr>
<tr class="odd">
<td><p>Copy between depth-stencil and color formats</p></td>
<td><p>In Direct3D 12 it is possible to copy data between compatible
color and depth-stencil resources.</p></td>
<td><p>We currently use a temporary buffer to perform the copy
operation.</p></td>
<td><p>We should implement the copy operation in shaders for graphics
and compute queues.</p></td>
</tr>
<tr class="even">
<td><p>Dynamic states</p></td>
<td><p>In Direct3D 12 the following states are dynamic: vertex buffer
strides, the primitive topology and viewport/scissor counts. In Vulkan,
those states require compiling a new pipeline. The primitive topology
type is still specified when Direct3D 12 pipeline states are created
(one of points, lines, triangles, or patches).</p></td>
<td><p>Vulkan pipelines are created on draw call time when we know all
parameters to compile the pipeline.</p></td>
<td><ul>
<li>Add pipeline cache.</li>
<li>Compile pipelines speculatively.</li>
</ul></td>
</tr>
</tbody>
</table>
Vkd3d is considered as work-in-progress, there are known issues that
have to be resolved. Moreover, there are some incompatibilities between
Vulkan and Direct3D 12.
<table>
<thead>
<tr class="header">
<th><p>Issue</p></th>
<th><p>Description</p></th>
<th><p>Current implementation</p></th>
<th><p>Possible solutions</p></th>
</tr>
</thead>
<tbody>
<tr class="even">
<td><p>NULL descriptors</p></td>
<td><p>Vulkan doesn't support NULL descriptors.</p></td>
<td><p>NULL descriptors are currently emulated using dummy resources.
Sparse resources are used when
`residencyNonResidentStrict` is supported. The current
solution doesn't handle `resinfo` and
`bufinfo` instructions correctly.</p></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Indirect draws</p></td>
<td><p>In Direct3D 12 indirect draws can update vertex buffer views,
index buffer views, root constants and root descriptors.</p></td>
<td><p>Not supported in Vulkan.</p></td>
<td><ul>
<li>A Vulkan extension.</li>
<li>It could be emulated in an inefficient way.</li>
</ul></td>
</tr>
<tr class="even">
<td><p>Memory object residency</p></td>
<td><p>Memory object residency management doesn't exist in Vulkan. In
Direct3D 12 resources and heaps can be evicted. Resource descriptors are
still valid after a resource is made resident again.</p></td>
<td></td>
<td><p>We can try to evict memory manually (e.g. using sparse
bindings).</p></td>
</tr>
<tr class="odd">
<td><p>Queries initial state</p></td>
<td><p>Queries are initially in the available state in Direct3D 12.
Results are all equal to zero.</p></td>
<td><p>We track the query state, and fill buffer with zeroes when a
query wasn't issued. The current implementation doesn't handle command
lists executed out-of-order.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>Texture array views</p></td>
<td><p>Texture array views and textures views are incompatible in
Vulkan.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Descriptor heaps</p></td>
<td><p>Direct3D 12 and Vulkan binding models are largely different. It
seems to be implied that Direct3D 12 CBV/SRV/UAV descriptor heaps exist
in GPU memory, but there's no real equivalent for that in Vulkan. Vulkan
descriptor sets are probably the closest match, but among others have
the issue that the descriptor type (CBV, SRV or UAV) would need to be
declared in advance, while in Direct3D 12 these can be mixed freely
within the descriptor heap. Run-time translation from Direct3D 12
binding model to Vulkan binding model is expected to introduce a
noticeable overhead.</p></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><p>CPU descriptor heaps</p></td>
<td><p>Direct3D 12 allows to create and prepare descriptors in CPU
heaps. Descriptors from CPU descriptor heaps can be copied to
shader-visible descriptor heaps. In Vulkan, there are only
shared-visibile descriptor sets, and
`VkCopyDescriptorSet` is implemented very inefficiently
on some drivers.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Descriptor heaps concurrency</p></td>
<td><p>Some apps appear to concurrently overwrite descriptors in
descriptor heaps. We need to confirm that this works reliably on
Windows. It might not be a problem on Windows because implementations
might simply write or copy descriptors data in memory. However, in our
translation layer we have to manage VkImageView objects and potentially
reference count them.</p></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><p>Descriptors for destroyed resources</p></td>
<td><p>Apps keep descriptors for destroyed resources in descriptor
heaps. This is problematic and may lead to invalid usage in
Vulkan.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>ID3D12Fence</p></td>
<td><p>ID3D12Fence have an associated UINT64 value (see also timeline
semaphores). In addition, ID3D12Fence can be signaled by GPU or CPU, and
can also be waited for on CPU or ID3D12CommandQueue. Moreover, it's
possible to signal native Win32 events when a fence reaches a certain
value. In Vulkan, there is no way to signal native synchronization
objects (e.g. HANDLEs to Win32 events or file descriptors) when, e.g.
VkFence is signaled.</p></td>
<td></td>
<td><p>Timeline semaphores.</p></td>
</tr>
<tr class="even">
<td><p>Sampler border color</p></td>
<td><p>In Direct3D 12 the sampler border color is defined as a float4
vector. In Vulkan the border color is constrained by the values of the
VkBorderColor enum. (It might not be that important because we haven't
encountered application which needs this yet).</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Separate resource state for depth-stencil</p></td>
<td><p>In Direct3D, the depth aspect and the stencil aspect of an image
can be in different image layouts.</p></td>
<td></td>
<td><p>Vulkan extension.</p></td>
</tr>
<tr class="even">
<td><p>Out-of-bounds resource access</p></td>
<td><p>Vulkan doesn't give the same guarantees as Direct3D 12 when it
comes to out-of-bounds resource access.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT</p></td>
<td><p>On radv with AMD Polaris GPUs, the required alignment for
textures may be higher than 0x10000
(D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT), e.g. 0x20000 or 0x40000.
World of Warcraft aligns only to
D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT and ignores the alignment
returned from `GetResourceAllocationInfo()`.</p></td>
<td><p>We currently allocate additional device memory when the heap
offset is misaligned.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>Swapchain</p></td>
<td><ul>
<li>sRGB views.</li>
<li>Scaling.</li>
<li>Present mode without recreating.</li>
</ul></td>
<td><p>We currently use additional set of images and blit from them to
the real swapchain.</p></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Conditional rendering</p></td>
<td><p>In D3D12, 64-bit values are used.
`VK_EXT_conditional_rendering` uses 32-bit values. In
D3D12, conditional rendering affects copy commands.</p></td>
<td><p>We do what the `VK_EXT_conditional_rendering`
extension does.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>Binary occlusion queries</p></td>
<td><p>D3D12 guarantees binary occlusion queries result in only 0 and
1.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><p>Strip cut value</p></td>
<td><p>In Vulkan the strip cut value is derived from the index format.
In Direct3D 12 0xffff or 0xffffffff can be used as the strip cut value
with 16-bit and 32-bit index buffer formats.</p></td>
<td><p>Not supported in Vulkan.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>GPU virtual addresses</p></td>
<td><p>In Direct3D 12, vertex buffers, index buffers, stream output
buffers and root descriptors are bound using GPU virtual addresses. In
Vulkan, VkBuffer objects with an offset are used instead.</p></td>
<td><p>Fake virtual addresses are allocated for buffers. Virtual
addresses have to be resolved to VkBuffer and an offset. The resolving
of GPU virtual address introduces unnecessary overhead.</p></td>
<td><ul>
<li>`VK_EXT_device_buffer_address` can be used for root
descriptors. Unfortunately, the extension doesn't help with vertex,
index and stream output buffers. The extension also introduces some
complications, e.g. multiple buffers can be bound to the same virtual
memory address.</li>
<li>Ideally, we could bind vertex, index and stream output buffers using
`VkDeviceAddress` in Vulkan.</li>
</ul></td>
</tr>
<tr class="odd">
<td><p>`GetResourceAllocationInfo()`</p></td>
<td><p>In Vulkan, a resource needs to be created to get allocation
info.</p></td>
<td><p>We create temporary resources to get allocation info.</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>`SetEventOnCompletion()` /
`SetEventOnMultipleFenceCompletion()`</p></td>
<td></td>
<td><p>We have a separate thread that signals Win32 events.</p></td>
<td><p>Timeline semaphores.</p></td>
</tr>
<tr class="odd">
<td><p>Copy between depth-stencil and color formats</p></td>
<td><p>In Direct3D 12 it is possible to copy data between compatible
color and depth-stencil resources.</p></td>
<td><p>We currently use a temporary buffer to perform the copy
operation.</p></td>
<td><p>We should implement the copy operation in shaders for graphics
and compute queues.</p></td>
</tr>
<tr class="even">
<td><p>Dynamic states</p></td>
<td><p>In Direct3D 12 the following states are dynamic: vertex buffer
strides, the primitive topology and viewport/scissor counts. In Vulkan,
those states require compiling a new pipeline. The primitive topology
type is still specified when Direct3D 12 pipeline states are created
(one of points, lines, triangles, or patches).</p></td>
<td><p>Vulkan pipelines are created on draw call time when we know all
parameters to compile the pipeline.</p></td>
<td><ul>
<li>Add pipeline cache.</li>
<li>Compile pipelines speculatively.</li>
</ul></td>
</tr>
</tbody>
</table>