#include "clip.h"
#include "colortab.h"
#include "context.h"
-#if FEATURE_convolve
#include "convolve.h"
-#endif
#include "depth.h"
#if FEATURE_dlist
#include "dlist.h"
SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
_mesa_init_colortable_dispatch(exec);
-
-#if FEATURE_convolve
- SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D);
- SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D);
- SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf);
- SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv);
- SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri);
- SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv);
- SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D);
- SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D);
- SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter);
- SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv);
- SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv);
- SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D);
-#endif
+ _mesa_init_convolve_dispatch(exec);
#if FEATURE_histogram
SET_GetHistogram(exec, _mesa_GetHistogram);
SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv);
SET_GetMinmax(exec, _mesa_GetMinmax);
SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv);
SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv);
- SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter);
SET_Histogram(exec, _mesa_Histogram);
SET_Minmax(exec, _mesa_Minmax);
SET_ResetHistogram(exec, _mesa_ResetHistogram);
#include "mtypes.h"
#include "pixel.h"
#include "state.h"
+#include "glapi/dispatch.h"
+
+
+#if FEATURE_convolve
/*
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
{
GET_CURRENT_CONTEXT(ctx);
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
{
GET_CURRENT_CONTEXT(ctx);
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
{
GLint baseFormat;
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
{
GLint baseFormat;
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
GLvoid *image)
{
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column, GLvoid *span)
{
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
{
const GLint colStart = MAX_CONVOLUTION_WIDTH * 4;
*height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1);
}
}
+
+
+void
+_mesa_init_convolve_dispatch(struct _glapi_table *disp)
+{
+ SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D);
+ SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D);
+ SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf);
+ SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv);
+ SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri);
+ SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv);
+ SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D);
+ SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D);
+ SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter);
+ SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv);
+ SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv);
+ SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D);
+ SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter);
+}
+
+
+#endif /* FEATURE_convolve */
#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);
GLsizei height, GLenum format, GLenum type,
const GLvoid *image);
-extern void GLAPIENTRY
-_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params);
-
-extern void GLAPIENTRY
-_mesa_ConvolutionParameterfv(GLenum target, GLenum pname,
- const GLfloat *params);
-
-extern void GLAPIENTRY
-_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params);
-
-extern void GLAPIENTRY
-_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params);
-
-extern void GLAPIENTRY
-_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width);
+extern void
+_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width,
+ const GLfloat *srcImage, GLfloat *dstImage);
-extern void GLAPIENTRY
-_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height);
+extern void
+_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height,
+ const GLfloat *srcImage, GLfloat *dstImage);
-extern void GLAPIENTRY
-_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *image);
+extern void
+_mesa_convolve_sep_image(const GLcontext *ctx,
+ GLsizei *width, GLsizei *height,
+ const GLfloat *srcImage, GLfloat *dstImage);
-extern void GLAPIENTRY
-_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params);
+extern void
+_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions,
+ GLsizei *width, GLsizei *height);
-extern void GLAPIENTRY
-_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params);
+extern void
+_mesa_init_convolve_dispatch(struct _glapi_table *disp);
-extern void GLAPIENTRY
-_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *row, GLvoid *column, GLvoid *span);
+#else /* FEATURE_convolve */
-extern void GLAPIENTRY
-_mesa_SeparableFilter2D(GLenum target, GLenum internalformat,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *row, const GLvoid *column);
+#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) do { } while (0)
+static INLINE void GLAPIENTRY
+_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width,
+ GLenum format, GLenum type, const GLvoid *image)
+{
+ ASSERT_NO_FEATURE();
+}
+static INLINE void GLAPIENTRY
+_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width,
+ GLsizei height, GLenum format, GLenum type,
+ const GLvoid *image)
+{
+ ASSERT_NO_FEATURE();
+}
-extern void
+static INLINE void
_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width,
- const GLfloat *srcImage, GLfloat *dstImage);
-
+ const GLfloat *srcImage, GLfloat *dstImage)
+{
+ ASSERT_NO_FEATURE();
+}
-extern void
+static INLINE void
_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height,
- const GLfloat *srcImage, GLfloat *dstImage);
+ const GLfloat *srcImage, GLfloat *dstImage)
+{
+ ASSERT_NO_FEATURE();
+}
-extern void
+static INLINE void
_mesa_convolve_sep_image(const GLcontext *ctx,
GLsizei *width, GLsizei *height,
- const GLfloat *srcImage, GLfloat *dstImage);
-
+ const GLfloat *srcImage, GLfloat *dstImage)
+{
+ ASSERT_NO_FEATURE();
+}
-extern void
+static INLINE void
_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions,
- GLsizei *width, GLsizei *height);
+ GLsizei *width, GLsizei *height)
+{
+}
+
+static INLINE void
+_mesa_init_convolve_dispatch(struct _glapi_table *disp)
+{
+}
-#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
+#endif /* FEATURE_convolve */
-#endif
+#endif /* CONVOLVE_H */