[PATCH 1/2] wined3d: Clamp negative scissor offset to 0.

Jan Sikorski jsikorski at codeweavers.com
Tue May 4 04:56:53 CDT 2021


This should not change behavior, however on some Vulkan implementations,
negative scissor offset combined with negative viewport offset causes
nothing to be drawn.

Signed-off-by: Jan Sikorski <jsikorski at codeweavers.com>
---
 dlls/wined3d/context_vk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index fbc1e294fcd..c50a12fac28 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -2204,6 +2204,10 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
             key->scissor.extent.width = key->viewport.width;
             key->scissor.extent.height = key->viewport.height;
         }
+        if (key->scissor.offset.x < 0)
+            key->scissor.offset.x = 0;
+        if (key->scissor.offset.y < 0)
+            key->scissor.offset.y = 0;
         key->viewport.y += key->viewport.height;
         key->viewport.height = -key->viewport.height;
 
-- 
2.30.2




More information about the wine-devel mailing list