From 6ec955efafda961bc7789c22dbde9d3430fc270f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jul 2009 07:58:22 -0600 Subject: mesa: regenerated enums.c file --- src/mesa/main/enums.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 417cee8fb2a..dff55440867 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -948,8 +948,8 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0" "GL_MAX_VARYING_FLOATS\0" "GL_MAX_VARYING_FLOATS_ARB\0" - "GL_MAX_VERTEX_GENERIC_ATTRIBS\0" - "GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB\0" + "GL_MAX_VERTEX_ATTRIBS\0" + "GL_MAX_VERTEX_ATTRIBS_ARB\0" "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0" "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0" "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0" @@ -2772,8 +2772,8 @@ static const enum_elt all_enums[1820] = { 19417, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ { 19452, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ { 19474, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19500, 0x00008869 }, /* GL_MAX_VERTEX_GENERIC_ATTRIBS */ - { 19522, 0x00008869 }, /* GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB */ + { 19500, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19522, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ { 19548, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ { 19582, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ { 19620, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ @@ -4733,7 +4733,7 @@ static const unsigned reduced_enums[1319] = 317, /* GL_CURRENT_QUERY */ 1259, /* GL_QUERY_RESULT */ 1261, /* GL_QUERY_RESULT_AVAILABLE */ - 912, /* GL_MAX_VERTEX_GENERIC_ATTRIBS */ + 912, /* GL_MAX_VERTEX_ATTRIBS */ 1778, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ 368, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ 367, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ @@ -5081,6 +5081,7 @@ const char *_mesa_lookup_prim_by_nr( int nr ) } + int _mesa_lookup_enum_by_name( const char *symbol ) { enum_elt * f = NULL; -- cgit v1.2.3 From 9aca6769dfb934e15e848f938b7fb31345a8b3b2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jul 2009 14:26:42 -0600 Subject: mesa: fix texture border color code for glPopAttrib() The texture object's border color used to be stored as GLchan but it's been GLfloat for a while now. --- src/mesa/main/attrib.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index a609199504e..4d85d54bb9e 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -849,7 +849,6 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate) /* Restore texture object state for each target */ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { const struct gl_texture_object *obj = NULL; - GLfloat bordColor[4]; GLenum target; obj = &texstate->SavedObj[u][tgt]; @@ -875,12 +874,7 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate) _mesa_BindTexture(target, obj->Name); - bordColor[0] = CHAN_TO_FLOAT(obj->BorderColor[0]); - bordColor[1] = CHAN_TO_FLOAT(obj->BorderColor[1]); - bordColor[2] = CHAN_TO_FLOAT(obj->BorderColor[2]); - bordColor[3] = CHAN_TO_FLOAT(obj->BorderColor[3]); - - _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, bordColor); + _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, obj->BorderColor); _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, obj->WrapS); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, obj->WrapT); -- cgit v1.2.3 From 6c9d8a6f24db3c947928d72521d5fd544841366e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Jul 2009 16:23:04 +0100 Subject: mesa: don't call getenv every time _mesa_error is called Buggy apps can generate thousands of mesa_error calls. Don't need to keep calling getenv to retreive the same MESA_DEBUG string each time. --- src/mesa/main/imports.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 3fb67083a2d..b0e7d9d4835 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1081,22 +1081,25 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) void _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) { - const char *debugEnv; - GLboolean debug; + static GLint debug = -1; - debugEnv = _mesa_getenv("MESA_DEBUG"); + /* Check debug environment variable only once: + */ + if (debug == -1) { + const char *debugEnv = _mesa_getenv("MESA_DEBUG"); #ifdef DEBUG - if (debugEnv && _mesa_strstr(debugEnv, "silent")) - debug = GL_FALSE; - else - debug = GL_TRUE; + if (debugEnv && _mesa_strstr(debugEnv, "silent")) + debug = GL_FALSE; + else + debug = GL_TRUE; #else - if (debugEnv) - debug = GL_TRUE; - else - debug = GL_FALSE; + if (debugEnv) + debug = GL_TRUE; + else + debug = GL_FALSE; #endif + } if (debug) { va_list args; -- cgit v1.2.3 From df5f7a676182dc9d1d8c9c995a009b49bac971e8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Jul 2009 16:25:59 +0100 Subject: mesa: remove dead code in _mesa_error Remove early and unused snprintf and where[] string. --- src/mesa/main/imports.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index b0e7d9d4835..c35dcf5bd24 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1102,14 +1102,8 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) } if (debug) { - va_list args; - char where[MAXSTRING]; const char *errstr; - va_start( args, fmtString ); - vsnprintf( where, MAXSTRING, fmtString, args ); - va_end( args ); - switch (error) { case GL_NO_ERROR: errstr = "GL_NO_ERROR"; -- cgit v1.2.3 From 59de430de70c38a2fbe30208190f725a2901613c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Jul 2009 16:28:08 +0100 Subject: mesa: split out errorstring switch from _mesa_error Move a chunk of code out of _mesa_error() --- src/mesa/main/imports.c | 62 +++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index c35dcf5bd24..3916c62eda3 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1065,6 +1065,31 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) fprintf(stderr, "Please report at bugzilla.freedesktop.org\n"); } +static const char *error_string( GLenum error ) +{ + switch (error) { + case GL_NO_ERROR: + return "GL_NO_ERROR"; + case GL_INVALID_VALUE: + return "GL_INVALID_VALUE"; + case GL_INVALID_ENUM: + return "GL_INVALID_ENUM"; + case GL_INVALID_OPERATION: + return "GL_INVALID_OPERATION"; + case GL_STACK_OVERFLOW: + return "GL_STACK_OVERFLOW"; + case GL_STACK_UNDERFLOW: + return "GL_STACK_UNDERFLOW"; + case GL_OUT_OF_MEMORY: + return "GL_OUT_OF_MEMORY"; + case GL_TABLE_TOO_LARGE: + return "GL_TABLE_TOO_LARGE"; + case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: + return "GL_INVALID_FRAMEBUFFER_OPERATION"; + default: + return "unknown"; + } +} /** * Record an OpenGL state error. These usually occur when the user @@ -1102,41 +1127,6 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) } if (debug) { - const char *errstr; - - switch (error) { - case GL_NO_ERROR: - errstr = "GL_NO_ERROR"; - break; - case GL_INVALID_VALUE: - errstr = "GL_INVALID_VALUE"; - break; - case GL_INVALID_ENUM: - errstr = "GL_INVALID_ENUM"; - break; - case GL_INVALID_OPERATION: - errstr = "GL_INVALID_OPERATION"; - break; - case GL_STACK_OVERFLOW: - errstr = "GL_STACK_OVERFLOW"; - break; - case GL_STACK_UNDERFLOW: - errstr = "GL_STACK_UNDERFLOW"; - break; - case GL_OUT_OF_MEMORY: - errstr = "GL_OUT_OF_MEMORY"; - break; - case GL_TABLE_TOO_LARGE: - errstr = "GL_TABLE_TOO_LARGE"; - break; - case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: - errstr = "GL_INVALID_FRAMEBUFFER_OPERATION"; - break; - default: - errstr = "unknown"; - break; - } - { char s[MAXSTRING], s2[MAXSTRING]; va_list args; @@ -1144,7 +1134,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - _mesa_snprintf(s2, MAXSTRING, "%s in %s", errstr, s); + _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); } } -- cgit v1.2.3 From fdeb77899052302053459b8a840a747346e30468 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 15 Jul 2009 13:29:58 +0100 Subject: mesa: recognize and eliminate repeated error messages --- src/mesa/main/imports.c | 34 +++++++++++++++++++++++++++++++--- src/mesa/main/mtypes.h | 7 +++++++ 2 files changed, 38 insertions(+), 3 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 3916c62eda3..1722579e82c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1021,6 +1021,22 @@ output_if_debug(const char *prefixString, const char *outputString, } } +static const char *error_string( GLenum error ); + +static void flush_delayed_errors( GLcontext *ctx ) +{ + char s2[MAXSTRING]; + + if (ctx->ErrorDebugCount) { + _mesa_snprintf(s2, MAXSTRING, "%d similar %s errors", + ctx->ErrorDebugCount, + error_string(ctx->ErrorValue)); + + output_if_debug("Mesa: ", s2, GL_TRUE); + + ctx->ErrorDebugCount = 0; + } +} /** * Report a warning (a recoverable error condition) to stderr if @@ -1034,10 +1050,12 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) { char str[MAXSTRING]; va_list args; - (void) ctx; va_start( args, fmtString ); (void) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); + + if (ctx) + flush_delayed_errors( ctx ); output_if_debug("Mesa warning", str, GL_TRUE); } @@ -1126,16 +1144,26 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) #endif } - if (debug) { - { + if (debug) { + if (ctx->ErrorValue == error && + ctx->ErrorDebugFmtString == fmtString) { + ctx->ErrorDebugCount++; + } + else { char s[MAXSTRING], s2[MAXSTRING]; va_list args; + + flush_delayed_errors( ctx ); + va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); + + ctx->ErrorDebugFmtString = fmtString; + ctx->ErrorDebugCount = 0; } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index bdaa4977b72..3b0ebcb7aef 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2955,6 +2955,13 @@ struct __GLcontextRec #endif GLenum ErrorValue; /**< Last error code */ + + /** + * Recognize and silence repeated error debug messages in buggy apps. + */ + const char *ErrorDebugFmtString; + GLuint ErrorDebugCount; + GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ -- cgit v1.2.3 From d970313b66b3aab3e3d12c65882febcc7c9091a8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 15 Jul 2009 11:12:05 -0600 Subject: Fix state flag dependencies for fixed function fragment program updates. I started looking into why _NEW_ARRAY punishes us, and while annotating dependencies noticed that a bunch of dependencies were missing. (cherry picked from master, commit e5f63c403b767f9974e8eb5d412c012b8a69287f) --- src/mesa/main/state.c | 2 +- src/mesa/main/texenvprogram.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 94e37e3dab5..1d3758a302b 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -502,7 +502,7 @@ _mesa_update_state_locked( GLcontext *ctx ) /* Determine which state flags effect vertex/fragment program state */ if (ctx->FragmentProgram._MaintainTexEnvProgram) { prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR | - _NEW_ARRAY); + _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE); } if (ctx->VertexProgram._MaintainTnlProgram) { prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index b92ba2542d2..a3f1246c985 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -261,6 +261,7 @@ static GLuint translate_tex_src_bit( GLbitfield bit ) */ static GLbitfield get_fp_input_mask( GLcontext *ctx ) { + /* _NEW_PROGRAM */ const GLboolean vertexShader = (ctx->Shader.CurrentProgram && ctx->Shader.CurrentProgram->VertexProgram); const GLboolean vertexProgram = ctx->VertexProgram._Enabled; @@ -274,22 +275,26 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) fp_inputs = ~0; } else if (ctx->RenderMode == GL_FEEDBACK) { + /* _NEW_RENDERMODE */ fp_inputs = (FRAG_BIT_COL0 | FRAG_BIT_TEX0); } else if (!(vertexProgram || vertexShader) || !ctx->VertexProgram._Current) { /* Fixed function vertex logic */ + /* _NEW_ARRAY */ GLbitfield varying_inputs = ctx->varying_vp_inputs; /* These get generated in the setup routine regardless of the * vertex program: */ + /* _NEW_POINT */ if (ctx->Point.PointSprite) varying_inputs |= FRAG_BITS_TEX_ANY; /* First look at what values may be computed by the generated * vertex program: */ + /* _NEW_LIGHT */ if (ctx->Light.Enabled) { fp_inputs |= FRAG_BIT_COL0; @@ -297,6 +302,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) fp_inputs |= FRAG_BIT_COL1; } + /* _NEW_TEXTURE */ fp_inputs |= (ctx->Texture._TexGenEnabled | ctx->Texture._TexMatEnabled) << FRAG_ATTRIB_TEX0; @@ -329,6 +335,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) /* These get generated in the setup routine regardless of the * vertex program: */ + /* _NEW_POINT */ if (ctx->Point.PointSprite) vp_outputs |= FRAG_BITS_TEX_ANY; @@ -355,6 +362,7 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) memset(key, 0, sizeof(*key)); + /* _NEW_TEXTURE */ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; GLenum format; @@ -408,11 +416,13 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) } } + /* _DD_NEW_SEPARATE_SPECULAR */ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { key->separate_specular = 1; inputs_referenced |= FRAG_BIT_COL1; } + /* _NEW_FOG */ if (ctx->Fog.Enabled) { key->fog_enabled = 1; key->fog_mode = translate_fog_mode(ctx->Fog.Mode); -- cgit v1.2.3 From 71b9e102913753bc5af23c774641d6a6dda184d9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Jul 2009 12:40:44 -0600 Subject: mesa: set version to 7.5 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 52ee324d172..ba027465d48 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -31,7 +31,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 5 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.5-rc4" +#define MESA_VERSION_STRING "7.5" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3