From e4f168a6f4911a096be97d2e83ef8ad9c5862ec0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 Jan 2010 09:35:12 -0700 Subject: glapi: clean-up and simplify glapi_nop.c code Removed _glapi_noop_enable_warnings() and _glapi_set_warning_func(). Just check the DEBUG env vars and call fprintf(stderr) with a warning message instead. --- src/mesa/main/context.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 320c59068c..a570506d57 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -415,14 +415,6 @@ one_time_init( GLcontext *ctx ) _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F; } - if (_mesa_getenv("MESA_DEBUG")) { - _glapi_noop_enable_warnings(GL_TRUE); - _glapi_set_warning_func( (_glapi_warning_func) _mesa_warning ); - } - else { - _glapi_noop_enable_warnings(GL_FALSE); - } - #if defined(DEBUG) && defined(__DATE__) && defined(__TIME__) _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n", MESA_VERSION_STRING, __DATE__, __TIME__); -- cgit v1.2.3 From a38859569dca1d8b139c4c451499bf6e328379e9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 29 Jan 2010 08:38:11 -0700 Subject: mesa: do state validation in _mesa_valid_to_render() ...rather than checking/validating before all the calls to _mesa_valid_to_render() and valid_to_render(). The next patch will actually fix some bugs... (cherry picked from commit 23eda89ec89e2bd5bc26077bd56e8d6b5d4040d4) --- src/mesa/main/api_validate.c | 9 --------- src/mesa/main/context.c | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index e71e5a6ce8..013048bbc1 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -190,9 +190,6 @@ _mesa_validate_DrawElements(GLcontext *ctx, return GL_FALSE; } - if (ctx->NewState) - _mesa_update_state(ctx); - if (!check_valid_to_render(ctx, "glDrawElements")) return GL_FALSE; @@ -254,9 +251,6 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, return GL_FALSE; } - if (ctx->NewState) - _mesa_update_state(ctx); - if (!check_valid_to_render(ctx, "glDrawRangeElements")) return GL_FALSE; @@ -304,9 +298,6 @@ _mesa_validate_DrawArrays(GLcontext *ctx, return GL_FALSE; } - if (ctx->NewState) - _mesa_update_state(ctx); - if (!check_valid_to_render(ctx, "glDrawArrays")) return GL_FALSE; diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index a570506d57..eb6bc8e436 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1578,6 +1578,10 @@ _mesa_set_mvp_with_dp4( GLcontext *ctx, GLboolean _mesa_valid_to_render(GLcontext *ctx, const char *where) { + /* This depends on having up to date derived state (shaders) */ + if (ctx->NewState) + _mesa_update_state(ctx); + if (ctx->Shader.CurrentProgram) { /* using shaders */ if (!ctx->Shader.CurrentProgram->LinkStatus) { -- cgit v1.2.3