2025-07-21 09:45 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003712Spring engineGeneralpublic2013-04-22 13:04
Reporterabma 
Assigned TojK 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version95.0 
Target Version94.1.1+gitFixed in Version 
Summary0003712: LoadingMT seems to still cause trouble on some systems
Descriptionhttps://github.com/spring/spring/commit/d6b0e6b33ed6686f7d25e446fe0e2b8696eed668#commitcomment-2982220

First a GL fact:
When you call a GL function e.g. glColor4f(), then you make a call directly into the GL driver (assuming DRI under X11). In general you don't make a call to the OS! This is in contrast to DirectX, where you make calls to the DirectX layer first which then calls the gpu driver. This adds a overhead layer to directx which makes many calls slower than under GL.

Now @CodeXL:
When you create a GL context you normally would have to retrieve all GL function pointers from this exact GL context. Cause theoretically your GL contexts could reside on different GPUs, and so a GL function called in one context would have to speak to a diff gpu driver than the same GL function in another GL ctx.
Now we normally make sure all contexts reside on the same GPU and so would speak to the same gpu driver. But the gpu driver is still allowed to return different function pointers for those ctx's, afaik NV doesn't do so, but I know ATI returns different pointers depending on the requested GL versions for the ctx. And it seems CodeXL does something similar. This can cause issues, yeah even crashes.
Still the only solution is to retrieve all gl function pointers for each ctx and then save it in ThreadLocalStorage. And GLEW even has a flag for it. Why don't we do so?

    TLS is much slower (if ideal 2-3x, worst case 12x)
    all distro shipped GLEWs are compiled without that specific flag, so we would need to include GLEW into Spring. Maybe there is a way w/o that, but then all relevant GL functions need to be called via a namespace/class.
    GML
    all our GL ctx should reside on same GPU and use same GL version
    makes stuff more complicated
Steps To ReproduceATI + Mac:
http://springrts.com/phpbb/viewtopic.php?f=65&t=30123&p=539783&hilit=LoadingMT#p539783

no system details known:
http://springrts.com/phpbb/viewtopic.php?f=11&t=29793&p=539377&hilit=LoadingMT#p539377

windows and nvidia (!!!)
http://springrts.com/phpbb/viewtopic.php?p=536687#p536687 :
[f=0000000] SDL version: 1.2.10
[f=0000000] GL version: 4.3.0
[f=0000000] GL vendor: NVIDIA Corporation
[f=0000000] GL renderer: Quadro 2000M/PCIe/SSE2
[f=0000000] GLSL version: 4.30 NVIDIA via Cg compiler
[f=0000000] GLEW version: 1.5.8
[f=0000000] Video RAM: total 2048MB, available 1873MB
[f=0000000] Installing OpenGL-DebugMessageHandler
[f=0000000] GL info:

TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0010530

abma (administrator)

tried with a known "crasher", here the detection seems to work fine:


[f=0000000] LoadingScreen: single-threaded

so, imo fixed / wait for a release other reports.
+Notes

-Issue History
Date Modified Username Field Change
2013-04-16 23:47 abma New Issue
2013-04-16 23:48 abma Description Updated View Revisions
2013-04-16 23:51 abma Steps to Reproduce Updated View Revisions
2013-04-17 00:58 abma Product Version => 95.0
2013-04-20 11:19 jK Changeset attached => spring develop a7899c29
2013-04-22 13:04 abma Note Added: 0010530
2013-04-22 13:04 abma Status new => resolved
2013-04-22 13:04 abma Resolution open => fixed
2013-04-22 13:04 abma Assigned To => jK
+Issue History