Skip to content
Snippets Groups Projects

vkd3d: Do not skip all viewports if one is invalid.

Merged Conor McCarthy requested to merge cmccarthy/vkd3d:viewports into master

Merge request reports

Merge request pipeline #9830 skipped

Merge request pipeline skipped for a4a95aa9

Approval is optional

Merged by Alexandre JulliardAlexandre Julliard 1 year ago (Apr 20, 2023 8:57pm UTC)

Merge details

  • Changes merged into master with a4a95aa9.
  • Deleted 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
  • From patch 2/4:

    @@ -3954,24 +3954,25 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCo
             viewport_count = ARRAY_SIZE(vk_viewports);
         }
     
    -    for (i = 0; i < viewport_count; ++i)
    +    for (i = 0, count = 0; i < viewport_count; ++i)
         {
    -        vk_viewports[i].x = viewports[i].TopLeftX;
    -        vk_viewports[i].y = viewports[i].TopLeftY + viewports[i].Height;
    -        vk_viewports[i].width = viewports[i].Width;
    -        vk_viewports[i].height = -viewports[i].Height;
    -        vk_viewports[i].minDepth = viewports[i].MinDepth;
    -        vk_viewports[i].maxDepth = viewports[i].MaxDepth;
    +        vk_viewports[count].x = viewports[i].TopLeftX;
    +        vk_viewports[count].y = viewports[i].TopLeftY + viewports[i].Height;
    +        vk_viewports[count].width = viewports[i].Width;
    +        vk_viewports[count].height = -viewports[i].Height;
    +        vk_viewports[count].minDepth = viewports[i].MinDepth;
    +        vk_viewports[count].maxDepth = viewports[i].MaxDepth;
     
    -        if (!vk_viewports[i].width || !vk_viewports[i].height)
    +        if (!vk_viewports[count].width || !vk_viewports[count].height)
             {
    -            FIXME_ONCE("Invalid viewport %u, ignoring RSSetViewports().\n", i);
    -            return;
    +            FIXME_ONCE("Ignoring invalid viewport %u.\n", i);
    +            continue;
             }
    +        ++count;
         }
     
         vk_procs = &list->device->vk_procs;
    -    VK_CALL(vkCmdSetViewport(list->vk_command_buffer, 0, viewport_count, vk_viewports));
    +    VK_CALL(vkCmdSetViewport(list->vk_command_buffer, 0, count, vk_viewports));
     }

    Unfortunately there are no corresponding tests, but this seems to imply that if a viewport in the middle of the array is invalid, subsequent viewports will get a different index for the purpose of e.g. SpvBuiltInViewportIndex. Is that really how it's supposed to work?

    From patch 4/4:

    Vulkan 1.1 introduced support for heights <= 0.

    Yes, but so did VK_KHR_maintenance1, which we already require.

  • Conor McCarthy added 1 commit

    added 1 commit

    • 9d2c5add - vkd3d: Do not skip all viewports if one is invalid.

    Compare with previous version

  • Conor McCarthy changed title from vkd3d: Fix viewport support by using Vulkan 1.1 if available. to vkd3d: Do not skip all viewports if one is invalid.

    changed title from vkd3d: Fix viewport support by using Vulkan 1.1 if available. to vkd3d: Do not skip all viewports if one is invalid.

  • Conor McCarthy changed the description

    changed the description

  • Conor McCarthy added 2 commits

    added 2 commits

    • 1ea23daf - vkd3d: Do not skip all viewports if one is invalid.
    • f942b16f - vkd3d: Treat negative viewport widths as invalid.

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard added 29 commits

    added 29 commits

    • f942b16f...81cc077b - 27 commits from branch wine:master
    • 5d724abc - vkd3d: Do not skip all viewports if one is invalid.
    • a4a95aa9 - vkd3d: Treat negative viewport widths as invalid.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

Please register or sign in to reply
Loading