diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-09-07 17:28:24 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2009-09-12 20:55:55 +0800 |
commit | ec86469c55c3f531c00ead130a31071ad8aede48 (patch) | |
tree | 9f2e95e9777bc49ee9e93533793b98fc01bdfea2 /src/mesa/main/convolve.h | |
parent | 5bcfe4b5c81f850d68d3100b8bcd2f2b74a258a6 (diff) |
mesa/main: Make FEATURE_convolve follow feature conventions.
As shown in mfeatures.h, this allows users of convolve.h to work
without knowing if the feature is available.
Diffstat (limited to 'src/mesa/main/convolve.h')
-rw-r--r-- | src/mesa/main/convolve.h | 67 |
1 files changed, 54 insertions, 13 deletions
diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 4505cdae01..565a51ef8f 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -28,10 +28,17 @@ #define CONVOLVE_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_convolve + +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyConvolutionFilter1D = impl ## CopyConvolutionFilter1D; \ + (driver)->CopyConvolutionFilter2D = impl ## CopyConvolutionFilter2D; \ + } while (0) + extern void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); @@ -83,32 +90,66 @@ _mesa_SeparableFilter2D(GLenum target, GLenum internalformat, const GLvoid *row, const GLvoid *column); - extern void _mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, const GLfloat *srcImage, GLfloat *dstImage); - extern void _mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, const GLfloat *srcImage, GLfloat *dstImage); - extern void _mesa_convolve_sep_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, const GLfloat *srcImage, GLfloat *dstImage); - extern void _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, GLsizei *width, GLsizei *height); -#else -#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) -#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) -#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) -#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) -#endif +extern void +_mesa_init_convolve_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_convolve */ + +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void +_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, + const GLfloat *srcImage, GLfloat *dstImage) +{ + *width = 0; +} + +static INLINE void +_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage) +{ + *width = 0; + *height = 0; +} + + +static INLINE void +_mesa_convolve_sep_image(const GLcontext *ctx, + GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage) +{ + *width = 0; + *height = 0; +} + +static INLINE void +_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, + GLsizei *width, GLsizei *height) +{ +} + +static INLINE void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_convolve */ -#endif +#endif /* CONVOLVE_H */ |