Open
Description
Khronos - Vulkan Portability Initiative
Here is a rough list of areas where Vulkan translation to other next-gen APIs is not straightforward.
Related to #1226, #1241, and #1102
cc @msiglreith @JohnColanduoni
The following Vulkan pipeline states are not represented in D3D12 and Metal (see gpuweb/gpuweb#26 for detailed PSO comparison):
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN
Direct3D 12
- [ll] Descriptor heaps #1376:
vkDescriptorPool
can't be mapped toID3D12DescriptorHeap
, because only one of the latter can be active (for each type: samplers and non-samplers) at any given time during command encoding. - Allocating heap memory for low level DX12 backend fails #1379:
CreateHeap
requires the resource type specified in advance on Tier-1 hardware, whilevkAllocateMemory
is typeless. - [ll][d3d12] Buffer to Image copy alignment #1352:
CopyTextureRegion
from a source buffer requires minimum alignment of 0x100 for the rows and 0x200 for the depth slices, while Vulkan supports tight packing. vkCmdSetStencil*
supports face selection, whileOMSetStencilRef
and stencil descriptors only support a single value for the reference and masks.vkCmdBlitImage
unsupported, only 1:1 copying possiblevkCmdClearColorImage
/vkCmdClearDepthStencilImage
: Only clearing via RenderTargetView/DepthStencilViews possiblevkCmdFillBuffer
: Only clearing via UAVs possiblevkCmdUpdateBuffer
: Unsupported, d3d12 only allows map/unmap and copyingvkCmdResolveImage
:ResolveSubresource
doens't allow to specify offset+extent for subresources, only whole subresources can be resolved. Format compatibility needs to be enforced.- Only one
ID3D12GraphicsCommandList
can be recorded at same time for eachID3D12CommandAllocator
(source: https://msdn.microsoft.com/en-us/library/windows/desktop/dn899205(v=vs.85).aspx#recording_command_lists) - Format on SRV creation can only differ in ChannelType but not SurfaceType
- Only mapping of Resources is allowed, but not directly the underlying memory
Metal
- no sample mask
- [ll] Metal heaps and offsets/aliasing #1384: Metal heaps do not give us much control over allocations, other than specifying what heap to make the allocation within.
vkCmdClearColorImage
/vkCmdClearDepthStencilImage
: Clearing seems to be only possible via renderpasses. Potential issue with clearing multiple subregions.vkCmdUpdateBuffer
: Unsupported- Fix copying images of different formats on Metal #2026:
vkCmdCopyImage
doesn't work with non-equal but compatible formats - Support mipmapped 1D images on Metal #2050: 1D textures can't have mipmaps
- Support vertex attribute offsets higher than the strides in Metal #2054: vertex attributes can't have offset exceeding the stride
- Metal vertex buffer stride #2077: vertex buffer stride has to be a multiple of 4
TODO
Sort the remaining of #1241:
- swapchain only support incremental updates for frames
- pipeline barriers?
- currently leaning towards explicitly set resource states (dx12), layouts(vk) and access masks(vk)
Suggested new feature flags
- triangle fans
- separate stencil references for front/back
- events