ATTN: do NOT use GL_LINES and immediate mode
Moderator: Moderators
ATTN: do NOT use GL_LINES and immediate mode
DO NOT USE GL_LINES AND IMMEDIATE MODE (glBegin/glEnd). i found it to be the cause of ATI driver memory leak, which is (most likely) responsible for crashes without stacktrace that have been recently happening.
Re: ATTN: do NOT use GL_LINES and immediate mode
Know of any common widgets/gadgets that combine the two?
Edit: Ouch, even stuff like customformations seems to have this.
Edit: Ouch, even stuff like customformations seems to have this.
Code: Select all
glBeginEnd(GL_LINE_STRIP, DrawFormationLine, fNodes)
Re: ATTN: do NOT use GL_LINES and immediate mode
yeah, that was one of the things that led me to this conclusion, unfortunately.Beherith wrote:Know of any common widgets/gadgets that combine the two?
Edit: Ouch, even stuff like customformations seems to have this.Code: Select all
glBeginEnd(GL_LINE_STRIP, DrawFormationLine, fNodes)
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: ATTN: do NOT use GL_LINES and immediate mode
Many widgets use that combination, I count at least 4 for BA (CA has same + more):
Loop Select
CustomFormations2
Defense Range
Attack AoE
Loop Select
CustomFormations2
Defense Range
Attack AoE
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: ATTN: do NOT use GL_LINES and immediate mode
If anyone wants to step up and fix these widgets for BA and let me know that'd be great otherwise recommendations for the best replacement functions would be appreciated as my GL experience isn't huge.
Re: ATTN: do NOT use GL_LINES and immediate mode
my experimental results indicate that after removing the biggest offenders from the engine, it's relatively safe to use GL_LINES and friends - but the next version will print a warning every 120 frames if you use them.
Re: ATTN: do NOT use GL_LINES and immediate mode
Great, I use all those widgetsSirMaverick wrote:Many widgets use that combination, I count at least 4 for BA (CA has same + more):
Loop Select
CustomFormations2
Defense Range
Attack AoE
Re: ATTN: do NOT use GL_LINES and immediate mode
as a temporary workaround, you can greatly reduce the leak by disabling unconditional drawing of command queues. edit cmdcolors.txt and replace with
Code: Select all
alwaysDrawQueue 1
Code: Select all
alwaysDrawQueue 0
Re: ATTN: do NOT use GL_LINES and immediate mode
how do you propose we draw lines?
Re: ATTN: do NOT use GL_LINES and immediate mode
buy Nvidia...
Is there a specific ATI driver version that provoked this problem?
Is there a specific ATI driver version that provoked this problem?
Last edited by trepan on 14 Feb 2010, 23:24, edited 1 time in total.
Re: ATTN: do NOT use GL_LINES and immediate mode
haven't tested it, but a display list may be free of this problem.
trepan: according to testing done here http://springrts.com/mantis/view.php?id=1573, it's catalyst 9.8.
trepan: according to testing done here http://springrts.com/mantis/view.php?id=1573, it's catalyst 9.8.
Re: ATTN: do NOT use GL_LINES and immediate mode
There is no replacement for immediate mode in lua, so please just print the warning for ATi users.
PS: And perhaps start a petition, so ATI fixes their drivers. As long as you proved that it is really caused by this (with a small demo app).
PS: And perhaps start a petition, so ATI fixes their drivers. As long as you proved that it is really caused by this (with a small demo app).
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: ATTN: do NOT use GL_LINES and immediate mode
Could someone report it?
http://www.amdsurveys.com/se.ashx?s=5A1E27D27E29B0E3
http://www.amdsurveys.com/se.ashx?s=5A1E27D27E29B0E3
Re: ATTN: do NOT use GL_LINES and immediate mode
This issue seems much more complex, because the leak is triggered by something I haven't determined. E.g. after removing line stipple, the leak was happening only when zoomed out enough to see unit icons instead of proper models.jK wrote:There is no replacement for immediate mode in lua, so please just print the warning for ATi users.
PS: And perhaps start a petition, so ATI fixes their drivers. As long as you proved that it is really caused by this (with a small demo app).
Printing a warning only for ati users is pointless since it's not a warning for the user, it's for the developer. We can remove it altogether and hope the leak won't come back (my limited testing showed that memory consumption is rather stable after changing line drawer).
Re: ATTN: do NOT use GL_LINES and immediate mode
if (ati) { return; }
Re: ATTN: do NOT use GL_LINES and immediate mode
This is why I'm not a fan of ATI. They have too many issues with their drivers that lead to incompatibilities and performance issues with my favorite games.
Not that nvidia doesn't have their fair share of problems either, it's just that nvidia's are better supported.
Not that nvidia doesn't have their fair share of problems either, it's just that nvidia's are better supported.
Re: ATTN: do NOT use GL_LINES and immediate mode
btw reported this problem on that amd survey site.
Re: ATTN: do NOT use GL_LINES and immediate mode
imbaczek wrote:Printing a warning only for ati users is pointless since it's not a warning for the user, it's for the developer. We can remove it altogether and hope the leak won't come back (my limited testing showed that memory consumption is rather stable after changing line drawer).jK wrote:There is no replacement for immediate mode in lua, so please just print the warning for ATi users.
Re: ATTN: do NOT use GL_LINES and immediate mode
Er, great... so ATi's drivers are broken for Point Objects and Lines? That's totally ludicrous.
So, what about all of the other code that uses GL.LINES in Spring, i.e., commands and weapon ranges?
What about gl.GroundCircle?
So, what about all of the other code that uses GL.LINES in Spring, i.e., commands and weapon ranges?
What about gl.GroundCircle?
Last edited by Argh on 16 Feb 2010, 21:00, edited 1 time in total.
Re: ATTN: do NOT use GL_LINES and immediate mode
So how do retail developers work around this bug? Simply not including drawn lines in their games, instead drawing them as a system of polygons?