From 6d16d5311479f69d5b8deefe337be9834f3998f3 Mon Sep 17 00:00:00 2001 From: lotaviods Date: Sat, 7 Mar 2026 12:54:22 -0300 Subject: [PATCH 1/2] chore: Perf graph looks cool i guess --- Minecraft.Client/Minecraft.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 45ef7cd99..3e56f8fd7 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1704,7 +1704,7 @@ void Minecraft::run_middle() timer->advanceTime(); } - //__int64 beforeTickTime = System::nanoTime(); + __int64 beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { bool bLastTimerTick = ( i == ( timer->ticks - 1 ) ); @@ -1790,7 +1790,7 @@ void Minecraft::run_middle() // CompressedTileStorage::tick(); // 4J added // SparseDataStorage::tick(); // 4J added } - //__int64 tickDuraction = System::nanoTime() - beforeTickTime; + __int64 tickDuraction = System::nanoTime() - beforeTickTime; MemSect(31); checkGlError(L"Pre render"); MemSect(0); @@ -1895,10 +1895,10 @@ void Minecraft::run_middle() Sleep(10); } */ - + renderFpsMeter(tickDuraction); if (options->renderDebug) { - //renderFpsMeter(tickDuraction); + #if DEBUG_RENDER_SHOWS_PACKETS // To show data for only one packet type From 612d3e9529cb110f3c5e549d758b840223f0fd69 Mon Sep 17 00:00:00 2001 From: lotaviods Date: Sat, 7 Mar 2026 12:55:38 -0300 Subject: [PATCH 2/2] fix: Now it quite render on AMD cards need more fixes but its a clue maybe display lists are not shared across OpenGL contexts on amd driver --- 4J.Render/4J_Render.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/4J.Render/4J_Render.cpp b/4J.Render/4J_Render.cpp index cd71ee2e7..98fa76daa 100644 --- a/4J.Render/4J_Render.cpp +++ b/4J.Render/4J_Render.cpp @@ -34,7 +34,9 @@ static pthread_once_t s_glCtxKeyOnce = PTHREAD_ONCE_INIT; static void makeGLCtxKey() { pthread_key_create(&s_glCtxKey, nullptr); } // Pre-created pool of shared contexts for worker threads -static const int MAX_SHARED_CONTEXTS = 8; + +// TODO: WAS MAX_SHARED_CONTEXTS = 8 but seems to no render well on AMD cards +static const int MAX_SHARED_CONTEXTS = 3; static GLFWwindow *s_sharedContexts[MAX_SHARED_CONTEXTS] = {}; static int s_sharedContextCount = 0; static int s_nextSharedContext = 0;