@@ -354,6 +354,9 @@ func handlePanic(r interface{}) {
354354 memory := fmt .Sprintf ("RAM in Use: %v MB / OS Reserved: %v MB" , mem .Alloc / 1024 / 1024 , mem .Sys / 1024 / 1024 )
355355 threads := fmt .Sprintf ("Active Goroutines: %d" , runtime .NumGoroutine ())
356356
357+ // Renderer debug info (GPU memory stats, etc.)
358+ rendererDebug := gfx .DebugInfo ()
359+
357360 // Identify the crash type
358361 crashType := "Fatal runtime error" // Default for unsafe crashes
359362 if _ , ok := r .(* lua.ApiError ); ok {
@@ -371,6 +374,9 @@ func handlePanic(r interface{}) {
371374 // Optional: print error to terminal
372375 // We have to do this manually now because we recover() from the actual panic
373376 fmt .Fprintf (os .Stderr , "Panic: %s\n \n %s\n " , errStr , goStack )
377+ if rendererDebug != "" {
378+ fmt .Fprintf (os .Stderr , "\n Renderer Debug Info:\n %s\n " , rendererDebug )
379+ }
374380
375381 // Write to log file
376382 logDir := filepath .Join (sys .baseDir , "save" , "logs" )
@@ -382,6 +388,9 @@ func handlePanic(r interface{}) {
382388 fmt .Fprintf (f , "%s\n %s\n %s\n %s\n %s\n %s\n Timestamp: %s\n \n %s\n \n Error: %s\n \n %s" ,
383389 version , buildTime , platform , render , memory , threads ,
384390 now .Format ("2006-01-02 15:04:05" ), crashType , errStr , goStack )
391+ if rendererDebug != "" {
392+ fmt .Fprintf (f , "\n \n Renderer Debug Info:\n %s" , rendererDebug )
393+ }
385394 f .Close ()
386395 }
387396
0 commit comments