From 6fa4e98bae0a417a66ffd5204048d492ec134f93 Mon Sep 17 00:00:00 2001 From: Washu Hakubi Date: Sun, 16 Jun 2024 10:49:52 -0700 Subject: [PATCH] Ensure bgfx does not create a new thread for rendering, which causes stalls/crashes on macos. --- src/bigg.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bigg.cpp b/src/bigg.cpp index 43271a1..a8940ca 100644 --- a/src/bigg.cpp +++ b/src/bigg.cpp @@ -196,6 +196,10 @@ int bigg::Application::run( int argc, char** argv, bgfx::RendererType::Enum type glfwSetWindowSizeCallback( mWindow, windowSizeCallback ); // Setup bgfx + // Render a frame to prevent init from creating a separate render thread. + // Rendering generally has to happen on the same thread as the window. + bgfx::renderFrame(); + bgfx::PlatformData platformData; memset( &platformData, 0, sizeof( platformData ) ); #if BX_PLATFORM_LINUX || BX_PLATFORM_BSD