mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[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:
parent
8702374bf7
commit
87dc472a8d
@ -1895,10 +1895,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 } };
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user