From e4b2356c07d31fbeeabb13b2fb47db703b473080 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 May 2005 20:11:35 +0000 Subject: Major check-in of changes for GL_EXT_framebuffer_object extension. Main driver impacts: - new code for creating the Mesa GLframebuffer - new span/pixel read/write code Some drivers not yet updated/tested. --- src/mesa/main/enable.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f53ae05d17..671db68ce8 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -301,7 +301,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) break; case GL_DEPTH_TEST: - if (state && ctx->Visual.depthBits==0) { + if (state && ctx->DrawBuffer->Visual.depthBits == 0) { _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer"); return; } @@ -575,7 +575,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Texture.SharedPalette = state; break; case GL_STENCIL_TEST: - if (state && ctx->Visual.stencilBits==0) { + if (state && ctx->DrawBuffer->Visual.stencilBits == 0) { _mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer"); return; @@ -591,7 +591,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE_1D_BIT; if (state) newenabled |= TEXTURE_1D_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -603,7 +604,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE_2D_BIT; if (state) newenabled |= TEXTURE_2D_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -615,7 +617,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE_3D_BIT; if (state) newenabled |= TEXTURE_3D_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -777,7 +780,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION(ARB_texture_cube_map, cap); if (state) newenabled |= TEXTURE_CUBE_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -938,7 +942,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION(NV_texture_rectangle, cap); if (state) newenabled |= TEXTURE_RECT_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -972,7 +977,7 @@ void _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->Visual.depthBits==0) { + if (state && ctx->DrawBuffer->Visual.depthBits == 0) { _mesa_warning(ctx, "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer"); return; -- cgit v1.2.3