From 40d1a40f294f1ed2dacfad6f5498322fc08cc2d1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Jun 2008 16:13:42 -0600 Subject: mesa: refactor: move #define FEATURE flags into new mfeatures.h file Also, check the FEATURE flags in many places. --- src/mesa/main/teximage.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/teximage.c') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 384e145520..eed1937517 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -32,7 +32,9 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" +#if FEATURE_convolve #include "convolve.h" +#endif #include "fbobject.h" #include "framebuffer.h" #include "image.h" @@ -2429,9 +2431,11 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (target == GL_TEXTURE_1D) { /* non-proxy target */ @@ -2524,10 +2528,12 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } +#endif if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && @@ -2746,10 +2752,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ if (is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, 1, format, type)) { @@ -2804,11 +2812,13 @@ _mesa_TexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ if (is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } +#endif if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, 1, format, type)) { @@ -2918,9 +2928,11 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (copytexture_error_check(ctx, 1, target, level, internalFormat, postConvWidth, 1, border)) @@ -2981,11 +2993,12 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } - +#endif if (copytexture_error_check(ctx, 2, target, level, internalFormat, postConvWidth, postConvHeight, border)) return; @@ -3047,8 +3060,10 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); +#endif if (copytexsubimage_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1)) @@ -3100,8 +3115,10 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); +#endif if (copytexsubimage_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight)) @@ -3152,8 +3169,10 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); +#endif if (copytexsubimage_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight)) -- cgit v1.2.3