vkd3d: Handle empty viewports.
Assassin's Creed Valhalla relies on this. Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
parent
ecc504922e
commit
6886bb7f11
|
@ -4739,15 +4739,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(d3d12_command_li
|
|||
viewport_count = ARRAY_SIZE(dyn_state->viewports);
|
||||
}
|
||||
|
||||
for (i = 0; i < viewport_count; ++i)
|
||||
{
|
||||
if (!viewports[i].Width || !viewports[i].Height)
|
||||
{
|
||||
FIXME_ONCE("Invalid viewport %u, ignoring RSSetViewports().\n", i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < viewport_count; ++i)
|
||||
{
|
||||
VkViewport *vk_viewport = &dyn_state->viewports[i];
|
||||
|
@ -4757,6 +4748,12 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(d3d12_command_li
|
|||
vk_viewport->height = -viewports[i].Height;
|
||||
vk_viewport->minDepth = viewports[i].MinDepth;
|
||||
vk_viewport->maxDepth = viewports[i].MaxDepth;
|
||||
|
||||
if (vk_viewport->width <= 0.0f)
|
||||
{
|
||||
vk_viewport->width = 1.0f;
|
||||
vk_viewport->height = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (dyn_state->viewport_count != viewport_count)
|
||||
|
|
Loading…
Reference in New Issue