Skip to content

[meta][ll] Vulkan portability issues #1354

Open
@kvark

Description

@kvark

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 to ID3D12DescriptorHeap, 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, while vkAllocateMemory 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, while OMSetStencilRef and stencil descriptors only support a single value for the reference and masks.
  • vkCmdBlitImage unsupported, only 1:1 copying possible
  • vkCmdClearColorImage/vkCmdClearDepthStencilImage: Only clearing via RenderTargetView/DepthStencilViews possible
  • vkCmdFillBuffer: Only clearing via UAVs possible
  • vkCmdUpdateBuffer: Unsupported, d3d12 only allows map/unmap and copying
  • vkCmdResolveImage: 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 each ID3D12CommandAllocator
    (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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions