Opened 12 years ago

Last modified 11 years ago

#31 new enhancement

Graceful handling of projection stack overflow.

Reported by: Ben Lippmeier Owned by:
Priority: low Milestone:
Component: Rendering Version: 1.7.0
Keywords: Cc:

Description

As of gloss 1.7.6.3 we get this error on the console when the projection stack overflows:

Main: Gloss / OpenGL Stack Overflow.
  This program uses the Gloss vector graphics library, which tried to
  draw a picture using more nested transforms (Translate/Rotate/Scale)
  than your OpenGL implementation supports. The OpenGL spec requires
  all implementations to have a transform stack depth of at least 32,
  and Gloss tries not to push the stack when it doesn't have to, but
  that still wasn't enough.

  You should complain to your harware vendor that they don't provide
  a better way to handle this situation at the OpenGL API level.

  To make this program work you'll need to reduce the number of nested
  transforms used when defining the Picture given to Gloss. Sorry.

To completely fix this we would need to implement our own external projection stack, but that wouldn't be as fast as the internal hardware stack. Perhaps we could check the picture before rendering it, and only used the external stack when there are too many nested transforms.

Another option might be to detect the stack overflow condition, then pop and save stack frames to memory, before continuing. We'd then have to restore the stack on the way back down. What a hassle.

Change History (2)

comment:1 Changed 12 years ago by Ben Lippmeier

Milestone: 1.8.0
Type: defectenhancement

comment:2 Changed 11 years ago by Ben Lippmeier

A half-way house would be to compress adjacent transforms of the same sort, eg Translate 10 20 (Translate 30 40) ... This would fix the most common cases.

Note: See TracTickets for help on using tickets.