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.