mesa/main: Make FEATURE_colortable follow feature conventions.
As shown in mfeatures.h, this allows users of colortab.h to work without knowing if the feature is available.
This commit is contained in:
@@ -54,9 +54,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "clear.h"
|
#include "clear.h"
|
||||||
#include "clip.h"
|
#include "clip.h"
|
||||||
#if FEATURE_colortable
|
|
||||||
#include "colortab.h"
|
#include "colortab.h"
|
||||||
#endif
|
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#if FEATURE_convolve
|
#if FEATURE_convolve
|
||||||
#include "convolve.h"
|
#include "convolve.h"
|
||||||
@@ -385,17 +383,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
|
|||||||
SET_BlendEquation(exec, _mesa_BlendEquation);
|
SET_BlendEquation(exec, _mesa_BlendEquation);
|
||||||
SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
|
SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
|
||||||
|
|
||||||
#if FEATURE_colortable
|
_mesa_init_colortable_dispatch(exec);
|
||||||
SET_ColorSubTable(exec, _mesa_ColorSubTable);
|
|
||||||
SET_ColorTable(exec, _mesa_ColorTable);
|
|
||||||
SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv);
|
|
||||||
SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv);
|
|
||||||
SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable);
|
|
||||||
SET_CopyColorTable(exec, _mesa_CopyColorTable);
|
|
||||||
SET_GetColorTable(exec, _mesa_GetColorTable);
|
|
||||||
SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv);
|
|
||||||
SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if FEATURE_convolve
|
#if FEATURE_convolve
|
||||||
SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D);
|
SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D);
|
||||||
|
@@ -32,6 +32,10 @@
|
|||||||
#include "state.h"
|
#include "state.h"
|
||||||
#include "teximage.h"
|
#include "teximage.h"
|
||||||
#include "texstate.h"
|
#include "texstate.h"
|
||||||
|
#include "glapi/dispatch.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if FEATURE_colortable
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -536,7 +540,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_CopyColorTable(GLenum target, GLenum internalformat,
|
_mesa_CopyColorTable(GLenum target, GLenum internalformat,
|
||||||
GLint x, GLint y, GLsizei width)
|
GLint x, GLint y, GLsizei width)
|
||||||
{
|
{
|
||||||
@@ -552,7 +556,7 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_CopyColorSubTable(GLenum target, GLsizei start,
|
_mesa_CopyColorSubTable(GLenum target, GLsizei start,
|
||||||
GLint x, GLint y, GLsizei width)
|
GLint x, GLint y, GLsizei width)
|
||||||
{
|
{
|
||||||
@@ -568,7 +572,7 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_GetColorTable( GLenum target, GLenum format,
|
_mesa_GetColorTable( GLenum target, GLenum format,
|
||||||
GLenum type, GLvoid *data )
|
GLenum type, GLvoid *data )
|
||||||
{
|
{
|
||||||
@@ -702,7 +706,7 @@ _mesa_GetColorTable( GLenum target, GLenum format,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
||||||
{
|
{
|
||||||
GLfloat *scale, *bias;
|
GLfloat *scale, *bias;
|
||||||
@@ -747,7 +751,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
|
_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
|
||||||
{
|
{
|
||||||
GLfloat fparams[4];
|
GLfloat fparams[4];
|
||||||
@@ -770,7 +774,7 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
|
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
@@ -897,7 +901,7 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
|
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
@@ -1052,6 +1056,25 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
_mesa_init_colortable_dispatch(struct _glapi_table *disp)
|
||||||
|
{
|
||||||
|
SET_ColorSubTable(disp, _mesa_ColorSubTable);
|
||||||
|
SET_ColorTable(disp, _mesa_ColorTable);
|
||||||
|
SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv);
|
||||||
|
SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv);
|
||||||
|
SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable);
|
||||||
|
SET_CopyColorTable(disp, _mesa_CopyColorTable);
|
||||||
|
SET_GetColorTable(disp, _mesa_GetColorTable);
|
||||||
|
SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv);
|
||||||
|
SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FEATURE_colortable */
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/***** Initialization *****/
|
/***** Initialization *****/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
@@ -27,9 +27,16 @@
|
|||||||
#define COLORTAB_H
|
#define COLORTAB_H
|
||||||
|
|
||||||
|
|
||||||
#include "mtypes.h"
|
#include "main/mtypes.h"
|
||||||
|
|
||||||
#if _HAVE_FULL_GL
|
#if FEATURE_colortable
|
||||||
|
|
||||||
|
#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) \
|
||||||
|
do { \
|
||||||
|
(driver)->CopyColorTable = impl ## CopyColorTable; \
|
||||||
|
(driver)->CopyColorSubTable = impl ## CopyColorSubTable; \
|
||||||
|
(driver)->UpdateTexturePalette = impl ## UpdateTexturePalette; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_ColorTable( GLenum target, GLenum internalformat,
|
_mesa_ColorTable( GLenum target, GLenum internalformat,
|
||||||
@@ -41,32 +48,35 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
|
|||||||
GLsizei count, GLenum format, GLenum type,
|
GLsizei count, GLenum format, GLenum type,
|
||||||
const GLvoid *table );
|
const GLvoid *table );
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void
|
||||||
_mesa_CopyColorSubTable(GLenum target, GLsizei start,
|
_mesa_init_colortable_dispatch(struct _glapi_table *disp);
|
||||||
GLint x, GLint y, GLsizei width);
|
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
#else /* FEATURE_colortable */
|
||||||
_mesa_CopyColorTable(GLenum target, GLenum internalformat,
|
|
||||||
GLint x, GLint y, GLsizei width);
|
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) do { } while (0)
|
||||||
_mesa_GetColorTable( GLenum target, GLenum format,
|
|
||||||
GLenum type, GLvoid *table );
|
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
static INLINE void GLAPIENTRY
|
||||||
_mesa_ColorTableParameterfv(GLenum target, GLenum pname,
|
_mesa_ColorTable( GLenum target, GLenum internalformat,
|
||||||
const GLfloat *params);
|
GLsizei width, GLenum format, GLenum type,
|
||||||
|
const GLvoid *table )
|
||||||
|
{
|
||||||
|
ASSERT_NO_FEATURE();
|
||||||
|
}
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
static INLINE void GLAPIENTRY
|
||||||
_mesa_ColorTableParameteriv(GLenum target, GLenum pname,
|
_mesa_ColorSubTable( GLenum target, GLsizei start,
|
||||||
const GLint *params);
|
GLsizei count, GLenum format, GLenum type,
|
||||||
|
const GLvoid *table )
|
||||||
|
{
|
||||||
|
ASSERT_NO_FEATURE();
|
||||||
|
}
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
static INLINE void
|
||||||
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params );
|
_mesa_init_colortable_dispatch(struct _glapi_table *disp)
|
||||||
|
{
|
||||||
extern void GLAPIENTRY
|
}
|
||||||
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params );
|
|
||||||
|
|
||||||
|
#endif /* FEATURE_colortable */
|
||||||
|
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
@@ -81,20 +91,5 @@ _mesa_init_colortables( GLcontext *ctx );
|
|||||||
extern void
|
extern void
|
||||||
_mesa_free_colortables_data( GLcontext *ctx );
|
_mesa_free_colortables_data( GLcontext *ctx );
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/** No-op */
|
#endif /* COLORTAB_H */
|
||||||
#define _mesa_init_colortable( p ) ((void) 0)
|
|
||||||
|
|
||||||
/** No-op */
|
|
||||||
#define _mesa_free_colortable_data( p ) ((void) 0)
|
|
||||||
|
|
||||||
/** No-op */
|
|
||||||
#define _mesa_init_colortables( p ) ((void)0)
|
|
||||||
|
|
||||||
/** No-op */
|
|
||||||
#define _mesa_free_colortables_data( p ) ((void)0)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -90,9 +90,7 @@
|
|||||||
#include "blend.h"
|
#include "blend.h"
|
||||||
#include "buffers.h"
|
#include "buffers.h"
|
||||||
#include "bufferobj.h"
|
#include "bufferobj.h"
|
||||||
#if FEATURE_colortable
|
|
||||||
#include "colortab.h"
|
#include "colortab.h"
|
||||||
#endif
|
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "cpuinfo.h"
|
#include "cpuinfo.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
@@ -686,9 +684,7 @@ init_attrib_groups(GLcontext *ctx)
|
|||||||
#endif
|
#endif
|
||||||
_mesa_init_buffer_objects( ctx );
|
_mesa_init_buffer_objects( ctx );
|
||||||
_mesa_init_color( ctx );
|
_mesa_init_color( ctx );
|
||||||
#if FEATURE_colortable
|
|
||||||
_mesa_init_colortables( ctx );
|
_mesa_init_colortables( ctx );
|
||||||
#endif
|
|
||||||
_mesa_init_current( ctx );
|
_mesa_init_current( ctx );
|
||||||
_mesa_init_depth( ctx );
|
_mesa_init_depth( ctx );
|
||||||
_mesa_init_debug( ctx );
|
_mesa_init_debug( ctx );
|
||||||
@@ -1015,9 +1011,7 @@ _mesa_free_context_data( GLcontext *ctx )
|
|||||||
_mesa_free_texture_data( ctx );
|
_mesa_free_texture_data( ctx );
|
||||||
_mesa_free_matrix_data( ctx );
|
_mesa_free_matrix_data( ctx );
|
||||||
_mesa_free_viewport_data( ctx );
|
_mesa_free_viewport_data( ctx );
|
||||||
#if FEATURE_colortable
|
|
||||||
_mesa_free_colortables_data( ctx );
|
_mesa_free_colortables_data( ctx );
|
||||||
#endif
|
|
||||||
_mesa_free_program_data(ctx);
|
_mesa_free_program_data(ctx);
|
||||||
_mesa_free_shader_state(ctx);
|
_mesa_free_shader_state(ctx);
|
||||||
#if FEATURE_ARB_occlusion_query
|
#if FEATURE_ARB_occlusion_query
|
||||||
|
@@ -29,9 +29,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "mfeatures.h"
|
#include "mfeatures.h"
|
||||||
#if FEATURE_colortable
|
|
||||||
#include "colortab.h"
|
#include "colortab.h"
|
||||||
#endif
|
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "fbobject.h"
|
#include "fbobject.h"
|
||||||
@@ -194,9 +192,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
|
|||||||
*/
|
*/
|
||||||
texObj->Target = 0x99;
|
texObj->Target = 0x99;
|
||||||
|
|
||||||
#if FEATURE_colortable
|
|
||||||
_mesa_free_colortable_data(&texObj->Palette);
|
_mesa_free_colortable_data(&texObj->Palette);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* free the texture images */
|
/* free the texture images */
|
||||||
for (face = 0; face < 6; face++) {
|
for (face = 0; face < 6; face++) {
|
||||||
|
@@ -31,9 +31,7 @@
|
|||||||
#include "glheader.h"
|
#include "glheader.h"
|
||||||
#include "mfeatures.h"
|
#include "mfeatures.h"
|
||||||
#include "colormac.h"
|
#include "colormac.h"
|
||||||
#if FEATURE_colortable
|
|
||||||
#include "colortab.h"
|
#include "colortab.h"
|
||||||
#endif
|
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
@@ -753,9 +751,7 @@ _mesa_init_texture(GLcontext *ctx)
|
|||||||
ctx->Texture.CurrentUnit = 0; /* multitexture */
|
ctx->Texture.CurrentUnit = 0; /* multitexture */
|
||||||
ctx->Texture._EnabledUnits = 0x0;
|
ctx->Texture._EnabledUnits = 0x0;
|
||||||
ctx->Texture.SharedPalette = GL_FALSE;
|
ctx->Texture.SharedPalette = GL_FALSE;
|
||||||
#if FEATURE_colortable
|
|
||||||
_mesa_init_colortable(&ctx->Texture.Palette);
|
_mesa_init_colortable(&ctx->Texture.Palette);
|
||||||
#endif
|
|
||||||
|
|
||||||
for (u = 0; u < MAX_TEXTURE_UNITS; u++)
|
for (u = 0; u < MAX_TEXTURE_UNITS; u++)
|
||||||
init_texture_unit(ctx, u);
|
init_texture_unit(ctx, u);
|
||||||
@@ -796,10 +792,8 @@ _mesa_free_texture_data(GLcontext *ctx)
|
|||||||
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++)
|
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++)
|
||||||
ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
|
ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
|
||||||
|
|
||||||
#if FEATURE_colortable
|
|
||||||
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++)
|
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++)
|
||||||
_mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable);
|
_mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user