From adfa778c8ea436d6e62c37327b44f6ff359ed63f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 14:19:06 -0600 Subject: mesa: remove rgbMode check in enable_texture() If the currently bound FBO isn't yet validated it's possible for rgbMode to be zero so we'll lose the texture enable. This could fix some FBO rendering glitches, but I don't know of any specific instances. --- src/mesa/main/enable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f432be183c..47d19ab932 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -231,7 +231,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) const GLuint newenabled = (!state) ? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit); - if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled) + if (texUnit->Enabled == newenabled) return GL_FALSE; FLUSH_VERTICES(ctx, _NEW_TEXTURE); -- cgit v1.2.3 From 60b152a1b366b1c9b9326dda1d91ab600fbb0d86 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 14:24:14 -0600 Subject: mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning At the time of the enable there may not be a Z buffer, but one may be attached to the FBO later. --- src/mesa/main/enable.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 47d19ab932..d1b21756fe 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -933,11 +933,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state && ctx->DrawBuffer->Visual.depthBits == 0) { - _mesa_warning(ctx, - "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer"); - return; - } if (ctx->Depth.BoundsTest == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); -- cgit v1.2.3 From eb82373abb08171d7fcb15b5f4f229fc9ca9aa91 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 09:22:33 -0600 Subject: mesa: use _mesa_get_current_tex_unit() helper --- src/mesa/main/enable.c | 4 ++-- src/mesa/main/fbobject.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 8e6b01f73b..4383aed669 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -37,6 +37,7 @@ #include "mtypes.h" #include "enums.h" #include "api_arrayelt.h" +#include "texstate.h" @@ -228,8 +229,7 @@ get_texcoord_unit(GLcontext *ctx) static GLboolean enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit) { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); const GLbitfield newenabled = state ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 13f49da5a7..680fd22ba8 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -44,6 +44,7 @@ #include "teximage.h" #include "texobj.h" #include "texstore.h" +#include "texstate.h" /** Set this to 1 to help debug FBO incompleteness problems */ @@ -1955,7 +1956,7 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); _mesa_lock_texture(ctx, texObj); -- cgit v1.2.3