diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-07-02 13:29:46 +0100 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-07-02 13:29:46 +0100 |
commit | 1668a679c4aadb37f5af0d6126c414fb9fbbf748 (patch) | |
tree | b3edf4157c658f1c37d5e046752135bd2ec566ea /src/mesa/main/enums.c | |
parent | b3e8e1cd4c1584f735e35914861ae2e8ae5b6b2b (diff) | |
parent | 1fa4cde757cc94c0afa40d855309911247974e98 (diff) |
Merge commit 'origin/dlist-statechange-shortcircuit' into mesa_7_5_branch
Conflicts:
progs/trivial/Makefile
Pull in a minimal version of statechange shortcircuiting in display
list compilation. This affects only glMaterial and glShadeModel state,
and includes quite a few tests to exercise various tricky cases.
If this goes well, will consider extending to all state in the future.
Diffstat (limited to 'src/mesa/main/enums.c')
-rw-r--r-- | src/mesa/main/enums.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index cf893fdac5..417cee8fb2 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -5059,6 +5059,28 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } } +/* Get the name of an enum given that it is a primitive type. Avoids + * GL_FALSE/GL_POINTS ambiguity and others. + */ +const char *_mesa_lookup_prim_by_nr( int nr ) +{ + switch (nr) { + case GL_POINTS: return "GL_POINTS"; + case GL_LINES: return "GL_LINES"; + case GL_LINE_STRIP: return "GL_LINE_STRIP"; + case GL_LINE_LOOP: return "GL_LINE_LOOP"; + case GL_TRIANGLES: return "GL_TRIANGLES"; + case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP"; + case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN"; + case GL_QUADS: return "GL_QUADS"; + case GL_QUAD_STRIP: return "GL_QUAD_STRIP"; + case GL_POLYGON: return "GL_POLYGON"; + case GL_POLYGON+1: return "OUTSIDE_BEGIN_END"; + default: return "<invalid>"; + } +} + + int _mesa_lookup_enum_by_name( const char *symbol ) { enum_elt * f = NULL; |