From 98f16cd1252e62e9fc76c3b41ab86fcc0fe149a7 Mon Sep 17 00:00:00 2001 From: Hristo Iliev Date: Tue, 29 Aug 2023 06:07:37 +0300 Subject: [PATCH] Fix an issue where initializing DX11 headless would cause a crash. (#3164) --- src/renderer_d3d11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index a2ddbd687..9bde033e8 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -2263,8 +2263,8 @@ namespace bgfx { namespace d3d11 if (NULL == m_backBufferDepthStencil) { D3D11_TEXTURE2D_DESC dsd; - dsd.Width = m_scd.width; - dsd.Height = m_scd.height; + dsd.Width = bx::uint32_max(m_scd.width, 1); + dsd.Height = bx::uint32_max(m_scd.height, 1); dsd.MipLevels = 1; dsd.ArraySize = 1; dsd.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;