Skip to content
Snippets Groups Projects

include: Document other vkd3d.h structures.

Merged Giovanni Mascellani requested to merge giomasce/vkd3d:aso into master
1 unresolved thread

I'm not sure everything I wrote here is correct, especially about vkd3d_image_resource_create_info.

Merge request reports

Merge request pipeline #25972 skipped

Merge request pipeline skipped for 3f43d06f

Approved by

Merged by Alexandre JulliardAlexandre Julliard 11 months ago (May 2, 2024 8:40pm UTC)

Merge details

  • Changes merged into master with 3f43d06f.
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Giovanni Mascellani approved this merge request

    approved this merge request

    • +/**
      + * When specified as a flag of vkd3d_image_resource_create_info, it means that each time the
      + * resource is transitioned into the D3D12_RESOURCE_STATE_COMMON state, this is interpreted instead
      + * as the state specified by present_state in vkd3d_image_resource_create_info.
      + */
       #define VKD3D_RESOURCE_PRESENT_STATE_TRANSITION 0x00000002

      I think that's more of a description of the implementation than a description of the interface. In terms of the interface, VKD3D_RESOURCE_PRESENT_STATE_TRANSITION simply means that the "present_state" field is valid / not ignored.

      The background is that d3d12 doesn't distinguish D3D12_RESOURCE_STATE_COMMON and D3D12_RESOURCE_STATE_PRESENT, to the point that these have the same enumeration value. Vulkan however does have a separate VK_IMAGE_LAYOUT_PRESENT_SRC_KHR.

      In terms of behaviour, we end up with three distinct cases:

      • VKD3D_RESOURCE_PRESENT_STATE_TRANSITION isn't set. The resource is assumed to be a regular resource, and D3D12_RESOURCE_STATE_COMMON/_PRESENT maps to VK_IMAGE_LAYOUT_GENERAL.
      • VKD3D_RESOURCE_PRESENT_STATE_TRANSITION is set, and "present_state" is D3D12_RESOURCE_STATE_PRESENT/_COMMON. The resource is assumed to be a swapchain image, and D3D12_RESOURCE_STATE_COMMON/_PRESENT maps to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR.
      • VKD3D_RESOURCE_PRESENT_STATE_TRANSITION is set, and "present_state" is some other state, like D3D12_RESOURCE_STATE_COPY_SOURCE. The resource is assumed to be a swapchain image, and D3D12_RESOURCE_STATE_COMMON/_PRESENT maps to the equivalent of "present_state". In the case of D3D12_RESOURCE_STATE_COPY_SOURCE that would be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL.

      The third case is mainly useful for use-cases where the d3d12 code is oblivious to the fact that it's running on top of vkd3d. For example, in the case of Wine, the code invoking the resource transition would be application code, outside of Wine's control.

    • I think that's more of a description of the implementation than a description of the interface. In terms of the interface, VKD3D_RESOURCE_PRESENT_STATE_TRANSITION simply means that the "present_state" field is valid / not ignored.

      Thanks for the explanation, it makes a lot more sense now. Hopefully I put it reasonably well in the latest revision. I also took the liberty to fix a little control flow in vk_barrier_parameters_from_d3d12_resource_state(), since I wasn't aware that COMMON and PRESENT were the same thing, and this code gadget was quite misleading:

      if (present_state == PRESENT)
          ...
      else if (present_state != COMMON)
          ...
    • Please register or sign in to reply
  • added 4 commits

    • ed8d5921 - vkd3d: Simplify control flow for swapchain images.
    • ec44df4b - include: Document structure vkd3d_device_create_info.
    • 54e2f827 - include: Document structure vkd3d_optional_device_extensions_info.
    • c116119b - include: Document structure vkd3d_image_resource_create_info.

    Compare with previous version

  • +     *  * instead, the transition request is interpreted as if state present_state was intially
    +     *    requested (this can be useful if the client is doing other operations on the image, such
    +     *    as copying to another swapchain image).

    I think some text is missing here? Also, "initially".

  • added 1 commit

    • a008bc0b - include: Document structure vkd3d_image_resource_create_info.

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • added 72 commits

    • a008bc0b...95489899 - 68 commits from branch wine:master
    • 5d78eeb6 - vkd3d: Simplify control flow for swapchain images.
    • 2b1abc5d - include: Document structure vkd3d_device_create_info.
    • 2679b10f - include: Document structure vkd3d_optional_device_extensions_info.
    • 3f43d06f - include: Document structure vkd3d_image_resource_create_info.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

Please register or sign in to reply
Loading