diff --git a/internal/graphicsdriver/directx/graphics_windows.go b/internal/graphicsdriver/directx/graphics_windows.go index 42a60ab86..6255f4f4e 100644 --- a/internal/graphicsdriver/directx/graphics_windows.go +++ b/internal/graphicsdriver/directx/graphics_windows.go @@ -577,7 +577,8 @@ func (g *Graphics) End(present bool) error { return err } - if present { + // The screen image can be nil in the very first frame (#2081). + if present && g.screenImage != nil { g.screenImage.transiteState(g.drawCommandList, _D3D12_RESOURCE_STATE_PRESENT) }