From 27b46269070bacc70ffa4298b6d88f5e8685c410 Mon Sep 17 00:00:00 2001 From: fs Date: Mon, 24 Mar 2025 15:46:34 +0200 Subject: [PATCH] Added a check for badly defined scissor rectangles that caused a crash when resizing the window with dx11 backend --- code/platform_win32/4ed_dx11_render.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/platform_win32/4ed_dx11_render.cpp b/code/platform_win32/4ed_dx11_render.cpp index 8eb6763b..2dedcbe5 100644 --- a/code/platform_win32/4ed_dx11_render.cpp +++ b/code/platform_win32/4ed_dx11_render.cpp @@ -560,6 +560,9 @@ gl_render(Render_Target *t){ group = group->next){ Rect_i32 box = Ri32(group->clip_box); + // NOTE(FS): Ignore this group if we our scissor rectangle is not well defined + if ((rect_width(box) <= 0) || (rect_height(box) <= 0)) continue; + D3D11_RECT group_scissor = { }; group_scissor.left = box.x0; group_scissor.right = box.x1;