[dxvk] Set empty scissor rect when the app requests empty viewport

Since we cannot set the viewport size to zero, we should set an
empty scissor rect so that rasterization is still effectively
disabled for the given viewport index.

Fixes #813, #957.
This commit is contained in:
Philip Rebohle 2019-04-01 15:45:41 +02:00
parent 44b79b5dc6
commit d74b55b95a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 5 additions and 1 deletions

View File

@ -1615,10 +1615,14 @@ namespace dxvk {
m_state.vp.scissorRects[i] = scissorRects[i];
// Vulkan viewports are not allowed to have a width or
// height of zero, so we fall back to a dummy viewport.
// height of zero, so we fall back to a dummy viewport
// and instead set an empty scissor rect, which is legal.
if (viewports[i].width == 0.0f || viewports[i].height == 0.0f) {
m_state.vp.viewports[i] = VkViewport {
0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f };
m_state.vp.scissorRects[i] = VkRect2D {
VkOffset2D { 0, 0 },
VkExtent2D { 0, 0 } };
}
}