[OPENGL32/MESA]

- Get rid of EXT_secondary_color, ARB_imaging and a few others support
CORE-7499

svn path=/trunk/; revision=63613
This commit is contained in:
Jérôme Gardou 2014-06-18 15:58:59 +00:00
parent ecf5e374ef
commit dfb4d747d4
77 changed files with 292 additions and 3753 deletions

View file

@ -100,9 +100,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
/* simple state commands */
driver->AlphaFunc = NULL;
driver->BlendColor = NULL;
driver->BlendEquationSeparate = NULL;
driver->BlendFuncSeparate = NULL;
driver->ClearColor = NULL;
driver->ClearDepth = NULL;
driver->ClearStencil = NULL;

View file

@ -37,7 +37,6 @@
#include "main/blend.h"
#include "main/bufferobj.h"
#include "main/buffers.h"
#include "main/colortab.h"
#include "main/context.h"
#include "main/depth.h"
#include "main/enable.h"

View file

@ -11,9 +11,7 @@ list(APPEND SOURCE
buffers.c
clear.c
clip.c
colortab.c
context.c
convolve.c
cpuinfo.c
depth.c
dlist.c

View file

@ -157,7 +157,6 @@ static const int NormalFuncs[NUM_TYPES] = {
};
/* Note: _gloffset_* for these may not be a compile-time constant. */
static int SecondaryColorFuncs[NUM_TYPES];
static int FogCoordFuncs[NUM_TYPES];
@ -673,16 +672,6 @@ GLboolean _ae_create_context( struct gl_context *ctx )
if (ctx->aelt_context)
return GL_TRUE;
/* These _gloffset_* values may not be compile-time constants */
SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT;
SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT;
SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT;
SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT;
SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT;
SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT;
SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT;
SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT;
FogCoordFuncs[0] = -1;
FogCoordFuncs[1] = -1;
FogCoordFuncs[2] = -1;
@ -756,18 +745,12 @@ static void _ae_update_state( struct gl_context *ctx )
check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0];
if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled) {
aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR];
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1];
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_FOG];
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];

View file

@ -168,7 +168,6 @@ _mesa_create_exec_table(void)
SET_ReadPixels(exec, _mesa_ReadPixels);
SET_Rotated(exec, _mesa_Rotated);
SET_Scaled(exec, _mesa_Scaled);
SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT);
SET_TexEnvf(exec, _mesa_TexEnvf);
SET_TexEnviv(exec, _mesa_TexEnviv);
@ -206,33 +205,11 @@ _mesa_create_exec_table(void)
SET_VertexPointer(exec, _mesa_VertexPointer);
#endif
/* OpenGL 1.2 GL_ARB_imaging */
SET_BlendColor(exec, _mesa_BlendColor);
SET_BlendEquation(exec, _mesa_BlendEquation);
SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
_mesa_init_colortable_dispatch(exec);
_mesa_init_convolve_dispatch(exec);
/* 2. GL_EXT_blend_color */
#if 0
/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */
#endif
/* 3. GL_EXT_polygon_offset */
#if _HAVE_FULL_GL
SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT);
#endif
/* 14. SGI_color_table */
#if 0
SET_ColorTableSGI(exec, _mesa_ColorTable);
SET_ColorSubTableSGI(exec, _mesa_ColorSubTable);
SET_GetColorTableSGI(exec, _mesa_GetColorTable);
SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv);
SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv);
#endif
/* 30. GL_EXT_vertex_array */
#if _HAVE_FULL_GL
SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT);
@ -243,11 +220,6 @@ _mesa_create_exec_table(void)
SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT);
#endif
/* 37. GL_EXT_blend_minmax */
#if 0
SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT);
#endif
/* 54. GL_EXT_point_parameters */
#if _HAVE_FULL_GL
SET_PointParameterfEXT(exec, _mesa_PointParameterf);
@ -260,11 +232,6 @@ _mesa_create_exec_table(void)
SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT);
#endif
/* 173. GL_INGR_blend_func_separate */
#if _HAVE_FULL_GL
SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT);
#endif
/* 197. GL_MESA_window_pos */
/* part of _mesa_init_rastpos_dispatch(exec); */
@ -325,9 +292,6 @@ _mesa_create_exec_table(void)
SET_TexParameterIivEXT(exec, _mesa_TexParameterIiv);
SET_TexParameterIuivEXT(exec, _mesa_TexParameterIuiv);
/* GL 3.0 (functions not covered by other extensions) */
SET_GetStringi(exec, _mesa_GetStringi);
/* GL_ARB_texture_storage */
SET_TexStorage1D(exec, _mesa_TexStorage1D);
SET_TexStorage2D(exec, _mesa_TexStorage2D);

View file

@ -55,7 +55,6 @@
#define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d))
#define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x))
#define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c))
#define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x))
#define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y))
@ -765,113 +764,6 @@ loopback_Rectsv(const GLshort *v1, const GLshort *v2)
RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
}
static void GLAPIENTRY
loopback_SecondaryColor3bEXT_f( GLbyte red, GLbyte green, GLbyte blue )
{
SECONDARYCOLORF( BYTE_TO_FLOAT(red),
BYTE_TO_FLOAT(green),
BYTE_TO_FLOAT(blue) );
}
static void GLAPIENTRY
loopback_SecondaryColor3dEXT_f( GLdouble red, GLdouble green, GLdouble blue )
{
SECONDARYCOLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue );
}
static void GLAPIENTRY
loopback_SecondaryColor3iEXT_f( GLint red, GLint green, GLint blue )
{
SECONDARYCOLORF( INT_TO_FLOAT(red),
INT_TO_FLOAT(green),
INT_TO_FLOAT(blue));
}
static void GLAPIENTRY
loopback_SecondaryColor3sEXT_f( GLshort red, GLshort green, GLshort blue )
{
SECONDARYCOLORF(SHORT_TO_FLOAT(red),
SHORT_TO_FLOAT(green),
SHORT_TO_FLOAT(blue));
}
static void GLAPIENTRY
loopback_SecondaryColor3uiEXT_f( GLuint red, GLuint green, GLuint blue )
{
SECONDARYCOLORF(UINT_TO_FLOAT(red),
UINT_TO_FLOAT(green),
UINT_TO_FLOAT(blue));
}
static void GLAPIENTRY
loopback_SecondaryColor3usEXT_f( GLushort red, GLushort green, GLushort blue )
{
SECONDARYCOLORF(USHORT_TO_FLOAT(red),
USHORT_TO_FLOAT(green),
USHORT_TO_FLOAT(blue));
}
static void GLAPIENTRY
loopback_SecondaryColor3ubEXT_f( GLubyte red, GLubyte green, GLubyte blue )
{
SECONDARYCOLORF(UBYTE_TO_FLOAT(red),
UBYTE_TO_FLOAT(green),
UBYTE_TO_FLOAT(blue));
}
static void GLAPIENTRY
loopback_SecondaryColor3bvEXT_f( const GLbyte *v )
{
SECONDARYCOLORF(BYTE_TO_FLOAT(v[0]),
BYTE_TO_FLOAT(v[1]),
BYTE_TO_FLOAT(v[2]));
}
static void GLAPIENTRY
loopback_SecondaryColor3dvEXT_f( const GLdouble *v )
{
SECONDARYCOLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
}
static void GLAPIENTRY
loopback_SecondaryColor3ivEXT_f( const GLint *v )
{
SECONDARYCOLORF(INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]),
INT_TO_FLOAT(v[2]));
}
static void GLAPIENTRY
loopback_SecondaryColor3svEXT_f( const GLshort *v )
{
SECONDARYCOLORF(SHORT_TO_FLOAT(v[0]),
SHORT_TO_FLOAT(v[1]),
SHORT_TO_FLOAT(v[2]));
}
static void GLAPIENTRY
loopback_SecondaryColor3uivEXT_f( const GLuint *v )
{
SECONDARYCOLORF(UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1]),
UINT_TO_FLOAT(v[2]));
}
static void GLAPIENTRY
loopback_SecondaryColor3usvEXT_f( const GLushort *v )
{
SECONDARYCOLORF(USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]),
USHORT_TO_FLOAT(v[2]));
}
static void GLAPIENTRY
loopback_SecondaryColor3ubvEXT_f( const GLubyte *v )
{
SECONDARYCOLORF(UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]));
}
/*
* GL_NV_vertex_program:
@ -1026,21 +918,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest )
SET_Color4uiv(dest, loopback_Color4uiv_f);
SET_Color4usv(dest, loopback_Color4usv_f);
SET_Color4ubv(dest, loopback_Color4ubv_f);
SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f);
SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f);
SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f);
SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f);
SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f);
SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f);
SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f);
SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f);
SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f);
SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f);
SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f);
SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f);
SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f);
SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f);
SET_EdgeFlagv(dest, loopback_EdgeFlagv);

View file

@ -218,67 +218,6 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
}
/**
* Error checking for glDrawRangeElements(). Includes parameter checking
* and VBO bounds checking.
* \return GL_TRUE if OK to render, GL_FALSE if error found
*/
GLboolean
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
GLuint start, GLuint end,
GLsizei count, GLenum type,
const GLvoid *indices)
{
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
if (count <= 0) {
if (count < 0)
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(count)" );
return GL_FALSE;
}
if (!_mesa_valid_prim_mode(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(mode)" );
return GL_FALSE;
}
if (end < start) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(end<start)");
return GL_FALSE;
}
if (type != GL_UNSIGNED_INT &&
type != GL_UNSIGNED_BYTE &&
type != GL_UNSIGNED_SHORT) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(type)" );
return GL_FALSE;
}
if (!check_valid_to_render(ctx, "glDrawRangeElements"))
return GL_FALSE;
/* Vertex buffer object tests */
if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
/* use indices in the buffer object */
/* make sure count doesn't go outside buffer bounds */
if (index_bytes(type, count) > ctx->Array.ElementArrayBufferObj->Size) {
_mesa_warning(ctx, "glDrawRangeElements index out of buffer bounds");
return GL_FALSE;
}
}
else {
/* not using a VBO */
if (!indices)
return GL_FALSE;
}
if (!check_index_bounds(ctx, count, type, indices))
return GL_FALSE;
return GL_TRUE;
}
/**
* Called from the tnl module to error check the function parameters and
* verify that we really can draw something.

View file

@ -55,10 +55,4 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices);
extern GLboolean
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
GLuint start, GLuint end,
GLsizei count, GLenum type,
const GLvoid *indices);
#endif

View file

@ -723,25 +723,7 @@ _mesa_PopAttrib(void)
_mesa_set_enable(ctx, GL_BLEND, (color->BlendEnabled & 1));
}
/* set same blend modes for all buffers */
_mesa_BlendFuncSeparateEXT(color->SrcRGB,
color->DstRGB,
color->SrcA,
color->DstA);
/* This special case is because glBlendEquationSeparateEXT
* cannot take GL_LOGIC_OP as a parameter.
*/
if (color->EquationRGB == color->EquationA) {
_mesa_BlendEquation(color->EquationRGB);
}
else {
_mesa_BlendEquationSeparateEXT(
color->EquationRGB,
color->EquationA);
}
_mesa_BlendColor(color->BlendColor[0],
color->BlendColor[1],
color->BlendColor[2],
color->BlendColor[3]);
_mesa_BlendFunc(color->SrcFactor, color->DstFactor);
_mesa_LogicOp(color->LogicOp);
_mesa_set_enable(ctx, GL_COLOR_LOGIC_OP,
color->ColorLogicOpEnabled);
@ -856,8 +838,6 @@ _mesa_PopAttrib(void)
(GLfloat) light->Model.LocalViewer);
_mesa_LightModelf(GL_LIGHT_MODEL_TWO_SIDE,
(GLfloat) light->Model.TwoSide);
_mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
(GLfloat) light->Model.ColorControl);
/* shade model */
_mesa_ShadeModel(light->ShadeModel);
/* color material */
@ -1063,33 +1043,30 @@ copy_pixelstore(struct gl_context *ctx,
static void
copy_array_attrib(struct gl_context *ctx,
struct gl_array_attrib *dest,
struct gl_array_attrib *src,
GLboolean vbo_deleted)
struct gl_array_attrib *src)
{
/* skip ArrayObj */
/* skip DefaultArrayObj, Objects */
dest->LockFirst = src->LockFirst;
dest->LockCount = src->LockCount;
/* skip NewState */
/* skip RebindArrays */
GLuint i;
if (!vbo_deleted)
{
GLuint i;
/* skip ArrayObj */
/* skip DefaultArrayObj, Objects */
dest->LockFirst = src->LockFirst;
dest->LockCount = src->LockCount;
/* skip NewState */
/* skip RebindArrays */
/* skip Name */
/* skip RefCount */
for (i = 0; i < Elements(src->VertexAttrib); i++)
_mesa_copy_client_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
/* skip Name */
/* skip RefCount */
/* _Enabled must be the same than on push */
dest->_Enabled = src->_Enabled;
dest->_MaxElement = src->_MaxElement;
}
for (i = 0; i < Elements(src->VertexAttrib); i++)
_mesa_copy_client_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
/* skip ArrayBufferObj */
/* skip ElementArrayBufferObj */
/* _Enabled must be the same than on push */
dest->_Enabled = src->_Enabled;
dest->_MaxElement = src->_MaxElement;
/* skip ArrayBufferObj */
/* skip ElementArrayBufferObj */
}
/**
@ -1101,11 +1078,9 @@ save_array_attrib(struct gl_context *ctx,
struct gl_array_attrib *src)
{
/* And copy all of the rest. */
copy_array_attrib(ctx, dest, src, GL_FALSE);
copy_array_attrib(ctx, dest, src);
/* Just reference them here */
_mesa_reference_buffer_object(ctx, &dest->ArrayBufferObj,
src->ArrayBufferObj);
_mesa_reference_buffer_object(ctx, &dest->ElementArrayBufferObj,
src->ElementArrayBufferObj);
}
@ -1118,17 +1093,7 @@ restore_array_attrib(struct gl_context *ctx,
struct gl_array_attrib *dest,
struct gl_array_attrib *src)
{
/* Restore or recreate the buffer objects by the names ... */
if (!src->ArrayBufferObj->Name == 0
|| _mesa_IsBufferARB(src->ArrayBufferObj->Name)) {
/* ... and restore its content */
copy_array_attrib(ctx, dest, src, GL_FALSE);
_mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB,
src->ArrayBufferObj->Name);
} else {
copy_array_attrib(ctx, dest, src, GL_TRUE);
}
copy_array_attrib(ctx, dest, src);
if (src->ElementArrayBufferObj->Name == 0
|| _mesa_IsBufferARB(src->ElementArrayBufferObj->Name))
@ -1146,19 +1111,6 @@ restore_array_attrib(struct gl_context *ctx,
dest->NewState |= src->_Enabled | dest->_Enabled;
}
/**
* Free/unreference the fields of 'attrib' but don't delete it (that's
* done later in the calling code).
* Needs to the cleanup part matching init_array_attrib_data above.
*/
static void
free_array_attrib_data(struct gl_context *ctx,
struct gl_array_attrib *attrib)
{
_mesa_reference_buffer_object(ctx, &attrib->ArrayBufferObj, NULL);
_mesa_free_varray_data(ctx, attrib);
}
void GLAPIENTRY
_mesa_PushClientAttrib(GLbitfield mask)
@ -1243,7 +1195,7 @@ _mesa_PopClientAttrib(void)
struct gl_array_attrib * attr =
(struct gl_array_attrib *) node->data;
restore_array_attrib(ctx, &ctx->Array, attr);
free_array_attrib_data(ctx, attr);
_mesa_free_varray_data(ctx, attr);
ctx->NewState |= _NEW_ARRAY;
break;
}

View file

@ -97,34 +97,19 @@ legal_dst_factor(const struct gl_context *ctx, GLenum factor)
*/
static GLboolean
validate_blend_factors(struct gl_context *ctx, const char *func,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA)
GLenum srcfactor, GLenum dstfactor)
{
if (!legal_src_factor(ctx, sfactorRGB)) {
if (!legal_src_factor(ctx, srcfactor)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(sfactorRGB = %s)", func,
_mesa_lookup_enum_by_nr(sfactorRGB));
_mesa_lookup_enum_by_nr(srcfactor));
return GL_FALSE;
}
if (!legal_dst_factor(ctx, dfactorRGB)) {
if (!legal_dst_factor(ctx, dstfactor)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(dfactorRGB = %s)", func,
_mesa_lookup_enum_by_nr(dfactorRGB));
return GL_FALSE;
}
if (sfactorA != sfactorRGB && !legal_src_factor(ctx, sfactorA)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(sfactorA = %s)", func,
_mesa_lookup_enum_by_nr(sfactorA));
return GL_FALSE;
}
if (dfactorA != dfactorRGB && !legal_dst_factor(ctx, dfactorA)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(dfactorA = %s)", func,
_mesa_lookup_enum_by_nr(dfactorA));
_mesa_lookup_enum_by_nr(dstfactor));
return GL_FALSE;
}
@ -138,190 +123,32 @@ validate_blend_factors(struct gl_context *ctx, const char *func,
* \param sfactor source factor operator.
* \param dfactor destination factor operator.
*
* \sa glBlendFunc, glBlendFuncSeparateEXT
* \sa glBlendFunc
*/
void GLAPIENTRY
_mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
{
_mesa_BlendFuncSeparateEXT(sfactor, dfactor, sfactor, dfactor);
}
/**
* Set the separate blend source/dest factors for all draw buffers.
*
* \param sfactorRGB RGB source factor operator.
* \param dfactorRGB RGB destination factor operator.
* \param sfactorA alpha source factor operator.
* \param dfactorA alpha destination factor operator.
*/
void GLAPIENTRY
_mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n",
_mesa_lookup_enum_by_nr(sfactorRGB),
_mesa_lookup_enum_by_nr(dfactorRGB),
_mesa_lookup_enum_by_nr(sfactorA),
_mesa_lookup_enum_by_nr(dfactorA));
_mesa_debug(ctx, "glBlendFunc %s %s\n",
_mesa_lookup_enum_by_nr(sfactor),
_mesa_lookup_enum_by_nr(dfactor));
if (!validate_blend_factors(ctx, "glBlendFuncSeparate",
sfactorRGB, dfactorRGB,
sfactorA, dfactorA)) {
if (!validate_blend_factors(ctx, "glBlendFunc", sfactor, dfactor)) {
return;
}
if (ctx->Color.SrcRGB == sfactorRGB &&
ctx->Color.DstRGB == dfactorRGB &&
ctx->Color.SrcA == sfactorA &&
ctx->Color.DstA == dfactorA) {
if (ctx->Color.SrcFactor == sfactor &&
ctx->Color.DstFactor == dfactor) {
return;
}
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.SrcRGB = sfactorRGB;
ctx->Color.DstRGB = dfactorRGB;
ctx->Color.SrcA = sfactorA;
ctx->Color.DstA = dfactorA;
if (ctx->Driver.BlendFuncSeparate) {
ctx->Driver.BlendFuncSeparate(ctx, sfactorRGB, dfactorRGB,
sfactorA, dfactorA);
}
}
#if _HAVE_FULL_GL
/**
* Check if given blend equation is legal.
* \return GL_TRUE if legal, GL_FALSE otherwise.
*/
static GLboolean
legal_blend_equation(const struct gl_context *ctx, GLenum mode)
{
switch (mode) {
case GL_FUNC_ADD:
case GL_FUNC_SUBTRACT:
case GL_FUNC_REVERSE_SUBTRACT:
return GL_TRUE;
case GL_MIN:
case GL_MAX:
return ctx->Extensions.EXT_blend_minmax;
default:
return GL_FALSE;
}
}
/* This is really an extension function! */
void GLAPIENTRY
_mesa_BlendEquation( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendEquation(%s)\n",
_mesa_lookup_enum_by_nr(mode));
if (!legal_blend_equation(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquation");
return;
}
if (ctx->Color.EquationRGB == mode && ctx->Color.EquationA == mode) {
return;
}
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.EquationRGB = mode;
ctx->Color.EquationA = mode;
if (ctx->Driver.BlendEquationSeparate)
(*ctx->Driver.BlendEquationSeparate)( ctx, mode, mode );
}
void GLAPIENTRY
_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n",
_mesa_lookup_enum_by_nr(modeRGB),
_mesa_lookup_enum_by_nr(modeA));
if ( (modeRGB != modeA) && !ctx->Extensions.EXT_blend_equation_separate ) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBlendEquationSeparateEXT not supported by driver");
return;
}
if (!legal_blend_equation(ctx, modeRGB)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeRGB)");
return;
}
if (!legal_blend_equation(ctx, modeA)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeA)");
return;
}
if (ctx->Color.EquationRGB == modeRGB && ctx->Color.EquationA == modeA) {
return;
}
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.EquationRGB = modeRGB;
ctx->Color.EquationA = modeA;
if (ctx->Driver.BlendEquationSeparate)
ctx->Driver.BlendEquationSeparate(ctx, modeRGB, modeA);
}
#endif /* _HAVE_FULL_GL */
/**
* Set the blending color.
*
* \param red red color component.
* \param green green color component.
* \param blue blue color component.
* \param alpha alpha color component.
*
* \sa glBlendColor().
*
* Clamps the parameters and updates gl_colorbuffer_attrib::BlendColor. On a
* change, flushes the vertices and notifies the driver via
* dd_function_table::BlendColor callback.
*/
void GLAPIENTRY
_mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
GLfloat tmp[4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
tmp[0] = red;
tmp[1] = green;
tmp[2] = blue;
tmp[3] = alpha;
if (TEST_EQ_4V(tmp, ctx->Color.BlendColor))
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4FV( ctx->Color.BlendColor, tmp );
if (ctx->Driver.BlendColor)
(*ctx->Driver.BlendColor)(ctx, ctx->Color.BlendColor);
ctx->Color.SrcFactor = sfactor;
ctx->Color.DstFactor = dfactor;
}
@ -507,13 +334,8 @@ void _mesa_init_color( struct gl_context * ctx )
ctx->Color.AlphaFunc = GL_ALWAYS;
ctx->Color.AlphaRef = 0;
ctx->Color.BlendEnabled = 0x0;
ctx->Color.SrcRGB = GL_ONE;
ctx->Color.DstRGB = GL_ZERO;
ctx->Color.SrcA = GL_ONE;
ctx->Color.DstA = GL_ZERO;
ctx->Color.EquationRGB = GL_FUNC_ADD;
ctx->Color.EquationA = GL_FUNC_ADD;
ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
ctx->Color.SrcFactor = GL_ONE;
ctx->Color.DstFactor = GL_ZERO;
ctx->Color.IndexLogicOpEnabled = GL_FALSE;
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
ctx->Color.LogicOp = GL_COPY;

View file

@ -42,24 +42,6 @@ extern void GLAPIENTRY
_mesa_BlendFunc( GLenum sfactor, GLenum dfactor );
extern void GLAPIENTRY
_mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA );
extern void GLAPIENTRY
_mesa_BlendEquation( GLenum mode );
extern void GLAPIENTRY
_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA );
extern void GLAPIENTRY
_mesa_BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
extern void GLAPIENTRY
_mesa_AlphaFunc( GLenum func, GLclampf ref );

View file

@ -55,8 +55,6 @@ static inline struct gl_buffer_object **
get_buffer_target(struct gl_context *ctx, GLenum target)
{
switch (target) {
case GL_ARRAY_BUFFER_ARB:
return &ctx->Array.ArrayBufferObj;
case GL_ELEMENT_ARRAY_BUFFER_ARB:
return &ctx->Array.ElementArrayBufferObj;
default:
@ -474,16 +472,6 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
memset(&DummyBufferObject, 0, sizeof(DummyBufferObject));
_glthread_INIT_MUTEX(DummyBufferObject.Mutex);
DummyBufferObject.RefCount = 1000*1000*1000; /* never delete */
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj,
ctx->Shared->NullBufferObj);
}
void
_mesa_free_buffer_objects( struct gl_context *ctx )
{
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
}
@ -674,9 +662,6 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
unbind(ctx, &ctx->Array.VertexAttrib[j].BufferObj, bufObj);
}
if (ctx->Array.ArrayBufferObj == bufObj) {
_mesa_BindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
}
if (ctx->Array.ElementArrayBufferObj == bufObj) {
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
}

View file

@ -1,140 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 7.1
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <precomp.h>
#if FEATURE_colortable
void GLAPIENTRY
_mesa_ColorTable( GLenum target, GLenum internalFormat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *data )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)");
}
void GLAPIENTRY
_mesa_ColorSubTable( GLenum target, GLsizei start,
GLsizei count, GLenum format, GLenum type,
const GLvoid *data )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)");
}
static void GLAPIENTRY
_mesa_CopyColorTable(GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorTable(target)");
}
static void GLAPIENTRY
_mesa_CopyColorSubTable(GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorSubTable(target)");
}
static void GLAPIENTRY
_mesa_GetColorTable( GLenum target, GLenum format,
GLenum type, GLvoid *data )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)");
}
static void GLAPIENTRY
_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
/* no extensions use this function */
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(target)");
}
static void GLAPIENTRY
_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
{
/* no extensions use this function */
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameteriv(target)");
}
static void GLAPIENTRY
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(target)");
}
static void GLAPIENTRY
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(target)");
}
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 */

View file

@ -1,76 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef COLORTAB_H
#define COLORTAB_H
#include "compiler.h"
#include "glheader.h"
#include "mfeatures.h"
struct _glapi_table;
#if FEATURE_colortable
extern void GLAPIENTRY
_mesa_ColorTable( GLenum target, GLenum internalformat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *table );
extern void GLAPIENTRY
_mesa_ColorSubTable( GLenum target, GLsizei start,
GLsizei count, GLenum format, GLenum type,
const GLvoid *table );
extern void
_mesa_init_colortable_dispatch(struct _glapi_table *disp);
#else /* FEATURE_colortable */
static inline void GLAPIENTRY
_mesa_ColorTable( GLenum target, GLenum internalformat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *table )
{
ASSERT_NO_FEATURE();
}
static inline void GLAPIENTRY
_mesa_ColorSubTable( GLenum target, GLsizei start,
GLsizei count, GLenum format, GLenum type,
const GLvoid *table )
{
ASSERT_NO_FEATURE();
}
static inline void
_mesa_init_colortable_dispatch(struct _glapi_table *disp)
{
}
#endif /* FEATURE_colortable */
#endif /* COLORTAB_H */

View file

@ -97,9 +97,6 @@
/** Line width granularity */
#define LINE_WIDTH_GRANULARITY 0.1
/** Max texture palette / color table size */
#define MAX_COLOR_TABLE_SIZE 256
/** Max memory to allow for a single texture image (in megabytes) */
#define MAX_TEXTURE_MBYTES 1024

View file

@ -373,8 +373,7 @@ _mesa_init_current(struct gl_context *ctx)
/* redo special cases: */
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR], 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX], 1.0, 0.0, 0.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG], 1.0, 0.0, 0.0, 1.0 );
}
@ -406,7 +405,6 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH;
ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
ctx->Const.MaxClipPlanes = 6;
ctx->Const.MaxLights = MAX_LIGHTS;
ctx->Const.MaxShininess = 128.0;
@ -742,7 +740,6 @@ _mesa_free_context_data( struct gl_context *ctx )
_mesa_reference_framebuffer(&ctx->ReadBuffer, NULL);
_mesa_free_attrib_data(ctx);
_mesa_free_buffer_objects(ctx);
_mesa_free_lighting_data( ctx );
_mesa_free_eval_data( ctx );
_mesa_free_texture_data( ctx );
@ -750,8 +747,6 @@ _mesa_free_context_data( struct gl_context *ctx )
_mesa_free_viewport_data( ctx );
_mesa_free_varray_data(ctx, &ctx->Array);
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
/* free dispatch tables */
free(ctx->Exec);
free(ctx->Save);

View file

@ -1,173 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Image convolution functions.
*
* Notes: filter kernel elements are indexed by <n> and <m> as in
* the GL spec.
*/
#include <precomp.h>
#if FEATURE_convolve
static void GLAPIENTRY
_mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D");
}
static void GLAPIENTRY
_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D");
}
static void GLAPIENTRY
_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf");
}
static void GLAPIENTRY
_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv");
}
static void GLAPIENTRY
_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri");
}
static void GLAPIENTRY
_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv");
}
static void GLAPIENTRY
_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D");
}
static void GLAPIENTRY
_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D");
}
static void GLAPIENTRY
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
GLvoid *image)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter");
}
static void GLAPIENTRY
_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv");
}
static void GLAPIENTRY
_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv");
}
static void GLAPIENTRY
_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column,
GLvoid *span)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter");
}
static void GLAPIENTRY
_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D");
}
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 */

View file

@ -1,51 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef CONVOLVE_H
#define CONVOLVE_H
#include "compiler.h"
#include "mfeatures.h"
struct _glapi_table;
#if FEATURE_convolve
extern void
_mesa_init_convolve_dispatch(struct _glapi_table *disp);
#else /* FEATURE_convolve */
static inline void
_mesa_init_convolve_dispatch(struct _glapi_table *disp)
{
}
#endif /* FEATURE_convolve */
#endif /* CONVOLVE_H */

View file

@ -433,19 +433,6 @@ struct dd_function_table {
/*@{*/
/** Specify the alpha test function */
void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
/** Set the blend color */
void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
/** Set the blend equation */
void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
GLenum modeRGB, GLenum modeA);
/** Specify pixel arithmetic */
void (*BlendFuncSeparate)(struct gl_context *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
/** Specify clear values for the color buffers */
void (*ClearColor)(struct gl_context *ctx,
const union gl_color_union color);
@ -719,8 +706,6 @@ typedef struct {
void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
void (GLAPIENTRYP Normal3fv)( const GLfloat * );
void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
void (GLAPIENTRYP TexCoord1f)( GLfloat );
void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
@ -760,9 +745,6 @@ typedef struct {
void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices );
void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
GLuint end, GLsizei count,
GLenum type, const GLvoid *indices );
/*@}*/
/**

View file

@ -404,32 +404,6 @@ typedef PROC _glapi_proc;
#define _gloffset_PopClientAttrib 334
#define _gloffset_PushClientAttrib 335
#define _gloffset_BlendColor 336
#define _gloffset_BlendEquation 337
#define _gloffset_DrawRangeElements 338
#define _gloffset_ColorTable 339
#define _gloffset_ColorTableParameterfv 340
#define _gloffset_ColorTableParameteriv 341
#define _gloffset_CopyColorTable 342
#define _gloffset_GetColorTable 343
#define _gloffset_GetColorTableParameterfv 344
#define _gloffset_GetColorTableParameteriv 345
#define _gloffset_ColorSubTable 346
#define _gloffset_CopyColorSubTable 347
#define _gloffset_ConvolutionFilter1D 348
#define _gloffset_ConvolutionFilter2D 349
#define _gloffset_ConvolutionParameterf 350
#define _gloffset_ConvolutionParameterfv 351
#define _gloffset_ConvolutionParameteri 352
#define _gloffset_ConvolutionParameteriv 353
#define _gloffset_CopyConvolutionFilter1D 354
#define _gloffset_CopyConvolutionFilter2D 355
#define _gloffset_GetConvolutionFilter 356
#define _gloffset_GetConvolutionParameterfv 357
#define _gloffset_GetConvolutionParameteriv 358
#define _gloffset_GetSeparableFilter 359
#define _gloffset_SeparableFilter2D 360
#define _gloffset_GetStringi 435
#define _gloffset_GetBufferParameteri64v 438
#define _gloffset_GetInteger64i_v 439
#define _gloffset_LoadTransposeMatrixdARB 441
@ -478,30 +452,12 @@ typedef PROC _glapi_proc;
#define _gloffset_PointParameterfvEXT 707
#define _gloffset_LockArraysEXT 708
#define _gloffset_UnlockArraysEXT 709
#define _gloffset_SecondaryColor3bEXT 710
#define _gloffset_SecondaryColor3bvEXT 711
#define _gloffset_SecondaryColor3dEXT 712
#define _gloffset_SecondaryColor3dvEXT 713
#define _gloffset_SecondaryColor3fEXT 714
#define _gloffset_SecondaryColor3fvEXT 715
#define _gloffset_SecondaryColor3iEXT 716
#define _gloffset_SecondaryColor3ivEXT 717
#define _gloffset_SecondaryColor3sEXT 718
#define _gloffset_SecondaryColor3svEXT 719
#define _gloffset_SecondaryColor3ubEXT 720
#define _gloffset_SecondaryColor3ubvEXT 721
#define _gloffset_SecondaryColor3uiEXT 722
#define _gloffset_SecondaryColor3uivEXT 723
#define _gloffset_SecondaryColor3usEXT 724
#define _gloffset_SecondaryColor3usvEXT 725
#define _gloffset_SecondaryColorPointerEXT 726
#define _gloffset_FogCoordPointerEXT 729
#define _gloffset_FogCoorddEXT 730
#define _gloffset_FogCoorddvEXT 731
#define _gloffset_FogCoordfEXT 732
#define _gloffset_FogCoordfvEXT 733
#define _gloffset_PixelTexGenSGIX 734
#define _gloffset_BlendFuncSeparateEXT 735
#define _gloffset_FlushVertexArrayRangeNV 736
#define _gloffset_VertexArrayRangeNV 737
#define _gloffset_CombinerInputNV 738
@ -580,7 +536,6 @@ typedef PROC _glapi_proc;
#define _gloffset_PointParameterivNV 864
#define _gloffset_ActiveStencilFaceEXT 865
#define _gloffset_DepthBoundsEXT 878
#define _gloffset_BlendEquationSeparateEXT 879
#define _gloffset_BufferParameteriAPPLE 898
#define _gloffset_FlushMappedBufferRangeAPPLE 899
#define _gloffset_BindFragDataLocationEXT 900
@ -4290,292 +4245,6 @@ static inline void SET_PushClientAttrib(struct _glapi_table *disp, void (GLAPIEN
SET_by_offset(disp, _gloffset_PushClientAttrib, fn);
}
typedef void (GLAPIENTRYP _glptr_BlendColor)(GLclampf, GLclampf, GLclampf, GLclampf);
#define CALL_BlendColor(disp, parameters) \
(* GET_BlendColor(disp)) parameters
static inline _glptr_BlendColor GET_BlendColor(struct _glapi_table *disp) {
return (_glptr_BlendColor) (GET_by_offset(disp, _gloffset_BlendColor));
}
static inline void SET_BlendColor(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLclampf, GLclampf, GLclampf, GLclampf)) {
SET_by_offset(disp, _gloffset_BlendColor, fn);
}
typedef void (GLAPIENTRYP _glptr_BlendEquation)(GLenum);
#define CALL_BlendEquation(disp, parameters) \
(* GET_BlendEquation(disp)) parameters
static inline _glptr_BlendEquation GET_BlendEquation(struct _glapi_table *disp) {
return (_glptr_BlendEquation) (GET_by_offset(disp, _gloffset_BlendEquation));
}
static inline void SET_BlendEquation(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum)) {
SET_by_offset(disp, _gloffset_BlendEquation, fn);
}
typedef void (GLAPIENTRYP _glptr_DrawRangeElements)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
#define CALL_DrawRangeElements(disp, parameters) \
(* GET_DrawRangeElements(disp)) parameters
static inline _glptr_DrawRangeElements GET_DrawRangeElements(struct _glapi_table *disp) {
return (_glptr_DrawRangeElements) (GET_by_offset(disp, _gloffset_DrawRangeElements));
}
static inline void SET_DrawRangeElements(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *)) {
SET_by_offset(disp, _gloffset_DrawRangeElements, fn);
}
typedef void (GLAPIENTRYP _glptr_ColorTable)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
#define CALL_ColorTable(disp, parameters) \
(* GET_ColorTable(disp)) parameters
static inline _glptr_ColorTable GET_ColorTable(struct _glapi_table *disp) {
return (_glptr_ColorTable) (GET_by_offset(disp, _gloffset_ColorTable));
}
static inline void SET_ColorTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *)) {
SET_by_offset(disp, _gloffset_ColorTable, fn);
}
typedef void (GLAPIENTRYP _glptr_ColorTableParameterfv)(GLenum, GLenum, const GLfloat *);
#define CALL_ColorTableParameterfv(disp, parameters) \
(* GET_ColorTableParameterfv(disp)) parameters
static inline _glptr_ColorTableParameterfv GET_ColorTableParameterfv(struct _glapi_table *disp) {
return (_glptr_ColorTableParameterfv) (GET_by_offset(disp, _gloffset_ColorTableParameterfv));
}
static inline void SET_ColorTableParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLfloat *)) {
SET_by_offset(disp, _gloffset_ColorTableParameterfv, fn);
}
typedef void (GLAPIENTRYP _glptr_ColorTableParameteriv)(GLenum, GLenum, const GLint *);
#define CALL_ColorTableParameteriv(disp, parameters) \
(* GET_ColorTableParameteriv(disp)) parameters
static inline _glptr_ColorTableParameteriv GET_ColorTableParameteriv(struct _glapi_table *disp) {
return (_glptr_ColorTableParameteriv) (GET_by_offset(disp, _gloffset_ColorTableParameteriv));
}
static inline void SET_ColorTableParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLint *)) {
SET_by_offset(disp, _gloffset_ColorTableParameteriv, fn);
}
typedef void (GLAPIENTRYP _glptr_CopyColorTable)(GLenum, GLenum, GLint, GLint, GLsizei);
#define CALL_CopyColorTable(disp, parameters) \
(* GET_CopyColorTable(disp)) parameters
static inline _glptr_CopyColorTable GET_CopyColorTable(struct _glapi_table *disp) {
return (_glptr_CopyColorTable) (GET_by_offset(disp, _gloffset_CopyColorTable));
}
static inline void SET_CopyColorTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLint, GLsizei)) {
SET_by_offset(disp, _gloffset_CopyColorTable, fn);
}
typedef void (GLAPIENTRYP _glptr_GetColorTable)(GLenum, GLenum, GLenum, GLvoid *);
#define CALL_GetColorTable(disp, parameters) \
(* GET_GetColorTable(disp)) parameters
static inline _glptr_GetColorTable GET_GetColorTable(struct _glapi_table *disp) {
return (_glptr_GetColorTable) (GET_by_offset(disp, _gloffset_GetColorTable));
}
static inline void SET_GetColorTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLvoid *)) {
SET_by_offset(disp, _gloffset_GetColorTable, fn);
}
typedef void (GLAPIENTRYP _glptr_GetColorTableParameterfv)(GLenum, GLenum, GLfloat *);
#define CALL_GetColorTableParameterfv(disp, parameters) \
(* GET_GetColorTableParameterfv(disp)) parameters
static inline _glptr_GetColorTableParameterfv GET_GetColorTableParameterfv(struct _glapi_table *disp) {
return (_glptr_GetColorTableParameterfv) (GET_by_offset(disp, _gloffset_GetColorTableParameterfv));
}
static inline void SET_GetColorTableParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat *)) {
SET_by_offset(disp, _gloffset_GetColorTableParameterfv, fn);
}
typedef void (GLAPIENTRYP _glptr_GetColorTableParameteriv)(GLenum, GLenum, GLint *);
#define CALL_GetColorTableParameteriv(disp, parameters) \
(* GET_GetColorTableParameteriv(disp)) parameters
static inline _glptr_GetColorTableParameteriv GET_GetColorTableParameteriv(struct _glapi_table *disp) {
return (_glptr_GetColorTableParameteriv) (GET_by_offset(disp, _gloffset_GetColorTableParameteriv));
}
static inline void SET_GetColorTableParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint *)) {
SET_by_offset(disp, _gloffset_GetColorTableParameteriv, fn);
}
typedef void (GLAPIENTRYP _glptr_ColorSubTable)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
#define CALL_ColorSubTable(disp, parameters) \
(* GET_ColorSubTable(disp)) parameters
static inline _glptr_ColorSubTable GET_ColorSubTable(struct _glapi_table *disp) {
return (_glptr_ColorSubTable) (GET_by_offset(disp, _gloffset_ColorSubTable));
}
static inline void SET_ColorSubTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) {
SET_by_offset(disp, _gloffset_ColorSubTable, fn);
}
typedef void (GLAPIENTRYP _glptr_CopyColorSubTable)(GLenum, GLsizei, GLint, GLint, GLsizei);
#define CALL_CopyColorSubTable(disp, parameters) \
(* GET_CopyColorSubTable(disp)) parameters
static inline _glptr_CopyColorSubTable GET_CopyColorSubTable(struct _glapi_table *disp) {
return (_glptr_CopyColorSubTable) (GET_by_offset(disp, _gloffset_CopyColorSubTable));
}
static inline void SET_CopyColorSubTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLint, GLint, GLsizei)) {
SET_by_offset(disp, _gloffset_CopyColorSubTable, fn);
}
typedef void (GLAPIENTRYP _glptr_ConvolutionFilter1D)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
#define CALL_ConvolutionFilter1D(disp, parameters) \
(* GET_ConvolutionFilter1D(disp)) parameters
static inline _glptr_ConvolutionFilter1D GET_ConvolutionFilter1D(struct _glapi_table *disp) {
return (_glptr_ConvolutionFilter1D) (GET_by_offset(disp, _gloffset_ConvolutionFilter1D));
}
static inline void SET_ConvolutionFilter1D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *)) {
SET_by_offset(disp, _gloffset_ConvolutionFilter1D, fn);
}
typedef void (GLAPIENTRYP _glptr_ConvolutionFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
#define CALL_ConvolutionFilter2D(disp, parameters) \
(* GET_ConvolutionFilter2D(disp)) parameters
static inline _glptr_ConvolutionFilter2D GET_ConvolutionFilter2D(struct _glapi_table *disp) {
return (_glptr_ConvolutionFilter2D) (GET_by_offset(disp, _gloffset_ConvolutionFilter2D));
}
static inline void SET_ConvolutionFilter2D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) {
SET_by_offset(disp, _gloffset_ConvolutionFilter2D, fn);
}
typedef void (GLAPIENTRYP _glptr_ConvolutionParameterf)(GLenum, GLenum, GLfloat);
#define CALL_ConvolutionParameterf(disp, parameters) \
(* GET_ConvolutionParameterf(disp)) parameters
static inline _glptr_ConvolutionParameterf GET_ConvolutionParameterf(struct _glapi_table *disp) {
return (_glptr_ConvolutionParameterf) (GET_by_offset(disp, _gloffset_ConvolutionParameterf));
}
static inline void SET_ConvolutionParameterf(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat)) {
SET_by_offset(disp, _gloffset_ConvolutionParameterf, fn);
}
typedef void (GLAPIENTRYP _glptr_ConvolutionParameterfv)(GLenum, GLenum, const GLfloat *);
#define CALL_ConvolutionParameterfv(disp, parameters) \
(* GET_ConvolutionParameterfv(disp)) parameters
static inline _glptr_ConvolutionParameterfv GET_ConvolutionParameterfv(struct _glapi_table *disp) {
return (_glptr_ConvolutionParameterfv) (GET_by_offset(disp, _gloffset_ConvolutionParameterfv));
}
static inline void SET_ConvolutionParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLfloat *)) {
SET_by_offset(disp, _gloffset_ConvolutionParameterfv, fn);
}
typedef void (GLAPIENTRYP _glptr_ConvolutionParameteri)(GLenum, GLenum, GLint);
#define CALL_ConvolutionParameteri(disp, parameters) \
(* GET_ConvolutionParameteri(disp)) parameters
static inline _glptr_ConvolutionParameteri GET_ConvolutionParameteri(struct _glapi_table *disp) {
return (_glptr_ConvolutionParameteri) (GET_by_offset(disp, _gloffset_ConvolutionParameteri));
}
static inline void SET_ConvolutionParameteri(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint)) {
SET_by_offset(disp, _gloffset_ConvolutionParameteri, fn);
}
typedef void (GLAPIENTRYP _glptr_ConvolutionParameteriv)(GLenum, GLenum, const GLint *);
#define CALL_ConvolutionParameteriv(disp, parameters) \
(* GET_ConvolutionParameteriv(disp)) parameters
static inline _glptr_ConvolutionParameteriv GET_ConvolutionParameteriv(struct _glapi_table *disp) {
return (_glptr_ConvolutionParameteriv) (GET_by_offset(disp, _gloffset_ConvolutionParameteriv));
}
static inline void SET_ConvolutionParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLint *)) {
SET_by_offset(disp, _gloffset_ConvolutionParameteriv, fn);
}
typedef void (GLAPIENTRYP _glptr_CopyConvolutionFilter1D)(GLenum, GLenum, GLint, GLint, GLsizei);
#define CALL_CopyConvolutionFilter1D(disp, parameters) \
(* GET_CopyConvolutionFilter1D(disp)) parameters
static inline _glptr_CopyConvolutionFilter1D GET_CopyConvolutionFilter1D(struct _glapi_table *disp) {
return (_glptr_CopyConvolutionFilter1D) (GET_by_offset(disp, _gloffset_CopyConvolutionFilter1D));
}
static inline void SET_CopyConvolutionFilter1D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLint, GLsizei)) {
SET_by_offset(disp, _gloffset_CopyConvolutionFilter1D, fn);
}
typedef void (GLAPIENTRYP _glptr_CopyConvolutionFilter2D)(GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
#define CALL_CopyConvolutionFilter2D(disp, parameters) \
(* GET_CopyConvolutionFilter2D(disp)) parameters
static inline _glptr_CopyConvolutionFilter2D GET_CopyConvolutionFilter2D(struct _glapi_table *disp) {
return (_glptr_CopyConvolutionFilter2D) (GET_by_offset(disp, _gloffset_CopyConvolutionFilter2D));
}
static inline void SET_CopyConvolutionFilter2D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLint, GLsizei, GLsizei)) {
SET_by_offset(disp, _gloffset_CopyConvolutionFilter2D, fn);
}
typedef void (GLAPIENTRYP _glptr_GetConvolutionFilter)(GLenum, GLenum, GLenum, GLvoid *);
#define CALL_GetConvolutionFilter(disp, parameters) \
(* GET_GetConvolutionFilter(disp)) parameters
static inline _glptr_GetConvolutionFilter GET_GetConvolutionFilter(struct _glapi_table *disp) {
return (_glptr_GetConvolutionFilter) (GET_by_offset(disp, _gloffset_GetConvolutionFilter));
}
static inline void SET_GetConvolutionFilter(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLvoid *)) {
SET_by_offset(disp, _gloffset_GetConvolutionFilter, fn);
}
typedef void (GLAPIENTRYP _glptr_GetConvolutionParameterfv)(GLenum, GLenum, GLfloat *);
#define CALL_GetConvolutionParameterfv(disp, parameters) \
(* GET_GetConvolutionParameterfv(disp)) parameters
static inline _glptr_GetConvolutionParameterfv GET_GetConvolutionParameterfv(struct _glapi_table *disp) {
return (_glptr_GetConvolutionParameterfv) (GET_by_offset(disp, _gloffset_GetConvolutionParameterfv));
}
static inline void SET_GetConvolutionParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat *)) {
SET_by_offset(disp, _gloffset_GetConvolutionParameterfv, fn);
}
typedef void (GLAPIENTRYP _glptr_GetConvolutionParameteriv)(GLenum, GLenum, GLint *);
#define CALL_GetConvolutionParameteriv(disp, parameters) \
(* GET_GetConvolutionParameteriv(disp)) parameters
static inline _glptr_GetConvolutionParameteriv GET_GetConvolutionParameteriv(struct _glapi_table *disp) {
return (_glptr_GetConvolutionParameteriv) (GET_by_offset(disp, _gloffset_GetConvolutionParameteriv));
}
static inline void SET_GetConvolutionParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint *)) {
SET_by_offset(disp, _gloffset_GetConvolutionParameteriv, fn);
}
typedef void (GLAPIENTRYP _glptr_GetSeparableFilter)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
#define CALL_GetSeparableFilter(disp, parameters) \
(* GET_GetSeparableFilter(disp)) parameters
static inline _glptr_GetSeparableFilter GET_GetSeparableFilter(struct _glapi_table *disp) {
return (_glptr_GetSeparableFilter) (GET_by_offset(disp, _gloffset_GetSeparableFilter));
}
static inline void SET_GetSeparableFilter(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *)) {
SET_by_offset(disp, _gloffset_GetSeparableFilter, fn);
}
typedef void (GLAPIENTRYP _glptr_SeparableFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
#define CALL_SeparableFilter2D(disp, parameters) \
(* GET_SeparableFilter2D(disp)) parameters
static inline _glptr_SeparableFilter2D GET_SeparableFilter2D(struct _glapi_table *disp) {
return (_glptr_SeparableFilter2D) (GET_by_offset(disp, _gloffset_SeparableFilter2D));
}
static inline void SET_SeparableFilter2D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *)) {
SET_by_offset(disp, _gloffset_SeparableFilter2D, fn);
}
typedef const GLubyte * (GLAPIENTRYP _glptr_GetStringi)(GLenum, GLuint);
#define CALL_GetStringi(disp, parameters) \
(* GET_GetStringi(disp)) parameters
static inline _glptr_GetStringi GET_GetStringi(struct _glapi_table *disp) {
return (_glptr_GetStringi) (GET_by_offset(disp, _gloffset_GetStringi));
}
static inline void SET_GetStringi(struct _glapi_table *disp, const GLubyte * (GLAPIENTRYP fn)(GLenum, GLuint)) {
SET_by_offset(disp, _gloffset_GetStringi, fn);
}
typedef void (GLAPIENTRYP _glptr_GetBufferParameteri64v)(GLenum, GLenum, GLint64 *);
#define CALL_GetBufferParameteri64v(disp, parameters) \
(* GET_GetBufferParameteri64v(disp)) parameters
@ -5104,193 +4773,6 @@ static inline void SET_UnlockArraysEXT(struct _glapi_table *disp, void (GLAPIENT
SET_by_offset(disp, _gloffset_UnlockArraysEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3bEXT)(GLbyte, GLbyte, GLbyte);
#define CALL_SecondaryColor3bEXT(disp, parameters) \
(* GET_SecondaryColor3bEXT(disp)) parameters
static inline _glptr_SecondaryColor3bEXT GET_SecondaryColor3bEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3bEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3bEXT));
}
static inline void SET_SecondaryColor3bEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLbyte, GLbyte, GLbyte)) {
SET_by_offset(disp, _gloffset_SecondaryColor3bEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3bvEXT)(const GLbyte *);
#define CALL_SecondaryColor3bvEXT(disp, parameters) \
(* GET_SecondaryColor3bvEXT(disp)) parameters
static inline _glptr_SecondaryColor3bvEXT GET_SecondaryColor3bvEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3bvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3bvEXT));
}
static inline void SET_SecondaryColor3bvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLbyte *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3bvEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3dEXT)(GLdouble, GLdouble, GLdouble);
#define CALL_SecondaryColor3dEXT(disp, parameters) \
(* GET_SecondaryColor3dEXT(disp)) parameters
static inline _glptr_SecondaryColor3dEXT GET_SecondaryColor3dEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3dEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3dEXT));
}
static inline void SET_SecondaryColor3dEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLdouble, GLdouble, GLdouble)) {
SET_by_offset(disp, _gloffset_SecondaryColor3dEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3dvEXT)(const GLdouble *);
#define CALL_SecondaryColor3dvEXT(disp, parameters) \
(* GET_SecondaryColor3dvEXT(disp)) parameters
static inline _glptr_SecondaryColor3dvEXT GET_SecondaryColor3dvEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3dvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3dvEXT));
}
static inline void SET_SecondaryColor3dvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLdouble *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3dvEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3fEXT)(GLfloat, GLfloat, GLfloat);
#define CALL_SecondaryColor3fEXT(disp, parameters) \
(* GET_SecondaryColor3fEXT(disp)) parameters
static inline _glptr_SecondaryColor3fEXT GET_SecondaryColor3fEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3fEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3fEXT));
}
static inline void SET_SecondaryColor3fEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLfloat, GLfloat, GLfloat)) {
SET_by_offset(disp, _gloffset_SecondaryColor3fEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3fvEXT)(const GLfloat *);
#define CALL_SecondaryColor3fvEXT(disp, parameters) \
(* GET_SecondaryColor3fvEXT(disp)) parameters
static inline _glptr_SecondaryColor3fvEXT GET_SecondaryColor3fvEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3fvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3fvEXT));
}
static inline void SET_SecondaryColor3fvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLfloat *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3fvEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3iEXT)(GLint, GLint, GLint);
#define CALL_SecondaryColor3iEXT(disp, parameters) \
(* GET_SecondaryColor3iEXT(disp)) parameters
static inline _glptr_SecondaryColor3iEXT GET_SecondaryColor3iEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3iEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3iEXT));
}
static inline void SET_SecondaryColor3iEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLint, GLint, GLint)) {
SET_by_offset(disp, _gloffset_SecondaryColor3iEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3ivEXT)(const GLint *);
#define CALL_SecondaryColor3ivEXT(disp, parameters) \
(* GET_SecondaryColor3ivEXT(disp)) parameters
static inline _glptr_SecondaryColor3ivEXT GET_SecondaryColor3ivEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3ivEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3ivEXT));
}
static inline void SET_SecondaryColor3ivEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLint *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3ivEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3sEXT)(GLshort, GLshort, GLshort);
#define CALL_SecondaryColor3sEXT(disp, parameters) \
(* GET_SecondaryColor3sEXT(disp)) parameters
static inline _glptr_SecondaryColor3sEXT GET_SecondaryColor3sEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3sEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3sEXT));
}
static inline void SET_SecondaryColor3sEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLshort, GLshort, GLshort)) {
SET_by_offset(disp, _gloffset_SecondaryColor3sEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3svEXT)(const GLshort *);
#define CALL_SecondaryColor3svEXT(disp, parameters) \
(* GET_SecondaryColor3svEXT(disp)) parameters
static inline _glptr_SecondaryColor3svEXT GET_SecondaryColor3svEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3svEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3svEXT));
}
static inline void SET_SecondaryColor3svEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLshort *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3svEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3ubEXT)(GLubyte, GLubyte, GLubyte);
#define CALL_SecondaryColor3ubEXT(disp, parameters) \
(* GET_SecondaryColor3ubEXT(disp)) parameters
static inline _glptr_SecondaryColor3ubEXT GET_SecondaryColor3ubEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3ubEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3ubEXT));
}
static inline void SET_SecondaryColor3ubEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLubyte, GLubyte, GLubyte)) {
SET_by_offset(disp, _gloffset_SecondaryColor3ubEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3ubvEXT)(const GLubyte *);
#define CALL_SecondaryColor3ubvEXT(disp, parameters) \
(* GET_SecondaryColor3ubvEXT(disp)) parameters
static inline _glptr_SecondaryColor3ubvEXT GET_SecondaryColor3ubvEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3ubvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3ubvEXT));
}
static inline void SET_SecondaryColor3ubvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLubyte *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3ubvEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3uiEXT)(GLuint, GLuint, GLuint);
#define CALL_SecondaryColor3uiEXT(disp, parameters) \
(* GET_SecondaryColor3uiEXT(disp)) parameters
static inline _glptr_SecondaryColor3uiEXT GET_SecondaryColor3uiEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3uiEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3uiEXT));
}
static inline void SET_SecondaryColor3uiEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint, GLuint)) {
SET_by_offset(disp, _gloffset_SecondaryColor3uiEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3uivEXT)(const GLuint *);
#define CALL_SecondaryColor3uivEXT(disp, parameters) \
(* GET_SecondaryColor3uivEXT(disp)) parameters
static inline _glptr_SecondaryColor3uivEXT GET_SecondaryColor3uivEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3uivEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3uivEXT));
}
static inline void SET_SecondaryColor3uivEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLuint *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3uivEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3usEXT)(GLushort, GLushort, GLushort);
#define CALL_SecondaryColor3usEXT(disp, parameters) \
(* GET_SecondaryColor3usEXT(disp)) parameters
static inline _glptr_SecondaryColor3usEXT GET_SecondaryColor3usEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3usEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3usEXT));
}
static inline void SET_SecondaryColor3usEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLushort, GLushort, GLushort)) {
SET_by_offset(disp, _gloffset_SecondaryColor3usEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColor3usvEXT)(const GLushort *);
#define CALL_SecondaryColor3usvEXT(disp, parameters) \
(* GET_SecondaryColor3usvEXT(disp)) parameters
static inline _glptr_SecondaryColor3usvEXT GET_SecondaryColor3usvEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColor3usvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3usvEXT));
}
static inline void SET_SecondaryColor3usvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLushort *)) {
SET_by_offset(disp, _gloffset_SecondaryColor3usvEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_SecondaryColorPointerEXT)(GLint, GLenum, GLsizei, const GLvoid *);
#define CALL_SecondaryColorPointerEXT(disp, parameters) \
(* GET_SecondaryColorPointerEXT(disp)) parameters
static inline _glptr_SecondaryColorPointerEXT GET_SecondaryColorPointerEXT(struct _glapi_table *disp) {
return (_glptr_SecondaryColorPointerEXT) (GET_by_offset(disp, _gloffset_SecondaryColorPointerEXT));
}
static inline void SET_SecondaryColorPointerEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLint, GLenum, GLsizei, const GLvoid *)) {
SET_by_offset(disp, _gloffset_SecondaryColorPointerEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_FogCoordPointerEXT)(GLenum, GLsizei, const GLvoid *);
#define CALL_FogCoordPointerEXT(disp, parameters) \
(* GET_FogCoordPointerEXT(disp)) parameters
@ -5357,17 +4839,6 @@ static inline void SET_PixelTexGenSGIX(struct _glapi_table *disp, void (GLAPIENT
SET_by_offset(disp, _gloffset_PixelTexGenSGIX, fn);
}
typedef void (GLAPIENTRYP _glptr_BlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum);
#define CALL_BlendFuncSeparateEXT(disp, parameters) \
(* GET_BlendFuncSeparateEXT(disp)) parameters
static inline _glptr_BlendFuncSeparateEXT GET_BlendFuncSeparateEXT(struct _glapi_table *disp) {
return (_glptr_BlendFuncSeparateEXT) (GET_by_offset(disp, _gloffset_BlendFuncSeparateEXT));
}
static inline void SET_BlendFuncSeparateEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLenum)) {
SET_by_offset(disp, _gloffset_BlendFuncSeparateEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_FlushVertexArrayRangeNV)(void);
#define CALL_FlushVertexArrayRangeNV(disp, parameters) \
(* GET_FlushVertexArrayRangeNV(disp)) parameters
@ -6226,17 +5697,6 @@ static inline void SET_DepthBoundsEXT(struct _glapi_table *disp, void (GLAPIENTR
SET_by_offset(disp, _gloffset_DepthBoundsEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_BlendEquationSeparateEXT)(GLenum, GLenum);
#define CALL_BlendEquationSeparateEXT(disp, parameters) \
(* GET_BlendEquationSeparateEXT(disp)) parameters
static inline _glptr_BlendEquationSeparateEXT GET_BlendEquationSeparateEXT(struct _glapi_table *disp) {
return (_glptr_BlendEquationSeparateEXT) (GET_by_offset(disp, _gloffset_BlendEquationSeparateEXT));
}
static inline void SET_BlendEquationSeparateEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum)) {
SET_by_offset(disp, _gloffset_BlendEquationSeparateEXT, fn);
}
typedef void (GLAPIENTRYP _glptr_BufferParameteriAPPLE)(GLenum, GLenum, GLint);
#define CALL_BufferParameteriAPPLE(disp, parameters) \
(* GET_BufferParameteriAPPLE(disp)) parameters

View file

@ -146,10 +146,7 @@ typedef enum
OPCODE_ALPHA_FUNC,
OPCODE_BIND_TEXTURE,
OPCODE_BITMAP,
OPCODE_BLEND_COLOR,
OPCODE_BLEND_EQUATION,
OPCODE_BLEND_EQUATION_SEPARATE,
OPCODE_BLEND_FUNC_SEPARATE,
OPCODE_BLEND_FUNC,
OPCODE_CALL_LIST,
OPCODE_CALL_LIST_OFFSET,
@ -162,18 +159,6 @@ typedef enum
OPCODE_CLIP_PLANE,
OPCODE_COLOR_MASK,
OPCODE_COLOR_MATERIAL,
OPCODE_COLOR_TABLE,
OPCODE_COLOR_TABLE_PARAMETER_FV,
OPCODE_COLOR_TABLE_PARAMETER_IV,
OPCODE_COLOR_SUB_TABLE,
OPCODE_CONVOLUTION_FILTER_1D,
OPCODE_CONVOLUTION_FILTER_2D,
OPCODE_CONVOLUTION_PARAMETER_I,
OPCODE_CONVOLUTION_PARAMETER_IV,
OPCODE_CONVOLUTION_PARAMETER_F,
OPCODE_CONVOLUTION_PARAMETER_FV,
OPCODE_COPY_COLOR_SUB_TABLE,
OPCODE_COPY_COLOR_TABLE,
OPCODE_COPY_PIXELS,
OPCODE_COPY_TEX_IMAGE1D,
OPCODE_COPY_TEX_IMAGE2D,
@ -464,22 +449,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_TABLE:
free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_SUB_TABLE:
free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONVOLUTION_FILTER_1D:
free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONVOLUTION_FILTER_2D:
free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_POLYGON_STIPPLE:
free(n[1].data);
n += InstSize[n[0].opcode];
@ -836,85 +805,23 @@ save_Bitmap(GLsizei width, GLsizei height,
}
static void GLAPIENTRY
save_BlendEquation(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
CALL_BlendEquation(ctx->Exec, (mode));
}
}
static void GLAPIENTRY
save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
if (n) {
n[1].e = modeRGB;
n[2].e = modeA;
}
if (ctx->ExecuteFlag) {
CALL_BlendEquationSeparateEXT(ctx->Exec, (modeRGB, modeA));
}
}
static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
if (n) {
n[1].e = sfactorRGB;
n[2].e = dfactorRGB;
n[3].e = sfactorA;
n[4].e = dfactorA;
}
if (ctx->ExecuteFlag) {
CALL_BlendFuncSeparateEXT(ctx->Exec,
(sfactorRGB, dfactorRGB, sfactorA, dfactorA));
}
}
static void GLAPIENTRY
save_BlendFunc(GLenum srcfactor, GLenum dstfactor)
{
save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor);
}
static void GLAPIENTRY
save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4);
n = alloc_instruction(ctx, OPCODE_BLEND_FUNC, 2);
if (n) {
n[1].f = red;
n[2].f = green;
n[3].f = blue;
n[4].f = alpha;
n[1].e = srcfactor;
n[2].e = dstfactor;
}
if (ctx->ExecuteFlag) {
CALL_BlendColor(ctx->Exec, (red, green, blue, alpha));
CALL_BlendFunc(ctx->Exec, (srcfactor, dstfactor));
}
}
static void invalidate_saved_current_state( struct gl_context *ctx )
{
GLint i;
@ -1160,313 +1067,6 @@ save_ColorMaterial(GLenum face, GLenum mode)
}
static void GLAPIENTRY
save_ColorTable(GLenum target, GLenum internalFormat,
GLsizei width, GLenum format, GLenum type,
const GLvoid * table)
{
GET_CURRENT_CONTEXT(ctx);
if (_mesa_is_proxy_texture(target)) {
/* execute immediately */
CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
format, type, table));
}
else {
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
n[3].i = width;
n[4].e = format;
n[5].e = type;
n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, table,
&ctx->Unpack);
}
if (ctx->ExecuteFlag) {
CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
format, type, table));
}
}
}
static void GLAPIENTRY
save_ColorTableParameterfv(GLenum target, GLenum pname,
const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].f = params[0];
if (pname == GL_COLOR_TABLE_SGI ||
pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
pname == GL_TEXTURE_COLOR_TABLE_SGI) {
n[4].f = params[1];
n[5].f = params[2];
n[6].f = params[3];
}
}
if (ctx->ExecuteFlag) {
CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params));
}
}
static void GLAPIENTRY
save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].i = params[0];
if (pname == GL_COLOR_TABLE_SGI ||
pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
pname == GL_TEXTURE_COLOR_TABLE_SGI) {
n[4].i = params[1];
n[5].i = params[2];
n[6].i = params[3];
}
}
if (ctx->ExecuteFlag) {
CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params));
}
}
static void GLAPIENTRY
save_ColorSubTable(GLenum target, GLsizei start, GLsizei count,
GLenum format, GLenum type, const GLvoid * table)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6);
if (n) {
n[1].e = target;
n[2].i = start;
n[3].i = count;
n[4].e = format;
n[5].e = type;
n[6].data = unpack_image(ctx, 1, count, 1, 1, format, type, table,
&ctx->Unpack);
}
if (ctx->ExecuteFlag) {
CALL_ColorSubTable(ctx->Exec,
(target, start, count, format, type, table));
}
}
static void GLAPIENTRY
save_CopyColorSubTable(GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5);
if (n) {
n[1].e = target;
n[2].i = start;
n[3].i = x;
n[4].i = y;
n[5].i = width;
}
if (ctx->ExecuteFlag) {
CALL_CopyColorSubTable(ctx->Exec, (target, start, x, y, width));
}
}
static void GLAPIENTRY
save_CopyColorTable(GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5);
if (n) {
n[1].e = target;
n[2].e = internalformat;
n[3].i = x;
n[4].i = y;
n[5].i = width;
}
if (ctx->ExecuteFlag) {
CALL_CopyColorTable(ctx->Exec, (target, internalformat, x, y, width));
}
}
static void GLAPIENTRY
save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
GLenum format, GLenum type, const GLvoid * filter)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
n[3].i = width;
n[4].e = format;
n[5].e = type;
n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, filter,
&ctx->Unpack);
}
if (ctx->ExecuteFlag) {
CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width,
format, type, filter));
}
}
static void GLAPIENTRY
save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height, GLenum format,
GLenum type, const GLvoid * filter)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
n[3].i = width;
n[4].i = height;
n[5].e = format;
n[6].e = type;
n[7].data = unpack_image(ctx, 2, width, height, 1, format, type, filter,
&ctx->Unpack);
}
if (ctx->ExecuteFlag) {
CALL_ConvolutionFilter2D(ctx->Exec,
(target, internalFormat, width, height, format,
type, filter));
}
}
static void GLAPIENTRY
save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].i = param;
}
if (ctx->ExecuteFlag) {
CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param));
}
}
static void GLAPIENTRY
save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].i = params[0];
if (pname == GL_CONVOLUTION_BORDER_COLOR ||
pname == GL_CONVOLUTION_FILTER_SCALE ||
pname == GL_CONVOLUTION_FILTER_BIAS) {
n[4].i = params[1];
n[5].i = params[2];
n[6].i = params[3];
}
else {
n[4].i = n[5].i = n[6].i = 0;
}
}
if (ctx->ExecuteFlag) {
CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params));
}
}
static void GLAPIENTRY
save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].f = param;
}
if (ctx->ExecuteFlag) {
CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param));
}
}
static void GLAPIENTRY
save_ConvolutionParameterfv(GLenum target, GLenum pname,
const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].f = params[0];
if (pname == GL_CONVOLUTION_BORDER_COLOR ||
pname == GL_CONVOLUTION_FILTER_SCALE ||
pname == GL_CONVOLUTION_FILTER_BIAS) {
n[4].f = params[1];
n[5].f = params[2];
n[6].f = params[3];
}
else {
n[4].f = n[5].f = n[6].f = 0.0F;
}
}
if (ctx->ExecuteFlag) {
CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params));
}
}
static void GLAPIENTRY
save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
{
@ -4191,37 +3791,25 @@ save_FogCoordfvEXT(const GLfloat * v)
static void GLAPIENTRY
save_Color3f(GLfloat x, GLfloat y, GLfloat z)
{
save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z);
save_Attr3fNV(VERT_ATTRIB_COLOR, x, y, z);
}
static void GLAPIENTRY
save_Color3fv(const GLfloat * v)
{
save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]);
save_Attr3fNV(VERT_ATTRIB_COLOR, v[0], v[1], v[2]);
}
static void GLAPIENTRY
save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w);
save_Attr4fNV(VERT_ATTRIB_COLOR, x, y, z, w);
}
static void GLAPIENTRY
save_Color4fv(const GLfloat * v)
{
save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]);
}
static void GLAPIENTRY
save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z)
{
save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z);
}
static void GLAPIENTRY
save_SecondaryColor3fvEXT(const GLfloat * v)
{
save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]);
save_Attr4fNV(VERT_ATTRIB_COLOR, v[0], v[1], v[2], v[3]);
}
@ -4528,20 +4116,9 @@ execute_list(struct gl_context *ctx, GLuint list)
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_BLEND_COLOR:
CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
case OPCODE_BLEND_FUNC:
CALL_BlendFunc(ctx->Exec, (n[1].e, n[2].e));
break;
case OPCODE_BLEND_EQUATION:
CALL_BlendEquation(ctx->Exec, (n[1].e));
break;
case OPCODE_BLEND_EQUATION_SEPARATE:
CALL_BlendEquationSeparateEXT(ctx->Exec, (n[1].e, n[2].e));
break;
case OPCODE_BLEND_FUNC_SEPARATE:
CALL_BlendFuncSeparateEXT(ctx->Exec,
(n[1].e, n[2].e, n[3].e, n[4].e));
break;
case OPCODE_CALL_LIST:
/* Generated by glCallList(), don't add ListBase */
if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
@ -4593,102 +4170,6 @@ execute_list(struct gl_context *ctx, GLuint list)
case OPCODE_COLOR_MATERIAL:
CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e));
break;
case OPCODE_COLOR_TABLE:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
CALL_ColorTable(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].e,
n[5].e, n[6].data));
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
{
GLfloat params[4];
params[0] = n[3].f;
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
CALL_ColorTableParameterfv(ctx->Exec,
(n[1].e, n[2].e, params));
}
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
{
GLint params[4];
params[0] = n[3].i;
params[1] = n[4].i;
params[2] = n[5].i;
params[3] = n[6].i;
CALL_ColorTableParameteriv(ctx->Exec,
(n[1].e, n[2].e, params));
}
break;
case OPCODE_COLOR_SUB_TABLE:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
CALL_ColorSubTable(ctx->Exec, (n[1].e, n[2].i, n[3].i,
n[4].e, n[5].e, n[6].data));
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_CONVOLUTION_FILTER_1D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
CALL_ConvolutionFilter1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
n[4].e, n[5].e,
n[6].data));
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_CONVOLUTION_FILTER_2D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
CALL_ConvolutionFilter2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
n[4].i, n[5].e, n[6].e,
n[7].data));
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_CONVOLUTION_PARAMETER_I:
CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i));
break;
case OPCODE_CONVOLUTION_PARAMETER_IV:
{
GLint params[4];
params[0] = n[3].i;
params[1] = n[4].i;
params[2] = n[5].i;
params[3] = n[6].i;
CALL_ConvolutionParameteriv(ctx->Exec,
(n[1].e, n[2].e, params));
}
break;
case OPCODE_CONVOLUTION_PARAMETER_F:
CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f));
break;
case OPCODE_CONVOLUTION_PARAMETER_FV:
{
GLfloat params[4];
params[0] = n[3].f;
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
CALL_ConvolutionParameterfv(ctx->Exec,
(n[1].e, n[2].e, params));
}
break;
case OPCODE_COPY_COLOR_SUB_TABLE:
CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
n[3].i, n[4].i, n[5].i));
break;
case OPCODE_COPY_COLOR_TABLE:
CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
n[3].i, n[4].i, n[5].i));
break;
case OPCODE_COPY_PIXELS:
CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i,
(GLsizei) n[3].i, (GLsizei) n[4].i,
@ -5902,98 +5383,6 @@ exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
CALL_VertexPointer(ctx->Exec, (size, type, stride, ptr));
}
static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_CopyConvolutionFilter1D(ctx->Exec,
(target, internalFormat, x, y, width));
}
static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
GLint x, GLint y, GLsizei width, GLsizei height)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_CopyConvolutionFilter2D(ctx->Exec,
(target, internalFormat, x, y, width,
height));
}
static void GLAPIENTRY
exec_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * data)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetColorTable(ctx->Exec, (target, format, type, data));
}
static void GLAPIENTRY
exec_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetColorTableParameterfv(ctx->Exec, (target, pname, params));
}
static void GLAPIENTRY
exec_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetColorTableParameteriv(ctx->Exec, (target, pname, params));
}
static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
GLvoid * image)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetConvolutionFilter(ctx->Exec, (target, format, type, image));
}
static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetConvolutionParameterfv(ctx->Exec, (target, pname, params));
}
static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetConvolutionParameteriv(ctx->Exec, (target, pname, params));
}
static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column, GLvoid *span)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_GetSeparableFilter(ctx->Exec,
(target, format, type, row, column, span));
}
static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height, GLenum format,
GLenum type, const GLvoid *row, const GLvoid *column)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_SeparableFilter2D(ctx->Exec,
(target, internalFormat, width, height, format,
type, row, column));
}
static void GLAPIENTRY
exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
GLsizei count, const GLvoid *ptr)
@ -6063,15 +5452,6 @@ exec_UnlockArraysEXT(void)
CALL_UnlockArraysEXT(ctx->Exec, ());
}
static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_SecondaryColorPointerEXT(ctx->Exec, (size, type, stride, ptr));
}
static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
{
@ -6329,50 +5709,9 @@ _mesa_create_save_table(void)
SET_TexSubImage2D(table, save_TexSubImage2D);
SET_VertexPointer(table, exec_VertexPointer);
/* GL_ARB_imaging */
/* Not all are supported */
SET_BlendColor(table, save_BlendColor);
SET_BlendEquation(table, save_BlendEquation);
SET_ColorSubTable(table, save_ColorSubTable);
SET_ColorTable(table, save_ColorTable);
SET_ColorTableParameterfv(table, save_ColorTableParameterfv);
SET_ColorTableParameteriv(table, save_ColorTableParameteriv);
SET_ConvolutionFilter1D(table, save_ConvolutionFilter1D);
SET_ConvolutionFilter2D(table, save_ConvolutionFilter2D);
SET_ConvolutionParameterf(table, save_ConvolutionParameterf);
SET_ConvolutionParameterfv(table, save_ConvolutionParameterfv);
SET_ConvolutionParameteri(table, save_ConvolutionParameteri);
SET_ConvolutionParameteriv(table, save_ConvolutionParameteriv);
SET_CopyColorSubTable(table, save_CopyColorSubTable);
SET_CopyColorTable(table, save_CopyColorTable);
SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D);
SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D);
SET_GetColorTable(table, exec_GetColorTable);
SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv);
SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv);
SET_GetConvolutionFilter(table, exec_GetConvolutionFilter);
SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv);
SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv);
SET_GetSeparableFilter(table, exec_GetSeparableFilter);
SET_SeparableFilter2D(table, exec_SeparableFilter2D);
/* 2. GL_EXT_blend_color */
#if 0
SET_BlendColorEXT(table, save_BlendColorEXT);
#endif
/* 3. GL_EXT_polygon_offset */
SET_PolygonOffsetEXT(table, save_PolygonOffsetEXT);
/* 14. GL_SGI_color_table */
#if 0
SET_ColorTableSGI(table, save_ColorTable);
SET_ColorSubTableSGI(table, save_ColorSubTable);
SET_GetColorTableSGI(table, exec_GetColorTable);
SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv);
SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv);
#endif
/* 30. GL_EXT_vertex_array */
SET_ColorPointerEXT(table, exec_ColorPointerEXT);
SET_EdgeFlagPointerEXT(table, exec_EdgeFlagPointerEXT);
@ -6381,11 +5720,6 @@ _mesa_create_save_table(void)
SET_TexCoordPointerEXT(table, exec_TexCoordPointerEXT);
SET_VertexPointerEXT(table, exec_VertexPointerEXT);
/* 37. GL_EXT_blend_minmax */
#if 0
SET_BlendEquationEXT(table, save_BlendEquationEXT);
#endif
/* 54. GL_EXT_point_parameters */
SET_PointParameterfEXT(table, save_PointParameterfEXT);
SET_PointParameterfvEXT(table, save_PointParameterfvEXT);
@ -6394,15 +5728,9 @@ _mesa_create_save_table(void)
SET_LockArraysEXT(table, exec_LockArraysEXT);
SET_UnlockArraysEXT(table, exec_UnlockArraysEXT);
/* 145. GL_EXT_secondary_color */
SET_SecondaryColorPointerEXT(table, exec_SecondaryColorPointerEXT);
/* 149. GL_EXT_fog_coord */
SET_FogCoordPointerEXT(table, exec_FogCoordPointerEXT);
/* 173. GL_EXT_blend_func_separate */
SET_BlendFuncSeparateEXT(table, save_BlendFuncSeparateEXT);
/* 197. GL_MESA_window_pos */
SET_WindowPos2dMESA(table, save_WindowPos2dMESA);
SET_WindowPos2dvMESA(table, save_WindowPos2dvMESA);
@ -6463,9 +5791,6 @@ _mesa_create_save_table(void)
SET_MapBufferARB(table, _mesa_MapBufferARB);
SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
/* 299. GL_EXT_blend_equation_separate */
SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
/* ARB 50. GL_ARB_map_buffer_range */
#if FEATURE_ARB_map_buffer_range
SET_MapBufferRange(table, _mesa_MapBufferRange); /* no dlist save */
@ -6547,16 +5872,6 @@ print_list(struct gl_context *ctx, GLuint list)
printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
ctx->List.ListBase, ctx->List.ListBase + n[1].ui);
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
printf("ColorTableParameterfv %s %s %f %f %f %f\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
printf("ColorTableParameteriv %s %s %d %d %d %d\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].i, n[4].i, n[5].i, n[6].i);
break;
case OPCODE_DISABLE:
printf("Disable %s\n", enum_string(n[1].e));
break;
@ -6786,8 +6101,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
vfmt->Materialfv = save_Materialfv;
vfmt->Normal3f = save_Normal3f;
vfmt->Normal3fv = save_Normal3fv;
vfmt->SecondaryColor3fEXT = save_SecondaryColor3fEXT;
vfmt->SecondaryColor3fvEXT = save_SecondaryColor3fvEXT;
vfmt->TexCoord1f = save_TexCoord1f;
vfmt->TexCoord1fv = save_TexCoord1fv;
vfmt->TexCoord2f = save_TexCoord2f;
@ -6822,7 +6135,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
#if 0
vfmt->DrawArrays = 0;
vfmt->DrawElements = 0;
vfmt->DrawRangeElements = 0;
#endif
}

View file

@ -54,8 +54,8 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
flag = VERT_BIT_NORMAL;
break;
case GL_COLOR_ARRAY:
var = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
flag = VERT_BIT_COLOR0;
var = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled;
flag = VERT_BIT_COLOR;
break;
case GL_INDEX_ARRAY:
var = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled;
@ -73,17 +73,6 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
var = &ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled;
flag = VERT_BIT_FOG;
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
var = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
flag = VERT_BIT_COLOR1;
break;
#if FEATURE_point_size_array
case GL_POINT_SIZE_ARRAY_OES:
var = &ctx->Array.VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
flag = VERT_BIT_POINT_SIZE;
break;
#endif
default:
goto invalid_enum_error;
@ -276,7 +265,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
ctx->Light.ColorMaterialEnabled = state;
if (state) {
_mesa_update_color_material( ctx,
ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
ctx->Current.Attrib[VERT_ATTRIB_COLOR] );
}
break;
case GL_CULL_FACE:
@ -882,7 +871,7 @@ _mesa_IsEnabled( GLenum cap )
case GL_NORMAL_ARRAY:
return (ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0);
case GL_COLOR_ARRAY:
return (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Enabled != 0);
return (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled != 0);
case GL_INDEX_ARRAY:
return (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0);
case GL_TEXTURE_COORD_ARRAY:
@ -893,9 +882,6 @@ _mesa_IsEnabled( GLenum cap )
case GL_FOG_COORDINATE_ARRAY_EXT:
CHECK_EXTENSION(EXT_fog_coord);
return (ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0);
case GL_SECONDARY_COLOR_ARRAY_EXT:
CHECK_EXTENSION(EXT_secondary_color);
return (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0);
#if FEATURE_point_size_array
case GL_POINT_SIZE_ARRAY_OES:
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0);

View file

@ -198,7 +198,6 @@ void _mesa_init_fog( struct gl_context * ctx )
ctx->Fog.Density = 1.0;
ctx->Fog.Start = 0.0;
ctx->Fog.End = 1.0;
ctx->Fog.ColorSumEnabled = GL_FALSE;
ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
ctx->Fog._Scale = 1.0f;
ctx->Fog.FogDistanceMode = GL_EYE_PLANE_ABSOLUTE_NV;

View file

@ -283,7 +283,7 @@ static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END };
static const struct value_desc values[] = {
{ GL_ALPHA_BITS, BUFFER_INT(Visual.alphaBits), extra_new_buffers },
{ GL_BLEND, CONTEXT_BIT0(Color.BlendEnabled), NO_EXTRA },
{ GL_BLEND_SRC, CONTEXT_ENUM(Color.SrcRGB), NO_EXTRA },
{ GL_BLEND_SRC, CONTEXT_ENUM(Color.SrcFactor), NO_EXTRA },
{ GL_BLUE_BITS, BUFFER_INT(Visual.blueBits), extra_new_buffers },
{ GL_COLOR_CLEAR_VALUE, LOC_CUSTOM, TYPE_FLOATN_4, 0, NO_EXTRA },
{ GL_COLOR_WRITEMASK, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
@ -345,15 +345,8 @@ static const struct value_desc values[] = {
extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */
/* XXX: OES_blend_subtract */
{ GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.SrcRGB), NO_EXTRA },
{ GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.DstRGB), NO_EXTRA },
{ GL_BLEND_SRC_ALPHA_EXT, CONTEXT_ENUM(Color.SrcA), NO_EXTRA },
{ GL_BLEND_DST_ALPHA_EXT, CONTEXT_ENUM(Color.DstA), NO_EXTRA },
/* GL_BLEND_EQUATION_RGB, which is what we're really after, is
* defined identically to GL_BLEND_EQUATION. */
{ GL_BLEND_EQUATION, CONTEXT_ENUM(Color.EquationRGB), NO_EXTRA },
{ GL_BLEND_EQUATION_ALPHA_EXT, CONTEXT_ENUM(Color.EquationA), NO_EXTRA },
{ GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.SrcFactor), NO_EXTRA },
{ GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.DstFactor), NO_EXTRA },
/* GL_ARB_multisample */
{ GL_SAMPLE_ALPHA_TO_COVERAGE_ARB,
@ -397,7 +390,7 @@ static const struct value_desc values[] = {
{ GL_ALPHA_TEST, CONTEXT_BOOL(Color.AlphaEnabled), NO_EXTRA },
{ GL_ALPHA_TEST_FUNC, CONTEXT_ENUM(Color.AlphaFunc), NO_EXTRA },
{ GL_ALPHA_TEST_REF, LOC_CUSTOM, TYPE_FLOATN, 0, NO_EXTRA },
{ GL_BLEND_DST, CONTEXT_ENUM(Color.DstRGB), NO_EXTRA },
{ GL_BLEND_DST, CONTEXT_ENUM(Color.DstFactor), NO_EXTRA },
{ GL_CLIP_DISTANCE0, CONTEXT_BIT0(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
{ GL_CLIP_DISTANCE1, CONTEXT_BIT1(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
{ GL_CLIP_DISTANCE2, CONTEXT_BIT2(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
@ -408,7 +401,7 @@ static const struct value_desc values[] = {
{ GL_CLIP_DISTANCE7, CONTEXT_BIT7(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
{ GL_COLOR_MATERIAL, CONTEXT_BOOL(Light.ColorMaterialEnabled), NO_EXTRA },
{ GL_CURRENT_COLOR,
CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR0][0], TYPE_FLOATN_4),
CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR][0], TYPE_FLOATN_4),
extra_flush_current },
{ GL_CURRENT_NORMAL,
CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_NORMAL][0], TYPE_FLOATN_3),
@ -462,10 +455,10 @@ static const struct value_desc values[] = {
{ GL_NORMAL_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_NORMAL].Enabled), NO_EXTRA },
{ GL_NORMAL_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_NORMAL].Type), NO_EXTRA },
{ GL_NORMAL_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_NORMAL].Stride), NO_EXTRA },
{ GL_COLOR_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR0].Enabled), NO_EXTRA },
{ GL_COLOR_ARRAY_SIZE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Size), NO_EXTRA },
{ GL_COLOR_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA },
{ GL_COLOR_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA },
{ GL_COLOR_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR].Enabled), NO_EXTRA },
{ GL_COLOR_ARRAY_SIZE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR].Size), NO_EXTRA },
{ GL_COLOR_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR].Type), NO_EXTRA },
{ GL_COLOR_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR].Stride), NO_EXTRA },
{ GL_TEXTURE_COORD_ARRAY,
LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Enabled), NO_EXTRA },
{ GL_TEXTURE_COORD_ARRAY_SIZE,
@ -491,7 +484,7 @@ static const struct value_desc values[] = {
{ GL_NORMAL_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_NORMAL].BufferObj), NO_EXTRA },
{ GL_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR0].BufferObj), NO_EXTRA },
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR].BufferObj), NO_EXTRA },
{ GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
/* GL_OES_point_sprite */
@ -529,8 +522,6 @@ static const struct value_desc values[] = {
{ GL_CURRENT_RASTER_DISTANCE, CONTEXT_FLOAT(Current.RasterDistance), NO_EXTRA },
{ GL_CURRENT_RASTER_INDEX, CONST(1), NO_EXTRA },
{ GL_CURRENT_RASTER_POSITION, CONTEXT_FLOAT4(Current.RasterPos[0]), NO_EXTRA },
{ GL_CURRENT_RASTER_SECONDARY_COLOR,
CONTEXT_FIELD(Current.RasterSecondaryColor[0], TYPE_FLOATN_4), NO_EXTRA },
{ GL_CURRENT_RASTER_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0,
extra_valid_texture_unit },
{ GL_CURRENT_RASTER_POSITION_VALID, CONTEXT_BOOL(Current.RasterPosValid), NO_EXTRA },
@ -550,7 +541,6 @@ static const struct value_desc values[] = {
{ GL_INDEX_OFFSET, CONTEXT_INT(Pixel.IndexOffset), NO_EXTRA },
{ GL_INDEX_SHIFT, CONTEXT_INT(Pixel.IndexShift), NO_EXTRA },
{ GL_INDEX_WRITEMASK, CONTEXT_INT(Color.IndexMask), NO_EXTRA },
{ GL_LIGHT_MODEL_COLOR_CONTROL, CONTEXT_ENUM(Light.Model.ColorControl), NO_EXTRA },
{ GL_LIGHT_MODEL_LOCAL_VIEWER, CONTEXT_BOOL(Light.Model.LocalViewer), NO_EXTRA },
{ GL_LINE_STIPPLE, CONTEXT_BOOL(Line.StippleFlag), NO_EXTRA },
{ GL_LINE_STIPPLE_PATTERN, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
@ -674,19 +664,6 @@ static const struct value_desc values[] = {
CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA },
{ GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA },
/* GL_EXT_secondary_color */
{ GL_CURRENT_SECONDARY_COLOR_EXT,
CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR1][0], TYPE_FLOATN_4),
extra_EXT_secondary_color_flush_current },
{ GL_SECONDARY_COLOR_ARRAY_EXT, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR1].Enabled),
extra_EXT_secondary_color },
{ GL_SECONDARY_COLOR_ARRAY_TYPE_EXT, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR1].Type),
extra_EXT_secondary_color },
{ GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride),
extra_EXT_secondary_color },
{ GL_SECONDARY_COLOR_ARRAY_SIZE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Size),
extra_EXT_secondary_color },
/* GL_EXT_fog_coord */
{ GL_CURRENT_FOG_COORDINATE_EXT,
CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]),
@ -726,8 +703,6 @@ static const struct value_desc values[] = {
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR_INDEX].BufferObj), NO_EXTRA },
{ GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_EDGEFLAG].BufferObj), NO_EXTRA },
{ GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR1].BufferObj), NO_EXTRA },
{ GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_FOG].BufferObj), NO_EXTRA },
@ -1029,9 +1004,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
((char *) &ctx->Array + d->offset);
v->value_int = (*buffer_obj)->Name;
break;
case GL_ARRAY_BUFFER_BINDING_ARB:
v->value_int = ctx->Array.ArrayBufferObj->Name;
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
v->value_int =
ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].BufferObj->Name;
@ -1049,9 +1021,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_float_4[2] = ctx->Color.ClearColor.f[2], 0.0F, 1.0F;
v->value_float_4[3] = ctx->Color.ClearColor.f[3], 0.0F, 1.0F;
break;
case GL_BLEND_COLOR_EXT:
COPY_4FV(v->value_float_4, ctx->Color.BlendColor);
break;
case GL_ALPHA_TEST_REF:
v->value_float = ctx->Color.AlphaRef;
break;

View file

@ -62,9 +62,6 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params );
extern const GLubyte * GLAPIENTRY
_mesa_GetString( GLenum name );
extern const GLubyte * GLAPIENTRY
_mesa_GetStringi(GLenum name, GLuint index);
extern GLenum GLAPIENTRY
_mesa_GetError( void );

View file

@ -72,33 +72,6 @@ _mesa_GetString( GLenum name )
}
/**
* GL3
*/
const GLubyte * GLAPIENTRY
_mesa_GetStringi(GLenum name, GLuint index)
{
GET_CURRENT_CONTEXT(ctx);
if (!ctx)
return NULL;
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
switch (name) {
case GL_EXTENSIONS:
if (index >= _mesa_get_extension_count(ctx)) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetStringi(index=%u)", index);
return (const GLubyte *) 0;
}
return _mesa_get_enabled_extension(ctx, index);
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
return (const GLubyte *) 0;
}
}
/**
* Return pointer-valued state, such as a vertex array pointer.
@ -131,10 +104,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
*params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Ptr;
break;
case GL_COLOR_ARRAY_POINTER:
*params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Ptr;
break;
case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
*params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Ptr;
*params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Ptr;
break;
case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
*params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Ptr;
@ -154,11 +124,6 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
case GL_SELECTION_BUFFER_POINTER:
*params = ctx->Select.Buffer;
break;
#if FEATURE_point_size_array
case GL_POINT_SIZE_ARRAY_POINTER_OES:
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Ptr;
break;
#endif
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
return;

View file

@ -888,14 +888,14 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... )
void
_mesa_debug( const struct gl_context *ctx, const char *fmtString, ... )
{
#ifdef DEBUG
//#ifdef DEBUG
char s[MAXSTRING];
va_list args;
va_start(args, fmtString);
vsnprintf(s, MAXSTRING, fmtString, args);
va_end(args);
output_if_debug("Mesa", s, GL_FALSE);
#endif /* DEBUG */
//#endif /* DEBUG */
(void) ctx;
(void) fmtString;
}

View file

@ -418,7 +418,6 @@ _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params )
void GLAPIENTRY
_mesa_LightModelfv( GLenum pname, const GLfloat *params )
{
GLenum newenum;
GLboolean newbool;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@ -448,21 +447,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
else
ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
if (params[0] == (GLfloat) GL_SINGLE_COLOR)
newenum = GL_SINGLE_COLOR;
else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR)
newenum = GL_SEPARATE_SPECULAR_COLOR;
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(param=0x0%x)",
(GLint) params[0] );
return;
}
if (ctx->Light.Model.ColorControl == newenum)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.ColorControl = newenum;
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname );
break;
@ -716,7 +700,7 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
if (ctx->Light.ColorMaterialEnabled) {
FLUSH_CURRENT( ctx, 0 );
_mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
_mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR]);
}
if (ctx->Driver.ColorMaterial)
@ -1019,7 +1003,6 @@ _mesa_update_lighting( struct gl_context *ctx )
ctx->Light._NeedVertices =
((ctx->Light._Flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) ||
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR ||
ctx->Light.Model.LocalViewer);
ctx->Light._NeedEyeCoords = ((ctx->Light._Flags & LIGHT_POSITIONAL) ||
@ -1285,7 +1268,6 @@ init_lightmodel( struct gl_lightmodel *lm )
ASSIGN_4V( lm->Ambient, 0.2F, 0.2F, 0.2F, 1.0F );
lm->LocalViewer = GL_FALSE;
lm->TwoSide = GL_FALSE;
lm->ColorControl = GL_SINGLE_COLOR;
}

View file

@ -96,14 +96,13 @@ typedef enum
VERT_ATTRIB_POS = 0,
VERT_ATTRIB_WEIGHT = 1,
VERT_ATTRIB_NORMAL = 2,
VERT_ATTRIB_COLOR0 = 3,
VERT_ATTRIB_COLOR1 = 4,
VERT_ATTRIB_FOG = 5,
VERT_ATTRIB_COLOR_INDEX = 6,
VERT_ATTRIB_EDGEFLAG = 7,
VERT_ATTRIB_TEX = 8,
VERT_ATTRIB_POINT_SIZE = 9,
VERT_ATTRIB_MAX = 10
VERT_ATTRIB_COLOR = 3,
VERT_ATTRIB_FOG = 4,
VERT_ATTRIB_COLOR_INDEX = 5,
VERT_ATTRIB_EDGEFLAG = 6,
VERT_ATTRIB_TEX = 7,
VERT_ATTRIB_POINT_SIZE = 8,
VERT_ATTRIB_MAX = 9
} gl_vert_attrib;
/**
@ -121,8 +120,7 @@ typedef enum
#define VERT_BIT_POS BITFIELD64_BIT(VERT_ATTRIB_POS)
#define VERT_BIT_WEIGHT BITFIELD64_BIT(VERT_ATTRIB_WEIGHT)
#define VERT_BIT_NORMAL BITFIELD64_BIT(VERT_ATTRIB_NORMAL)
#define VERT_BIT_COLOR0 BITFIELD64_BIT(VERT_ATTRIB_COLOR0)
#define VERT_BIT_COLOR1 BITFIELD64_BIT(VERT_ATTRIB_COLOR1)
#define VERT_BIT_COLOR BITFIELD64_BIT(VERT_ATTRIB_COLOR)
#define VERT_BIT_FOG BITFIELD64_BIT(VERT_ATTRIB_FOG)
#define VERT_BIT_COLOR_INDEX BITFIELD64_BIT(VERT_ATTRIB_COLOR_INDEX)
#define VERT_BIT_EDGEFLAG BITFIELD64_BIT(VERT_ATTRIB_EDGEFLAG)
@ -143,20 +141,18 @@ typedef enum
typedef enum
{
FRAG_ATTRIB_WPOS = 0,
FRAG_ATTRIB_COL0 = 1,
FRAG_ATTRIB_COL1 = 2,
FRAG_ATTRIB_FOGC = 3,
FRAG_ATTRIB_TEX = 4,
FRAG_ATTRIB_FACE = 5, /**< front/back face */
FRAG_ATTRIB_PNTC = 6, /**< sprite/point coord */
FRAG_ATTRIB_CLIP_DIST0 = 7,
FRAG_ATTRIB_CLIP_DIST1 = 8,
FRAG_ATTRIB_MAX = 9
FRAG_ATTRIB_COL = 1,
FRAG_ATTRIB_FOGC = 2,
FRAG_ATTRIB_TEX = 3,
FRAG_ATTRIB_FACE = 4, /**< front/back face */
FRAG_ATTRIB_PNTC = 5, /**< sprite/point coord */
FRAG_ATTRIB_CLIP_DIST0 = 6,
FRAG_ATTRIB_CLIP_DIST1 = 7,
FRAG_ATTRIB_MAX = 8
} gl_frag_attrib;
#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
#define FRAG_BIT_COL (1 << FRAG_ATTRIB_COL)
#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
#define FRAG_BIT_TEX (1 << FRAG_ATTRIB_TEX)
@ -386,8 +382,6 @@ struct gl_lightmodel
GLfloat Ambient[4]; /**< ambient color */
GLboolean LocalViewer; /**< Local (or infinite) view point? */
GLboolean TwoSide; /**< Two (or one) sided lighting? */
GLenum ColorControl; /**< either GL_SINGLE_COLOR
* or GL_SEPARATE_SPECULAR_COLOR */
};
@ -452,14 +446,9 @@ struct gl_colorbuffer_attrib
* control, only on the fixed-pointness of the render target.
* The query does however depend on fragment color clamping.
*/
GLfloat BlendColor[4]; /**< Blending color */
GLenum SrcRGB; /**< RGB blend source term */
GLenum DstRGB; /**< RGB blend dest term */
GLenum SrcA; /**< Alpha blend source term */
GLenum DstA; /**< Alpha blend dest term */
GLenum EquationRGB; /**< GL_ADD, GL_SUBTRACT, etc. */
GLenum EquationA; /**< GL_ADD, GL_SUBTRACT, etc. */
GLenum SrcFactor; /**< RGB blend source term */
GLenum DstFactor; /**< RGB blend dest term */
/*@}*/
/**
@ -496,7 +485,6 @@ struct gl_current_attrib
GLfloat RasterPos[4];
GLfloat RasterDistance;
GLfloat RasterColor[4];
GLfloat RasterSecondaryColor[4];
GLfloat RasterTexCoords[4];
GLboolean RasterPosValid;
/*@}*/
@ -572,7 +560,6 @@ struct gl_fog_attrib
GLfloat End; /**< End distance in eye coords */
GLfloat Index; /**< Fog index */
GLenum Mode; /**< Fog mode */
GLboolean ColorSumEnabled;
GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */
GLenum FogDistanceMode; /**< GL_NV_fog_distance */
@ -1214,9 +1201,6 @@ struct gl_array_attrib
GLbitfield64 NewState; /**< mask of VERT_BIT_* values */
GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */
/* GL_ARB_vertex_buffer_object */
struct gl_buffer_object *ArrayBufferObj;
};
@ -1470,8 +1454,6 @@ struct gl_constants
GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */
GLfloat LineWidthGranularity;
GLuint MaxColorTableSize;
GLuint MaxClipPlanes;
GLuint MaxLights;
GLfloat MaxShininess; /**< GL_NV_light_max_exponent */
@ -1645,17 +1627,16 @@ struct gl_matrix_stack
*/
/*@{*/
#define DD_FLATSHADE 0x1
#define DD_SEPARATE_SPECULAR 0x2
#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
#define DD_TRI_LIGHT_TWOSIDE 0x8
#define DD_TRI_UNFILLED 0x10
#define DD_TRI_SMOOTH 0x20
#define DD_TRI_STIPPLE 0x40
#define DD_TRI_OFFSET 0x80
#define DD_LINE_SMOOTH 0x100
#define DD_LINE_STIPPLE 0x200
#define DD_POINT_SMOOTH 0x400
#define DD_POINT_ATTEN 0x800
#define DD_TRI_CULL_FRONT_BACK 0x2 /* special case on some hw */
#define DD_TRI_LIGHT_TWOSIDE 0x4
#define DD_TRI_UNFILLED 0x8
#define DD_TRI_SMOOTH 0x10
#define DD_TRI_STIPPLE 0x20
#define DD_TRI_OFFSET 0x40
#define DD_LINE_SMOOTH 0x80
#define DD_LINE_STIPPLE 0x100
#define DD_POINT_SMOOTH 0x200
#define DD_POINT_ATTEN 0x400
/*@}*/

View file

@ -13,10 +13,8 @@
#include "clear.h"
#include "clip.h"
#include "colormac.h"
#include "colortab.h"
#include "compiler.h"
#include "context.h"
#include "convolve.h"
#include "cpuinfo.h"
#include "depth.h"
#include "dispatch.h"

View file

@ -240,21 +240,13 @@ window_pos3f(GLfloat x, GLfloat y, GLfloat z)
/* raster color = current color or index */
ctx->Current.RasterColor[0]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][0], 0.0F, 1.0F);
ctx->Current.RasterColor[1]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][1], 0.0F, 1.0F);
ctx->Current.RasterColor[2]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][2], 0.0F, 1.0F);
ctx->Current.RasterColor[3]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[0]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[1]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[2]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[3]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][3], 0.0F, 1.0F);
/* raster texcoord = current texcoord */
COPY_4FV( ctx->Current.RasterTexCoords, ctx->Current.Attrib[VERT_ATTRIB_TEX] );
@ -539,7 +531,6 @@ void _mesa_init_rastpos( struct gl_context * ctx )
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterTexCoords, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
}

View file

@ -32,15 +32,6 @@
#include <precomp.h>
static void
update_separate_specular(struct gl_context *ctx)
{
if (_mesa_need_secondary_color(ctx))
ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
else
ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
}
/**
* Helper for update_arrays().
@ -79,13 +70,8 @@ update_arrays( struct gl_context *ctx )
}
/* 3 */
if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0]);
}
/* 4 */
if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1]);
if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled) {
min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR]);
}
/* 5 */
@ -262,9 +248,6 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state & _NEW_PIXEL)
_mesa_update_pixel( ctx, new_state );
if (new_state & _DD_NEW_SEPARATE_SPECULAR)
update_separate_specular( ctx );
if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
update_viewport_matrix(ctx);

View file

@ -37,21 +37,4 @@ _mesa_update_state(struct gl_context *ctx);
extern void
_mesa_update_state_locked(struct gl_context *ctx);
/**
* Is the secondary color needed?
*/
static inline GLboolean
_mesa_need_secondary_color(const struct gl_context *ctx)
{
if (ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
return GL_TRUE;
if (ctx->Fog.ColorSumEnabled)
return GL_TRUE;
return GL_FALSE;
}
#endif

View file

@ -118,14 +118,6 @@ update_array(struct gl_context *ctx,
return;
}
if (!_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) {
/* GL_ARB_vertex_array_object requires that all arrays reside in VBOs.
* Generate GL_INVALID_OPERATION if that's not true.
*/
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-VBO array)", func);
return;
}
elementSize = _mesa_sizeof_type(type) * size;
array = &ctx->Array.VertexAttrib[attrib];
@ -138,9 +130,6 @@ update_array(struct gl_context *ctx,
array->Ptr = (const GLubyte *) ptr;
array->_ElementSize = elementSize;
_mesa_reference_buffer_object(ctx, &array->BufferObj,
ctx->Array.ArrayBufferObj);
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= VERT_BIT(attrib);
}
@ -184,7 +173,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
update_array(ctx, "glColorPointer", VERT_ATTRIB_COLOR0,
update_array(ctx, "glColorPointer", VERT_ATTRIB_COLOR,
legalTypes, 3, 4,
size, type, stride, GL_TRUE, GL_FALSE, ptr);
}
@ -217,23 +206,6 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
}
void GLAPIENTRY
_mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
SHORT_BIT | UNSIGNED_SHORT_BIT |
INT_BIT | UNSIGNED_INT_BIT |
HALF_BIT | FLOAT_BIT | DOUBLE_BIT);
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
update_array(ctx, "glSecondaryColorPointer", VERT_ATTRIB_COLOR1,
legalTypes, 3, 4,
size, type, stride, GL_TRUE, GL_FALSE, ptr);
}
void GLAPIENTRY
_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
@ -644,9 +616,6 @@ _mesa_init_varray(struct gl_context *ctx, struct gl_array_attrib *array)
case VERT_ATTRIB_NORMAL:
init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_NORMAL], 3, GL_FLOAT);
break;
case VERT_ATTRIB_COLOR1:
init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_COLOR1], 3, GL_FLOAT);
break;
case VERT_ATTRIB_FOG:
init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_FOG], 1, GL_FLOAT);
break;
@ -656,11 +625,6 @@ _mesa_init_varray(struct gl_context *ctx, struct gl_array_attrib *array)
case VERT_ATTRIB_EDGEFLAG:
init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_EDGEFLAG], 1, GL_BOOL);
break;
#if FEATURE_point_size_array
case VERT_ATTRIB_POINT_SIZE:
init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_POINT_SIZE], 1, GL_FLOAT);
break;
#endif
default:
init_array(ctx, &array->VertexAttrib[i], 4, GL_FLOAT);
break;

View file

@ -132,11 +132,6 @@ extern void GLAPIENTRY
_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr);
extern void GLAPIENTRY
_mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr);
extern void GLAPIENTRY
_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
@ -165,10 +160,6 @@ extern void GLAPIENTRY
_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices);
extern void GLAPIENTRY
_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
GLenum type, const GLvoid *indices);
extern void
_mesa_copy_client_array(struct gl_context *ctx,

View file

@ -54,8 +54,6 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
SET_Materialfv(tab, vfmt->Materialfv);
SET_Normal3f(tab, vfmt->Normal3f);
SET_Normal3fv(tab, vfmt->Normal3fv);
SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT);
SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT);
SET_TexCoord1f(tab, vfmt->TexCoord1f);
SET_TexCoord1fv(tab, vfmt->TexCoord1fv);
SET_TexCoord2f(tab, vfmt->TexCoord2f);
@ -80,7 +78,6 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
SET_DrawArrays(tab, vfmt->DrawArrays);
SET_DrawElements(tab, vfmt->DrawElements);
SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
/* GL_NV_vertex_program */
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);

View file

@ -470,9 +470,6 @@ _swrast_choose_aa_line_function(struct gl_context *ctx)
ASSERT(ctx->Line.SmoothFlag);
if (ctx->Texture._EnabledCoord
|| (ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
|| ctx->Fog.ColorSumEnabled
|| swrast->_FogEnabled) {
swrast->Line = aa_general_rgba_line;
}

View file

@ -289,8 +289,7 @@ _swrast_set_aa_triangle_function(struct gl_context *ctx)
ASSERT(ctx->Polygon.SmoothFlag);
if (ctx->Texture._EnabledCoord
|| swrast->_FogEnabled
|| _mesa_need_secondary_color(ctx)) {
|| swrast->_FogEnabled) {
SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri;
}
else {

View file

@ -116,7 +116,7 @@ _swrast_alpha_test(const struct gl_context *ctx, SWspan *span)
ALPHA_TEST(rgba[i][ACOMP], ;);
}
else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
const GLfloat ref = ctx->Color.AlphaRef;
ALPHA_TEST(rgba[i][ACOMP], ;);
}

View file

@ -292,113 +292,6 @@ blend_add(struct gl_context *ctx, GLuint n, const GLubyte mask[],
/**
* Blend min function.
* Any chanType ok.
*/
static void _BLENDAPI
blend_min(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
ASSERT(ctx->Color.EquationRGB == GL_MIN);
ASSERT(ctx->Color.EquationA == GL_MIN);
(void) ctx;
if (chanType == GL_UNSIGNED_BYTE) {
GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
else if (chanType == GL_UNSIGNED_SHORT) {
GLushort (*rgba)[4] = (GLushort (*)[4]) src;
const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
else {
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
ASSERT(chanType == GL_FLOAT);
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
}
/**
* Blend max function.
* Any chanType ok.
*/
static void _BLENDAPI
blend_max(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
ASSERT(ctx->Color.EquationRGB == GL_MAX);
ASSERT(ctx->Color.EquationA == GL_MAX);
(void) ctx;
if (chanType == GL_UNSIGNED_BYTE) {
GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
else if (chanType == GL_UNSIGNED_SHORT) {
GLushort (*rgba)[4] = (GLushort (*)[4]) src;
const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
else {
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
ASSERT(chanType == GL_FLOAT);
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
}
/**
* Modulate: result = src * dest
* Any chanType ok.
@ -488,68 +381,56 @@ blend_general_float(struct gl_context *ctx, GLuint n, const GLubyte mask[],
*/
/* Source RGB factor */
switch (ctx->Color.SrcRGB) {
switch (ctx->Color.SrcFactor) {
case GL_ZERO:
sR = sG = sB = 0.0F;
sR = sG = sB = sA = 0.0F;
break;
case GL_ONE:
sR = sG = sB = 1.0F;
sR = sG = sB = sA = 1.0F;
break;
case GL_DST_COLOR:
sR = Rd;
sG = Gd;
sB = Bd;
sA = Ad;
break;
case GL_ONE_MINUS_DST_COLOR:
sR = 1.0F - Rd;
sG = 1.0F - Gd;
sB = 1.0F - Bd;
sA = 1.0f - Ad;
break;
case GL_SRC_ALPHA:
sR = sG = sB = As;
sR = sG = sB = sA = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
sR = sG = sB = 1.0F - As;
sR = sG = sB = sA = 1.0F - As;
break;
case GL_DST_ALPHA:
sR = sG = sB = Ad;
sR = sG = sB = sA = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
sR = sG = sB = 1.0F - Ad;
sR = sG = sB = sA = 1.0F - Ad;
break;
case GL_SRC_ALPHA_SATURATE:
if (As < 1.0F - Ad) {
sR = sG = sB = As;
sR = sG = sB = sA = As;
}
else {
sR = sG = sB = 1.0F - Ad;
sR = sG = sB = sA = 1.0F - Ad;
}
break;
case GL_CONSTANT_COLOR:
sR = ctx->Color.BlendColor[0];
sG = ctx->Color.BlendColor[1];
sB = ctx->Color.BlendColor[2];
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
sR = 1.0F - ctx->Color.BlendColor[0];
sG = 1.0F - ctx->Color.BlendColor[1];
sB = 1.0F - ctx->Color.BlendColor[2];
break;
case GL_CONSTANT_ALPHA:
sR = sG = sB = ctx->Color.BlendColor[3];
break;
case GL_ONE_MINUS_CONSTANT_ALPHA:
sR = sG = sB = 1.0F - ctx->Color.BlendColor[3];
break;
case GL_SRC_COLOR:
sR = Rs;
sG = Gs;
sB = Bs;
sA = As;
break;
case GL_ONE_MINUS_SRC_COLOR:
sR = 1.0F - Rs;
sG = 1.0F - Gs;
sB = 1.0F - Bs;
sA = 1.0F - As;
break;
default:
/* this should never happen */
@ -557,234 +438,62 @@ blend_general_float(struct gl_context *ctx, GLuint n, const GLubyte mask[],
return;
}
/* Source Alpha factor */
switch (ctx->Color.SrcA) {
/* Dest factor */
switch (ctx->Color.DstFactor) {
case GL_ZERO:
sA = 0.0F;
dR = dG = dB = dA = 0.0F;
break;
case GL_ONE:
sA = 1.0F;
break;
case GL_DST_COLOR:
sA = Ad;
break;
case GL_ONE_MINUS_DST_COLOR:
sA = 1.0F - Ad;
break;
case GL_SRC_ALPHA:
sA = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
sA = 1.0F - As;
break;
case GL_DST_ALPHA:
sA = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
sA = 1.0F - Ad;
break;
case GL_SRC_ALPHA_SATURATE:
sA = 1.0;
break;
case GL_CONSTANT_COLOR:
sA = ctx->Color.BlendColor[3];
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
sA = 1.0F - ctx->Color.BlendColor[3];
break;
case GL_CONSTANT_ALPHA:
sA = ctx->Color.BlendColor[3];
break;
case GL_ONE_MINUS_CONSTANT_ALPHA:
sA = 1.0F - ctx->Color.BlendColor[3];
break;
case GL_SRC_COLOR:
sA = As;
break;
case GL_ONE_MINUS_SRC_COLOR:
sA = 1.0F - As;
break;
default:
/* this should never happen */
sA = 0.0F;
_mesa_problem(ctx, "Bad blend source A factor in blend_general_float");
return;
}
/* Dest RGB factor */
switch (ctx->Color.DstRGB) {
case GL_ZERO:
dR = dG = dB = 0.0F;
break;
case GL_ONE:
dR = dG = dB = 1.0F;
dR = dG = dB = dA = 1.0F;
break;
case GL_SRC_COLOR:
dR = Rs;
dG = Gs;
dB = Bs;
dA = As;
break;
case GL_ONE_MINUS_SRC_COLOR:
dR = 1.0F - Rs;
dG = 1.0F - Gs;
dB = 1.0F - Bs;
dA = 1.0F - As;
break;
case GL_SRC_ALPHA:
dR = dG = dB = As;
dR = dG = dB = dA = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
dR = dG = dB = 1.0F - As;
dR = dG = dB = dA = 1.0F - As;
break;
case GL_DST_ALPHA:
dR = dG = dB = Ad;
dR = dG = dB = dA = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
dR = dG = dB = 1.0F - Ad;
break;
case GL_CONSTANT_COLOR:
dR = ctx->Color.BlendColor[0];
dG = ctx->Color.BlendColor[1];
dB = ctx->Color.BlendColor[2];
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
dR = 1.0F - ctx->Color.BlendColor[0];
dG = 1.0F - ctx->Color.BlendColor[1];
dB = 1.0F - ctx->Color.BlendColor[2];
break;
case GL_CONSTANT_ALPHA:
dR = dG = dB = ctx->Color.BlendColor[3];
break;
case GL_ONE_MINUS_CONSTANT_ALPHA:
dR = dG = dB = 1.0F - ctx->Color.BlendColor[3];
dR = dG = dB = dA = 1.0F - Ad;
break;
case GL_DST_COLOR:
dR = Rd;
dG = Gd;
dB = Bd;
dA = Ad;
break;
case GL_ONE_MINUS_DST_COLOR:
dR = 1.0F - Rd;
dG = 1.0F - Gd;
dB = 1.0F - Bd;
break;
default:
/* this should never happen */
dR = dG = dB = 0.0F;
_mesa_problem(ctx, "Bad blend dest RGB factor in blend_general_float");
return;
}
/* Dest Alpha factor */
switch (ctx->Color.DstA) {
case GL_ZERO:
dA = 0.0F;
break;
case GL_ONE:
dA = 1.0F;
break;
case GL_SRC_COLOR:
dA = As;
break;
case GL_ONE_MINUS_SRC_COLOR:
dA = 1.0F - As;
break;
case GL_SRC_ALPHA:
dA = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
dA = 1.0F - As;
break;
case GL_DST_ALPHA:
dA = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
dA = 1.0F - Ad;
break;
case GL_CONSTANT_COLOR:
dA = ctx->Color.BlendColor[3];
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
dA = 1.0F - ctx->Color.BlendColor[3];
break;
case GL_CONSTANT_ALPHA:
dA = ctx->Color.BlendColor[3];
break;
case GL_ONE_MINUS_CONSTANT_ALPHA:
dA = 1.0F - ctx->Color.BlendColor[3];
break;
case GL_DST_COLOR:
dA = Ad;
break;
case GL_ONE_MINUS_DST_COLOR:
dA = 1.0F - Ad;
break;
default:
/* this should never happen */
dA = 0.0F;
_mesa_problem(ctx, "Bad blend dest A factor in blend_general_float");
dR = dG = dB = dA = 0.0F;
_mesa_problem(ctx, "Bad blend dest factor in blend_general_float");
return;
}
/* compute the blended RGB */
switch (ctx->Color.EquationRGB) {
case GL_FUNC_ADD:
r = Rs * sR + Rd * dR;
g = Gs * sG + Gd * dG;
b = Bs * sB + Bd * dB;
a = As * sA + Ad * dA;
break;
case GL_FUNC_SUBTRACT:
r = Rs * sR - Rd * dR;
g = Gs * sG - Gd * dG;
b = Bs * sB - Bd * dB;
a = As * sA - Ad * dA;
break;
case GL_FUNC_REVERSE_SUBTRACT:
r = Rd * dR - Rs * sR;
g = Gd * dG - Gs * sG;
b = Bd * dB - Bs * sB;
a = Ad * dA - As * sA;
break;
case GL_MIN:
r = MIN2( Rd, Rs );
g = MIN2( Gd, Gs );
b = MIN2( Bd, Bs );
break;
case GL_MAX:
r = MAX2( Rd, Rs );
g = MAX2( Gd, Gs );
b = MAX2( Bd, Bs );
break;
default:
/* should never get here */
r = g = b = 0.0F; /* silence uninitialized var warning */
_mesa_problem(ctx, "unexpected BlendEquation in blend_general()");
return;
}
/* compute the blended alpha */
switch (ctx->Color.EquationA) {
case GL_FUNC_ADD:
a = As * sA + Ad * dA;
break;
case GL_FUNC_SUBTRACT:
a = As * sA - Ad * dA;
break;
case GL_FUNC_REVERSE_SUBTRACT:
a = Ad * dA - As * sA;
break;
case GL_MIN:
a = MIN2( Ad, As );
break;
case GL_MAX:
a = MAX2( Ad, As );
break;
default:
/* should never get here */
a = 0.0F; /* silence uninitialized var warning */
_mesa_problem(ctx, "unexpected BlendEquation in blend_general()");
return;
}
/* compute the blended RGBA */
r = Rs * sR + Rd * dR;
g = Gs * sG + Gd * dG;
b = Bs * sB + Bd * dB;
a = As * sA + Ad * dA;
/* final clamping */
#if 0
@ -891,40 +600,10 @@ void
_swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLenum eq = ctx->Color.EquationRGB;
const GLenum srcRGB = ctx->Color.SrcRGB;
const GLenum dstRGB = ctx->Color.DstRGB;
const GLenum srcA = ctx->Color.SrcA;
const GLenum dstA = ctx->Color.DstA;
const GLenum srcFactor = ctx->Color.SrcFactor;
const GLenum dstFactor = ctx->Color.DstFactor;
if (ctx->Color.EquationRGB != ctx->Color.EquationA) {
swrast->BlendFunc = blend_general;
}
else if (eq == GL_MIN) {
/* Note: GL_MIN ignores the blending weight factors */
#if defined(USE_MMX_ASM)
if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
swrast->BlendFunc = _mesa_mmx_blend_min;
}
else
#endif
swrast->BlendFunc = blend_min;
}
else if (eq == GL_MAX) {
/* Note: GL_MAX ignores the blending weight factors */
#if defined(USE_MMX_ASM)
if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
swrast->BlendFunc = _mesa_mmx_blend_max;
}
else
#endif
swrast->BlendFunc = blend_max;
}
else if (srcRGB != srcA || dstRGB != dstA) {
swrast->BlendFunc = blend_general;
}
else if (eq == GL_FUNC_ADD && srcRGB == GL_SRC_ALPHA
&& dstRGB == GL_ONE_MINUS_SRC_ALPHA) {
if (srcFactor == GL_SRC_ALPHA && dstFactor == GL_ONE_MINUS_SRC_ALPHA) {
#if defined(USE_MMX_ASM)
if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
swrast->BlendFunc = _mesa_mmx_blend_transparency;
@ -940,7 +619,7 @@ _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType)
swrast->BlendFunc = blend_transparency_float;
}
}
else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ONE) {
else if (srcFactor == GL_ONE && dstFactor == GL_ONE) {
#if defined(USE_MMX_ASM)
if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
swrast->BlendFunc = _mesa_mmx_blend_add;
@ -949,11 +628,8 @@ _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType)
#endif
swrast->BlendFunc = blend_add;
}
else if (((eq == GL_FUNC_ADD || eq == GL_FUNC_REVERSE_SUBTRACT)
&& (srcRGB == GL_ZERO && dstRGB == GL_SRC_COLOR))
||
((eq == GL_FUNC_ADD || eq == GL_FUNC_SUBTRACT)
&& (srcRGB == GL_DST_COLOR && dstRGB == GL_ZERO))) {
else if ((srcFactor == GL_ZERO && dstFactor == GL_SRC_COLOR)
|| (srcFactor == GL_DST_COLOR && dstFactor == GL_ZERO)) {
#if defined(USE_MMX_ASM)
if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
swrast->BlendFunc = _mesa_mmx_blend_modulate;
@ -962,10 +638,10 @@ _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType)
#endif
swrast->BlendFunc = blend_modulate;
}
else if (eq == GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) {
else if (srcFactor == GL_ZERO && dstFactor == GL_ONE) {
swrast->BlendFunc = blend_noop;
}
else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) {
else if (srcFactor == GL_ONE && dstFactor == GL_ZERO) {
swrast->BlendFunc = blend_replace;
}
else {

View file

@ -190,22 +190,6 @@ _swrast_update_fog_state( struct gl_context *ctx )
}
/**
* See if we can do early diffuse+specular (primary+secondary) color
* add per vertex instead of per-fragment.
*/
static void
_swrast_update_specular_vertex_add(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLboolean separateSpecular = ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR);
swrast->SpecularVertexAdd = (separateSpecular && !ctx->Texture._Enabled);
}
#define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
_NEW_TEXTURE | \
_NEW_HINT | \
@ -266,12 +250,6 @@ _swrast_validate_triangle( struct gl_context *ctx,
swrast->choose_triangle( ctx );
ASSERT(swrast->Triangle);
if (swrast->SpecularVertexAdd) {
/* separate specular color, but no texture */
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
}
swrast->Triangle( ctx, v0, v1, v2 );
}
@ -288,11 +266,6 @@ _swrast_validate_line( struct gl_context *ctx, const SWvertex *v0, const SWverte
swrast->choose_line( ctx );
ASSERT(swrast->Line);
if (swrast->SpecularVertexAdd) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
}
swrast->Line( ctx, v0, v1 );
}
@ -308,11 +281,6 @@ _swrast_validate_point( struct gl_context *ctx, const SWvertex *v0 )
_swrast_validate_derived( ctx );
swrast->choose_point( ctx );
if (swrast->SpecularVertexAdd) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
}
swrast->Point( ctx, v0 );
}
@ -411,15 +379,9 @@ _swrast_update_active_attribs(struct gl_context *ctx)
attribsMask = 0x0;
#if CHAN_TYPE == GL_FLOAT
attribsMask |= FRAG_BIT_COL0;
attribsMask |= FRAG_BIT_COL;
#endif
if (ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
attribsMask |= FRAG_BIT_COL1;
}
if (swrast->_FogEnabled)
attribsMask |= FRAG_BIT_FOGC;
@ -434,7 +396,7 @@ _swrast_update_active_attribs(struct gl_context *ctx)
if (attribsMask & BITFIELD64_BIT(i)) {
swrast->_ActiveAttribs[num++] = i;
/* how should this attribute be interpolated? */
if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1)
if (i == FRAG_ATTRIB_COL)
swrast->_InterpMode[i] = ctx->Light.ShadeModel;
else
swrast->_InterpMode[i] = GL_SMOOTH;
@ -479,11 +441,6 @@ _swrast_validate_derived( struct gl_context *ctx )
_NEW_TEXTURE))
_swrast_update_active_attribs(ctx);
if (swrast->NewState & (_NEW_FOG |
_NEW_LIGHT |
_NEW_TEXTURE))
_swrast_update_specular_vertex_add(ctx);
swrast->NewState = 0;
swrast->StateChanges = 0;
swrast->InvalidateState = _swrast_invalidate_state;
@ -770,11 +727,6 @@ _swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
_mesa_debug(ctx, "color %d %d %d %d\n",
v->color[0], v->color[1], v->color[2], v->color[3]);
#endif
_mesa_debug(ctx, "spec %g %g %g %g\n",
v->attrib[FRAG_ATTRIB_COL1][0],
v->attrib[FRAG_ATTRIB_COL1][1],
v->attrib[FRAG_ATTRIB_COL1][2],
v->attrib[FRAG_ATTRIB_COL1][3]);
_mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]);
_mesa_debug(ctx, "index %f\n", v->attrib[FRAG_ATTRIB_CI][0]);
_mesa_debug(ctx, "pointsize %f\n", v->pointSize);

View file

@ -227,7 +227,6 @@ typedef struct
GLbitfield NewState;
GLuint StateChanges;
GLenum Primitive; /* current primitive being drawn (ala glBegin) */
GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */
void (*InvalidateState)( struct gl_context *ctx, GLbitfield new_state );

View file

@ -121,7 +121,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */
span.arrayAttribs = FRAG_BIT_COL; /* we'll fill in COL0 attrib values */
if (overlapping) {
tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat) * 4);
@ -146,7 +146,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
ASSERT(width < MAX_WIDTH);
for (row = 0; row < height; row++, sy += stepy, dy += stepy) {
GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL0];
GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL];
/* Get row/span of source pixels */
if (overlapping) {

View file

@ -409,7 +409,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
span.arrayAttribs = FRAG_BIT_COL; /* we're fill in COL0 attrib values */
if (_mesa_get_format_datatype(ctx->DrawBuffer->_ColorDrawBuffer->Format) != GL_FLOAT) {
/* need to clamp colors before applying fragment ops */
@ -426,7 +426,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
= _mesa_image_row_stride(unpack, width, format, type);
GLint skipPixels = 0;
/* use span array for temp color storage */
GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0];
GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL];
/* if the span is wider than MAX_WIDTH we have to do it in chunks */
while (skipPixels < width) {

View file

@ -31,7 +31,7 @@ feedback_vertex(struct gl_context * ctx, const SWvertex * v, const SWvertex * pv
{
GLfloat win[4];
const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX];
const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0];
const GLfloat *color = v->attrib[FRAG_ATTRIB_COL];
win[0] = v->attrib[FRAG_ATTRIB_WPOS][0];
win[1] = v->attrib[FRAG_ATTRIB_WPOS][1];

View file

@ -166,7 +166,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, LINEAR_FOG);
}
else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, LINEAR_FOG);
}
@ -185,7 +185,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, EXP_FOG);
}
else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, EXP_FOG);
}
@ -204,7 +204,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, EXP2_FOG);
}
else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, EXP2_FOG);
}
@ -229,7 +229,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, BLEND_FOG);
}
else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, BLEND_FOG);
}

View file

@ -149,41 +149,6 @@ draw_wide_line( struct gl_context *ctx, SWspan *span, GLboolean xMajor )
void
_swrast_add_spec_terms_line(struct gl_context *ctx,
const SWvertex *v0, const SWvertex *v1)
{
SWvertex *ncv0 = (SWvertex *)v0;
SWvertex *ncv1 = (SWvertex *)v1;
GLfloat rSum, gSum, bSum;
GLchan cSave[2][4];
/* save original colors */
COPY_CHAN4(cSave[0], ncv0->color);
COPY_CHAN4(cSave[1], ncv1->color);
/* sum v0 */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
/* sum v1 */
rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1];
bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum);
/* draw */
SWRAST_CONTEXT(ctx)->SpecLine( ctx, ncv0, ncv1 );
/* restore original colors */
COPY_CHAN4( ncv0->attrib[FRAG_ATTRIB_COL0], cSave[0] );
COPY_CHAN4( ncv1->attrib[FRAG_ATTRIB_COL0], cSave[1] );
}
#ifdef DEBUG
/* record the current line function name */
@ -215,9 +180,6 @@ void
_swrast_choose_line( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLboolean specular = (ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR));
if (ctx->RenderMode == GL_RENDER) {
if (ctx->Line.SmoothFlag) {
@ -226,8 +188,7 @@ _swrast_choose_line( struct gl_context *ctx )
ASSERT(swrast->Line);
}
else if (ctx->Texture._EnabledCoord
|| swrast->_FogEnabled
|| specular) {
|| swrast->_FogEnabled) {
USE(general_line);
}
else if (ctx->Depth.Test

View file

@ -153,18 +153,6 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
if (dx == 0 && dy == 0)
return;
/*
printf("%s %d,%d %g %g %g %g %g %g %g %g\n", __FUNCTION__, dx, dy,
vert0->attrib[FRAG_ATTRIB_COL1][0],
vert0->attrib[FRAG_ATTRIB_COL1][1],
vert0->attrib[FRAG_ATTRIB_COL1][2],
vert0->attrib[FRAG_ATTRIB_COL1][3],
vert1->attrib[FRAG_ATTRIB_COL1][0],
vert1->attrib[FRAG_ATTRIB_COL1][1],
vert1->attrib[FRAG_ATTRIB_COL1][2],
vert1->attrib[FRAG_ATTRIB_COL1][3]);
*/
#ifdef DEPTH_TYPE
zPtr = (DEPTH_TYPE *) _swrast_pixel_address(zrb, x0, y0);
#endif

View file

@ -203,7 +203,7 @@ _swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
}
else {
logicop_uint4(ctx, 4 * span->end,
(GLuint *) span->array->attribs[FRAG_ATTRIB_COL0],
(GLuint *) span->array->attribs[FRAG_ATTRIB_COL],
(const GLuint *) rbPixels, span->array->mask);
}
}

View file

@ -82,7 +82,7 @@ _swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
const GLuint bMask = ctx->Color.ColorMask[BCOMP] ? ~0x0 : 0x0;
const GLuint aMask = ctx->Color.ColorMask[ACOMP] ? ~0x0 : 0x0;
const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels;
GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[FRAG_ATTRIB_COL0];
GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[FRAG_ATTRIB_COL];
GLuint i;
for (i = 0; i < n; i++) {
src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask);

View file

@ -486,33 +486,6 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert)
}
/**
* Add specular color to primary color, draw point, restore original
* primary color.
*/
void
_swrast_add_spec_terms_point(struct gl_context *ctx, const SWvertex *v0)
{
SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */
GLfloat rSum, gSum, bSum;
GLchan cSave[4];
/* save */
COPY_CHAN4(cSave, ncv0->color);
/* sum */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
/* draw */
SWRAST_CONTEXT(ctx)->SpecPoint(ctx, ncv0);
/* restore */
COPY_CHAN4(ncv0->color, cSave);
}
/**
* Examine current state to determine which point drawing function to use.
*/

View file

@ -82,17 +82,9 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
span->alphaStep = 0;
span->interpMask |= SPAN_RGBA;
COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor);
ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0);
ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0);
/* Secondary color */
if (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled)
{
COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor);
ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0);
ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0);
}
COPY_4V(span->attrStart[FRAG_ATTRIB_COL], ctx->Current.RasterColor);
ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL], 0.0, 0.0, 0.0, 0.0);
ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL], 0.0, 0.0, 0.0, 0.0);
/* fog */
{
@ -272,7 +264,7 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span)
break;
#endif
case GL_FLOAT:
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
interpolate_active_attribs(ctx, span, FRAG_BIT_COL);
break;
default:
_mesa_problem(ctx, "bad datatype 0x%x in interpolate_int_colors",
@ -283,12 +275,12 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span)
/**
* Populate the FRAG_ATTRIB_COL0 array.
* Populate the FRAG_ATTRIB_COL array.
*/
static inline void
interpolate_float_colors(SWspan *span)
{
GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL];
const GLuint n = span->end;
GLuint i;
@ -337,7 +329,7 @@ interpolate_float_colors(SWspan *span)
}
}
span->arrayAttribs |= FRAG_BIT_COL0;
span->arrayAttribs |= FRAG_BIT_COL;
span->array->ChanType = GL_FLOAT;
}
@ -739,57 +731,6 @@ clip_span( struct gl_context *ctx, SWspan *span )
}
/**
* Add specular colors to primary colors.
* Only called during fixed-function operation.
* Result is float color array (FRAG_ATTRIB_COL0).
*/
static inline void
add_specular(struct gl_context *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLubyte *mask = span->array->mask;
GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*col1)[4] = span->array->attribs[FRAG_ATTRIB_COL1];
GLuint i;
ASSERT(!_swrast_use_fragment_program(ctx));
ASSERT(span->arrayMask & SPAN_RGBA);
ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_COL1);
(void) swrast; /* silence warning */
if (span->array->ChanType == GL_FLOAT) {
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) {
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
}
}
else {
/* need float colors */
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) {
interpolate_float_colors(span);
}
}
if ((span->arrayAttribs & FRAG_BIT_COL1) == 0) {
/* XXX could avoid this and interpolate COL1 in the loop below */
interpolate_active_attribs(ctx, span, FRAG_BIT_COL1);
}
ASSERT(span->arrayAttribs & FRAG_BIT_COL0);
ASSERT(span->arrayAttribs & FRAG_BIT_COL1);
for (i = 0; i < span->end; i++) {
if (mask[i]) {
col0[i][0] += col1[i][0];
col0[i][1] += col1[i][1];
col0[i][2] += col1[i][2];
}
}
span->array->ChanType = GL_FLOAT;
}
/**
* Apply antialiasing coverage value to alpha values.
*/
@ -815,7 +756,7 @@ apply_aa_coverage(SWspan *span)
}
}
else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
for (i = 0; i < span->end; i++) {
rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i];
/* clamp later */
@ -830,7 +771,7 @@ apply_aa_coverage(SWspan *span)
static inline void
clamp_colors(SWspan *span)
{
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
GLuint i;
ASSERT(span->array->ChanType == GL_FLOAT);
for (i = 0; i < span->end; i++) {
@ -854,7 +795,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
GLvoid *src, *dst;
if (output > 0 || span->array->ChanType == GL_FLOAT) {
src = span->array->attribs[FRAG_ATTRIB_COL0 + output];
src = span->array->attribs[FRAG_ATTRIB_COL + output];
span->array->ChanType = GL_FLOAT;
}
else if (span->array->ChanType == GL_UNSIGNED_BYTE) {
@ -872,7 +813,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
dst = span->array->rgba16;
}
else {
dst = span->array->attribs[FRAG_ATTRIB_COL0];
dst = span->array->attribs[FRAG_ATTRIB_COL];
}
_mesa_convert_colors(span->array->ChanType, src,
@ -1140,15 +1081,6 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
ASSERT(span->arrayMask & SPAN_RGBA);
if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) {
/* Add primary and specular (diffuse + specular) colors */
if (ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
add_specular(ctx, span);
}
}
/* Fog */
if (swrast->_FogEnabled) {
_swrast_fog_rgba_span(ctx, span);
@ -1187,7 +1119,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
span->array->rgba = span->array->rgba8;
}
else {
span->array->rgba = (void *)span->array->attribs[FRAG_ATTRIB_COL0];
span->array->rgba = (void *)span->array->attribs[FRAG_ATTRIB_COL];
}
}

View file

@ -867,56 +867,6 @@ nodraw_triangle( struct gl_context *ctx,
}
/*
* This is used when separate specular color is enabled, but not
* texturing. We add the specular color to the primary color,
* draw the triangle, then restore the original primary color.
* Inefficient, but seldom needed.
*/
void
_swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2)
{
SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */
SWvertex *ncv1 = (SWvertex *)v1;
SWvertex *ncv2 = (SWvertex *)v2;
GLfloat rSum, gSum, bSum;
GLchan cSave[3][4];
/* save original colors */
COPY_CHAN4( cSave[0], ncv0->color );
COPY_CHAN4( cSave[1], ncv1->color );
COPY_CHAN4( cSave[2], ncv2->color );
/* sum v0 */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
/* sum v1 */
rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1];
bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum);
/* sum v2 */
rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1];
bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum);
/* draw */
SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 );
/* restore original colors */
COPY_CHAN4( ncv0->color, cSave[0] );
COPY_CHAN4( ncv1->color, cSave[1] );
COPY_CHAN4( ncv2->color, cSave[2] );
}
#ifdef DEBUG
@ -970,7 +920,6 @@ _swrast_choose_triangle( struct gl_context *ctx )
* needs to be interpolated.
*/
if (ctx->Texture._EnabledCoord ||
_mesa_need_secondary_color(ctx) ||
swrast->_FogEnabled) {
/* Ugh, we do a _lot_ of tests to pick the best textured tri func */
const struct gl_texture_object *texObj2D;
@ -999,7 +948,6 @@ _swrast_choose_triangle( struct gl_context *ctx )
&& texImg->Width == swImg->RowStride
&& (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
&& !swrast->_FogEnabled
&& ctx->Texture.Unit.EnvMode != GL_COMBINE_EXT
&& ctx->Texture.Unit.EnvMode != GL_COMBINE4_NV) {

View file

@ -361,32 +361,32 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
GLfloat eMaj_da = (GLfloat) (vMax->color[ACOMP] - vMin->color[ACOMP]);
GLfloat eBot_da = (GLfloat) (vMid->color[ACOMP] - vMin->color[ACOMP]);
# endif
span.attrStepX[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr);
span.attrStepY[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx);
span.attrStepX[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg);
span.attrStepY[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx);
span.attrStepX[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db);
span.attrStepY[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx);
span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][0]);
span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][1]);
span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][2]);
span.attrStepX[FRAG_ATTRIB_COL][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr);
span.attrStepY[FRAG_ATTRIB_COL][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx);
span.attrStepX[FRAG_ATTRIB_COL][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg);
span.attrStepY[FRAG_ATTRIB_COL][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx);
span.attrStepX[FRAG_ATTRIB_COL][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db);
span.attrStepY[FRAG_ATTRIB_COL][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx);
span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][0]);
span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][1]);
span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][2]);
# ifdef INTERP_ALPHA
span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da);
span.attrStepY[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx);
span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][3]);
span.attrStepX[FRAG_ATTRIB_COL][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da);
span.attrStepY[FRAG_ATTRIB_COL][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx);
span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][3]);
# endif /* INTERP_ALPHA */
}
else {
ASSERT(ctx->Light.ShadeModel == GL_FLAT);
span.interpMask |= SPAN_FLAT;
span.attrStepX[FRAG_ATTRIB_COL0][0] = span.attrStepY[FRAG_ATTRIB_COL0][0] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL0][1] = span.attrStepY[FRAG_ATTRIB_COL0][1] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL0][2] = span.attrStepY[FRAG_ATTRIB_COL0][2] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL][0] = span.attrStepY[FRAG_ATTRIB_COL][0] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL][1] = span.attrStepY[FRAG_ATTRIB_COL][1] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL][2] = span.attrStepY[FRAG_ATTRIB_COL][2] = 0.0F;
span.redStep = 0;
span.greenStep = 0;
span.blueStep = 0;
# ifdef INTERP_ALPHA
span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL][3] = span.attrStepY[FRAG_ATTRIB_COL][3] = 0.0F;
span.alphaStep = 0;
# endif
}
@ -636,26 +636,26 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#ifdef INTERP_RGB
if (ctx->Light.ShadeModel == GL_SMOOTH) {
rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) + FIXED_HALF;
+ span.attrStepX[FRAG_ATTRIB_COL][0] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL][0] * adjy) + FIXED_HALF;
gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) + FIXED_HALF;
+ span.attrStepX[FRAG_ATTRIB_COL][1] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL][1] * adjy) + FIXED_HALF;
bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) + FIXED_HALF;
fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][0]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]);
fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][1]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]);
fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][2]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]);
+ span.attrStepX[FRAG_ATTRIB_COL][2] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL][2] * adjy) + FIXED_HALF;
fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][0]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL][0]);
fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][1]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL][1]);
fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][2]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL][2]);
# ifdef INTERP_ALPHA
aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][3] * adjy) + FIXED_HALF;
fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]);
+ span.attrStepX[FRAG_ATTRIB_COL][3] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL][3] * adjy) + FIXED_HALF;
fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][3]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL][3]);
# endif
}
else {

View file

@ -156,7 +156,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT)
zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16;
else
zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL0];
zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL];
COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]);
COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]);
@ -173,7 +173,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
/* we'll generate an array of colorss */
zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
zoomed.arrayMask |= SPAN_RGBA;
zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */
zoomed.arrayAttribs |= FRAG_BIT_COL; /* we'll produce these values */
ASSERT(span->arrayMask & SPAN_RGBA);
}
else if (format == GL_DEPTH_COMPONENT) {
@ -225,7 +225,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
ASSERT(j < span->end);
COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]);
COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL][i], rgba[j]);
}
}
}
@ -263,10 +263,10 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
ASSERT(j < span->end);
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0];
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1];
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2];
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][3] = 1.0F;
zoomed.array->attribs[FRAG_ATTRIB_COL][i][0] = rgb[j][0];
zoomed.array->attribs[FRAG_ATTRIB_COL][i][1] = rgb[j][1];
zoomed.array->attribs[FRAG_ATTRIB_COL][i][2] = rgb[j][2];
zoomed.array->attribs[FRAG_ATTRIB_COL][i][3] = 1.0F;
}
}
}

View file

@ -70,13 +70,13 @@
* primitives unaccelerated), hook in swrast_setup instead.
*/
typedef struct {
GLfloat attrib[32][4];
GLfloat attrib[FRAG_ATTRIB_MAX][4];
GLchan color[4]; /** integer color */
GLfloat pointSize;
} SWvertex;
#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0
#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL
struct swrast_device_driver;

View file

@ -125,15 +125,11 @@ setup_vertex_format(struct gl_context *ctx)
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] );
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR0)) {
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR)) {
if (swsetup->intColors)
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
EMIT_ATTR( _TNL_ATTRIB_COLOR, EMIT_4CHAN_4F_RGBA, color );
else
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]);
}
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) {
EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]);
EMIT_ATTR( _TNL_ATTRIB_COLOR, EMIT_4F, attrib[FRAG_ATTRIB_COL]);
}
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_FOG)) {

View file

@ -130,26 +130,18 @@ static void _swsetup_render_tri(struct gl_context *ctx,
if (ctx->Light.ShadeModel == GL_FLAT) {
GLchan c[2][4];
GLfloat s[2][4];
/* save colors/indexes for v0, v1 vertices */
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]);
COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]);
/* copy v2 color/indexes to v0, v1 indexes */
COPY_CHAN4(v0->color, v2->color);
COPY_CHAN4(v1->color, v2->color);
COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]);
COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]);
render(ctx, ef, e0, e1, e2, v0, v1, v2);
COPY_CHAN4(v0->color, c[0]);
COPY_CHAN4(v1->color, c[1]);
COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]);
COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]);
}
else {
render(ctx, ef, e0, e1, e2, v0, v1, v2);

View file

@ -37,7 +37,6 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
GLchan saved_color[3][4] = { { 0 } };
GLfloat saved_col0[3][4] = { { 0 } };
GLfloat saved_spec[3][4] = { { 0 } };
#endif
SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts;
SWvertex *v[3];
@ -79,9 +78,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
COPY_CHAN4(saved_color[2], v[2]->color);
}
else {
COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]);
COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]);
COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]);
COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL]);
COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL]);
COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL]);
}
if (VB->BackfaceColorPtr->stride) {
@ -91,9 +90,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SS_COLOR(v[2]->color, vbcolor[e2]);
}
else {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]);
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL], vbcolor[e0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL], vbcolor[e1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL], vbcolor[e2]);
}
}
else {
@ -104,31 +103,12 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SS_COLOR(v[2]->color, vbcolor[0]);
}
else {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]);
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL], vbcolor[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL], vbcolor[0]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL], vbcolor[0]);
}
}
}
if (VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]);
COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]);
COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]);
if (VB->BackfaceSecondaryColorPtr->stride) {
SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]);
SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]);
SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]);
}
else {
SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]);
SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]);
SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]);
}
}
}
#endif
}
@ -210,17 +190,11 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
COPY_CHAN4(v[2]->color, saved_color[2]);
}
else {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]);
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL], saved_col0[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL], saved_col0[1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL], saved_col0[2]);
}
}
if (VB->BackfaceSecondaryColorPtr) {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]);
}
}
}
#endif

View file

@ -101,10 +101,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
*/
tnl->render_inputs_bitset = BITFIELD64_BIT(_TNL_ATTRIB_POS);
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR0);
if (_mesa_need_secondary_color(ctx))
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR1);
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR);
if (ctx->Texture._EnabledCoord) {
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX);

View file

@ -79,12 +79,15 @@ enum {
_TNL_ATTRIB_POS = 0,
_TNL_ATTRIB_WEIGHT = 1,
_TNL_ATTRIB_NORMAL = 2,
_TNL_ATTRIB_COLOR0 = 3,
_TNL_ATTRIB_COLOR1 = 4,
_TNL_ATTRIB_FOG = 5,
_TNL_ATTRIB_COLOR_INDEX = 6,
_TNL_ATTRIB_EDGEFLAG = 7,
_TNL_ATTRIB_TEX = 8,
_TNL_ATTRIB_COLOR = 3,
_TNL_ATTRIB_FOG = 4,
_TNL_ATTRIB_COLOR_INDEX = 5,
_TNL_ATTRIB_EDGEFLAG = 6,
_TNL_ATTRIB_TEX = 7,
/* This is really a VERT_RESULT, not an attrib. Need to fix
* tnl to understand the difference.
*/
_TNL_ATTRIB_POINTSIZE = 8,
/* These alias with the generics, but they are not active
* concurrently, so it's not a problem. The TNL module
@ -96,50 +99,29 @@ enum {
* generic attribute in order to pick up per-vertex material
* data.
*/
_TNL_ATTRIB_MAT_FRONT_AMBIENT = 10,
_TNL_ATTRIB_MAT_BACK_AMBIENT = 11,
_TNL_ATTRIB_MAT_FRONT_DIFFUSE = 12,
_TNL_ATTRIB_MAT_BACK_DIFFUSE = 13,
_TNL_ATTRIB_MAT_FRONT_SPECULAR = 14,
_TNL_ATTRIB_MAT_BACK_SPECULAR = 15,
_TNL_ATTRIB_MAT_FRONT_EMISSION = 16,
_TNL_ATTRIB_MAT_BACK_EMISSION = 17,
_TNL_ATTRIB_MAT_FRONT_SHININESS = 18,
_TNL_ATTRIB_MAT_BACK_SHININESS = 19,
_TNL_ATTRIB_MAT_FRONT_INDEXES = 20,
_TNL_ATTRIB_MAT_BACK_INDEXES = 21,
_TNL_ATTRIB_MAT_FRONT_AMBIENT = 9,
_TNL_ATTRIB_MAT_BACK_AMBIENT = 10,
_TNL_ATTRIB_MAT_FRONT_DIFFUSE = 11,
_TNL_ATTRIB_MAT_BACK_DIFFUSE = 12,
_TNL_ATTRIB_MAT_FRONT_SPECULAR = 13,
_TNL_ATTRIB_MAT_BACK_SPECULAR = 14,
_TNL_ATTRIB_MAT_FRONT_EMISSION = 15,
_TNL_ATTRIB_MAT_BACK_EMISSION = 16,
_TNL_ATTRIB_MAT_FRONT_SHININESS = 17,
_TNL_ATTRIB_MAT_BACK_SHININESS = 18,
_TNL_ATTRIB_MAT_FRONT_INDEXES = 29,
_TNL_ATTRIB_MAT_BACK_INDEXES = 20,
/* This is really a VERT_RESULT, not an attrib. Need to fix
* tnl to understand the difference.
*/
_TNL_ATTRIB_POINTSIZE = 9,
_TNL_ATTRIB_MAX = 22
_TNL_ATTRIB_MAX = 21
} ;
#define _TNL_ATTRIB_GENERIC(n) (_TNL_ATTRIB_GENERIC0 + (n))
/* special index used for handing invalid glVertexAttribute() indices */
#define _TNL_ATTRIB_ERROR (_TNL_ATTRIB_GENERIC15 + 1)
/**
* Handy attribute ranges:
*/
#define _TNL_FIRST_PROG _TNL_ATTRIB_WEIGHT
#define _TNL_LAST_PROG _TNL_ATTRIB_TEX
#define _TNL_FIRST_MAT _TNL_ATTRIB_MAT_FRONT_AMBIENT
#define _TNL_LAST_MAT _TNL_ATTRIB_MAT_BACK_INDEXES
/* Number of available texture attributes */
#define _TNL_NUM_TEX 8
/* Number of available generic attributes */
#define _TNL_NUM_GENERIC 16
/* Number of attributes used for evaluators */
#define _TNL_NUM_EVAL 16
#define PRIM_BEGIN 0x10
#define PRIM_END 0x20
@ -184,7 +166,6 @@ struct vertex_buffer
GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */
GLvector4f *BackfaceIndexPtr;
GLvector4f *BackfaceColorPtr;
GLvector4f *BackfaceSecondaryColorPtr;
const struct _mesa_prim *Primitive;
GLuint PrimitiveCount;

View file

@ -250,7 +250,6 @@ static void bind_inputs( struct gl_context *ctx,
/* These should perhaps be part of _TNL_ATTRIB_* */
VB->BackfaceColorPtr = NULL;
VB->BackfaceIndexPtr = NULL;
VB->BackfaceSecondaryColorPtr = NULL;
/* Clipping and drawing code still requires this to be a packed
* array of ubytes which can be written into. TODO: Fix and

View file

@ -104,8 +104,7 @@ static void
shade_rastpos(struct gl_context *ctx,
const GLfloat vertex[4],
const GLfloat normal[3],
GLfloat Rcolor[4],
GLfloat Rspec[4])
GLfloat Rcolor[4])
{
/*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor;
const struct gl_light *light;
@ -209,14 +208,8 @@ shade_rastpos(struct gl_context *ctx,
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef );
if (spec_coef > 1.0e-10) {
if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
ACC_SCALE_SCALAR_3V( specularContrib, spec_coef,
ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef,
light->_MatSpecular[0]);
}
else {
ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef,
light->_MatSpecular[0]);
}
}
}
}
@ -229,10 +222,6 @@ shade_rastpos(struct gl_context *ctx,
Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F);
Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F);
Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F);
Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F);
Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F);
Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F);
Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F);
}
@ -421,15 +410,12 @@ _tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4])
if (ctx->Light.Enabled) {
/* lighting */
shade_rastpos( ctx, vObj, norm,
ctx->Current.RasterColor,
ctx->Current.RasterSecondaryColor );
ctx->Current.RasterColor );
}
else {
/* use current color */
COPY_4FV(ctx->Current.RasterColor,
ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
COPY_4FV(ctx->Current.RasterSecondaryColor,
ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
ctx->Current.Attrib[VERT_ATTRIB_COLOR]);
}
/* texture coords */

View file

@ -50,7 +50,6 @@ struct material_cursor {
struct light_stage_data {
GLvector4f Input;
GLvector4f LitColor[2];
GLvector4f LitSecondary[2];
light_func *light_func_tab;
struct material_cursor mat[MAT_ATTRIB_MAX];
@ -113,7 +112,7 @@ prepare_materials(struct gl_context *ctx,
const GLuint bitmask = ctx->Light.ColorMaterialBitmask;
for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
if (bitmask & (1<<i))
VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR];
}
/* Now, for each material attribute that's tracking vertex color, save
@ -246,9 +245,6 @@ static void validate_lighting( struct gl_context *ctx,
return;
if (ctx->Light._NeedVertices) {
if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
tab = _tnl_light_spec_tab;
else
tab = _tnl_light_tab;
}
else {
@ -290,13 +286,9 @@ static GLboolean init_lighting( struct gl_context *ctx,
_mesa_vector4f_alloc( &store->Input, 0, size, 32 );
_mesa_vector4f_alloc( &store->LitColor[0], 0, size, 32 );
_mesa_vector4f_alloc( &store->LitColor[1], 0, size, 32 );
_mesa_vector4f_alloc( &store->LitSecondary[0], 0, size, 32 );
_mesa_vector4f_alloc( &store->LitSecondary[1], 0, size, 32 );
store->LitColor[0].size = 4;
store->LitColor[1].size = 4;
store->LitSecondary[0].size = 3;
store->LitSecondary[1].size = 3;
return GL_TRUE;
}
@ -312,8 +304,6 @@ static void dtr( struct tnl_pipeline_stage *stage )
_mesa_vector4f_free( &store->Input );
_mesa_vector4f_free( &store->LitColor[0] );
_mesa_vector4f_free( &store->LitColor[1] );
_mesa_vector4f_free( &store->LitSecondary[0] );
_mesa_vector4f_free( &store->LitSecondary[1] );
FREE( store );
stage->privatePtr = NULL;
}

View file

@ -28,13 +28,6 @@
*/
#if IDX & LIGHT_TWOSIDE
# define NR_SIDES 2
#else
# define NR_SIDES 1
#endif
/* define TRACE to trace lighting code */
/* #define TRACE 1 */
@ -60,10 +53,8 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx,
const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
GLfloat (*Fspec)[4] = (GLfloat (*)[4]) store->LitSecondary[0].data;
#if IDX & LIGHT_TWOSIDE
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
GLfloat (*Bspec)[4] = (GLfloat (*)[4]) store->LitSecondary[1].data;
#endif
const GLuint nr = VB->Count;
@ -72,13 +63,11 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx,
fprintf(stderr, "%s\n", __FUNCTION__ );
#endif
VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->LitSecondary[0];
VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0];
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
#if IDX & LIGHT_TWOSIDE
VB->BackfaceColorPtr = &store->LitColor[1];
VB->BackfaceSecondaryColorPtr = &store->LitSecondary[1];
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
#endif
@ -220,12 +209,10 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx,
} /*loop over lights*/
COPY_3V( Fcolor[j], sum[0] );
COPY_3V( Fspec[j], spec[0] );
Fcolor[j][3] = sumA[0];
#if IDX & LIGHT_TWOSIDE
COPY_3V( Bcolor[j], sum[1] );
COPY_3V( Bspec[j], spec[1] );
Bcolor[j][3] = sumA[1];
#endif
}
@ -259,7 +246,7 @@ static void TAG(light_rgba)( struct gl_context *ctx,
fprintf(stderr, "%s\n", __FUNCTION__ );
#endif
VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0];
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
#if IDX & LIGHT_TWOSIDE
@ -449,7 +436,7 @@ static void TAG(light_fast_rgba_single)( struct gl_context *ctx,
(void) input; /* doesn't refer to Eye or Obj */
VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0];
#if IDX & LIGHT_TWOSIDE
VB->BackfaceColorPtr = &store->LitColor[1];
#endif
@ -559,7 +546,7 @@ static void TAG(light_fast_rgba)( struct gl_context *ctx,
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0];
#if IDX & LIGHT_TWOSIDE
VB->BackfaceColorPtr = &store->LitColor[1];
#endif
@ -648,4 +635,3 @@ static void TAG(init_light_tab)( void )
#undef TAG
#undef IDX
#undef NR_SIDES

View file

@ -1065,8 +1065,7 @@ void _tnl_generic_copy_pv( struct gl_context *ctx, GLuint edst, GLuint esrc )
GLuint j;
for (j = 0; j < attr_count; j++) {
if (a[j].attrib == VERT_ATTRIB_COLOR0 ||
a[j].attrib == VERT_ATTRIB_COLOR1) {
if (a[j].attrib == VERT_ATTRIB_COLOR) {
memcpy( vdst + a[j].vertoffset,
vsrc + a[j].vertoffset,
@ -1099,15 +1098,6 @@ void _tnl_generic_interp_extras( struct gl_context *ctx,
VB->BackfaceColorPtr->data[out],
VB->BackfaceColorPtr->data[in] );
}
if (VB->BackfaceSecondaryColorPtr) {
assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat));
INTERP_3F( t,
VB->BackfaceSecondaryColorPtr->data[dst],
VB->BackfaceSecondaryColorPtr->data[out],
VB->BackfaceSecondaryColorPtr->data[in] );
}
if (VB->BackfaceIndexPtr) {
VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t,
@ -1134,11 +1124,6 @@ void _tnl_generic_copy_pv_extras( struct gl_context *ctx,
VB->BackfaceColorPtr->data[src] );
}
if (VB->BackfaceSecondaryColorPtr) {
COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst],
VB->BackfaceSecondaryColorPtr->data[src] );
}
if (VB->BackfaceIndexPtr) {
VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0];
}

View file

@ -47,28 +47,27 @@ enum {
VBO_ATTRIB_POS = 0,
VBO_ATTRIB_WEIGHT = 1,
VBO_ATTRIB_NORMAL = 2,
VBO_ATTRIB_COLOR0 = 3,
VBO_ATTRIB_COLOR1 = 4,
VBO_ATTRIB_FOG = 5,
VBO_ATTRIB_INDEX = 6,
VBO_ATTRIB_EDGEFLAG = 7,
VBO_ATTRIB_TEX = 8,
VBO_ATTRIB_POINT_SIZE = 9,
VBO_ATTRIB_COLOR = 3,
VBO_ATTRIB_FOG = 4,
VBO_ATTRIB_INDEX = 5,
VBO_ATTRIB_EDGEFLAG = 6,
VBO_ATTRIB_TEX = 7,
VBO_ATTRIB_POINT_SIZE = 8,
VBO_ATTRIB_MAT_FRONT_AMBIENT = 10,
VBO_ATTRIB_MAT_BACK_AMBIENT = 11,
VBO_ATTRIB_MAT_FRONT_DIFFUSE = 12,
VBO_ATTRIB_MAT_BACK_DIFFUSE = 13,
VBO_ATTRIB_MAT_FRONT_SPECULAR = 14,
VBO_ATTRIB_MAT_BACK_SPECULAR = 15,
VBO_ATTRIB_MAT_FRONT_EMISSION = 16,
VBO_ATTRIB_MAT_BACK_EMISSION = 17,
VBO_ATTRIB_MAT_FRONT_SHININESS = 18,
VBO_ATTRIB_MAT_BACK_SHININESS = 19,
VBO_ATTRIB_MAT_FRONT_INDEXES = 20,
VBO_ATTRIB_MAT_BACK_INDEXES = 21,
VBO_ATTRIB_MAT_FRONT_AMBIENT = 9,
VBO_ATTRIB_MAT_BACK_AMBIENT = 10,
VBO_ATTRIB_MAT_FRONT_DIFFUSE = 11,
VBO_ATTRIB_MAT_BACK_DIFFUSE = 12,
VBO_ATTRIB_MAT_FRONT_SPECULAR = 13,
VBO_ATTRIB_MAT_BACK_SPECULAR = 14,
VBO_ATTRIB_MAT_FRONT_EMISSION = 15,
VBO_ATTRIB_MAT_BACK_EMISSION = 16,
VBO_ATTRIB_MAT_FRONT_SHININESS = 17,
VBO_ATTRIB_MAT_BACK_SHININESS = 18,
VBO_ATTRIB_MAT_FRONT_INDEXES = 19,
VBO_ATTRIB_MAT_BACK_INDEXES = 20,
VBO_ATTRIB_MAX = 22
VBO_ATTRIB_MAX = 21
};
#define VBO_ATTRIB_FIRST_MATERIAL VBO_ATTRIB_MAT_FRONT_AMBIENT

View file

@ -197,44 +197,28 @@ static void GLAPIENTRY
TAG(Color3f)(GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
ATTR3F(VBO_ATTRIB_COLOR0, x, y, z);
ATTR3F(VBO_ATTRIB_COLOR, x, y, z);
}
static void GLAPIENTRY
TAG(Color3fv)(const GLfloat * v)
{
GET_CURRENT_CONTEXT(ctx);
ATTR3FV(VBO_ATTRIB_COLOR0, v);
ATTR3FV(VBO_ATTRIB_COLOR, v);
}
static void GLAPIENTRY
TAG(Color4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
ATTR4F(VBO_ATTRIB_COLOR0, x, y, z, w);
ATTR4F(VBO_ATTRIB_COLOR, x, y, z, w);
}
static void GLAPIENTRY
TAG(Color4fv)(const GLfloat * v)
{
GET_CURRENT_CONTEXT(ctx);
ATTR4FV(VBO_ATTRIB_COLOR0, v);
}
static void GLAPIENTRY
TAG(SecondaryColor3fEXT)(GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
ATTR3F(VBO_ATTRIB_COLOR1, x, y, z);
}
static void GLAPIENTRY
TAG(SecondaryColor3fvEXT)(const GLfloat * v)
{
GET_CURRENT_CONTEXT(ctx);
ATTR3FV(VBO_ATTRIB_COLOR1, v);
ATTR4FV(VBO_ATTRIB_COLOR, v);
}

View file

@ -171,9 +171,9 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
/* Colormaterial -- this kindof sucks.
*/
if (ctx->Light.ColorMaterialEnabled &&
exec->vtx.attrsz[VBO_ATTRIB_COLOR0]) {
exec->vtx.attrsz[VBO_ATTRIB_COLOR]) {
_mesa_update_color_material(ctx,
ctx->Current.Attrib[VBO_ATTRIB_COLOR0]);
ctx->Current.Attrib[VBO_ATTRIB_COLOR]);
}
}
@ -871,8 +871,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
vfmt->FogCoordfvEXT = vbo_FogCoordfvEXT;
vfmt->Normal3f = vbo_Normal3f;
vfmt->Normal3fv = vbo_Normal3fv;
vfmt->SecondaryColor3fEXT = vbo_SecondaryColor3fEXT;
vfmt->SecondaryColor3fvEXT = vbo_SecondaryColor3fvEXT;
vfmt->TexCoord1f = vbo_TexCoord1f;
vfmt->TexCoord1fv = vbo_TexCoord1fv;
vfmt->TexCoord2f = vbo_TexCoord2f;
@ -927,8 +925,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
(void) vbo_MultiTexCoord4fv;
(void) vbo_Normal3f;
(void) vbo_Normal3fv;
(void) vbo_SecondaryColor3fEXT;
(void) vbo_SecondaryColor3fvEXT;
(void) vbo_TexCoord1f;
(void) vbo_TexCoord1fv;
(void) vbo_TexCoord2f;
@ -1168,4 +1164,4 @@ static void reset_attrfv( struct vbo_exec_context *exec )
}
exec->vtx.vertex_size = 0;
}
}

View file

@ -154,121 +154,6 @@ vbo_get_minmax_index(struct gl_context *ctx,
}
/**
* Check that element 'j' of the array has reasonable data.
* Map VBO if needed.
* For debugging purposes; not normally used.
*/
static void
check_array_data(struct gl_context *ctx, struct gl_client_array *array,
GLuint attrib, GLuint j)
{
if (array->Enabled) {
const void *data = array->Ptr;
if (_mesa_is_bufferobj(array->BufferObj)) {
if (!array->BufferObj->Pointer) {
/* need to map now */
array->BufferObj->Pointer =
ctx->Driver.MapBufferRange(ctx, 0, array->BufferObj->Size,
GL_MAP_READ_BIT, array->BufferObj);
}
data = ADD_POINTERS(data, array->BufferObj->Pointer);
}
switch (array->Type) {
case GL_FLOAT:
{
GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j);
GLint k;
for (k = 0; k < array->Size; k++) {
if (IS_INF_OR_NAN(f[k]) ||
f[k] >= 1.0e20 || f[k] <= -1.0e10) {
printf("Bad array data:\n");
printf(" Element[%u].%u = %f\n", j, k, f[k]);
printf(" Array %u at %p\n", attrib, (void* ) array);
printf(" Type 0x%x, Size %d, Stride %d\n",
array->Type, array->Size, array->Stride);
printf(" Address/offset %p in Buffer Object %u\n",
array->Ptr, array->BufferObj->Name);
f[k] = 1.0; /* XXX replace the bad value! */
}
/*assert(!IS_INF_OR_NAN(f[k]));*/
}
}
break;
default:
;
}
}
}
/**
* Unmap the buffer object referenced by given array, if mapped.
*/
static void
unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array)
{
if (array->Enabled &&
_mesa_is_bufferobj(array->BufferObj) &&
_mesa_bufferobj_mapped(array->BufferObj)) {
ctx->Driver.UnmapBuffer(ctx, array->BufferObj);
}
}
/**
* Examine the array's data for NaNs, etc.
* For debug purposes; not normally used.
*/
static void
check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
const void *elements, GLint basevertex)
{
const void *elemMap;
GLint i, k;
if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
elemMap = ctx->Driver.MapBufferRange(ctx, 0,
ctx->Array.ElementArrayBufferObj->Size,
GL_MAP_READ_BIT,
ctx->Array.ElementArrayBufferObj);
elements = ADD_POINTERS(elements, elemMap);
}
for (i = 0; i < count; i++) {
GLuint j;
/* j = element[i] */
switch (elemType) {
case GL_UNSIGNED_BYTE:
j = ((const GLubyte *) elements)[i];
break;
case GL_UNSIGNED_SHORT:
j = ((const GLushort *) elements)[i];
break;
case GL_UNSIGNED_INT:
j = ((const GLuint *) elements)[i];
break;
default:
assert(0);
}
/* check element j of each enabled array */
for (k = 0; k < Elements(ctx->Array.VertexAttrib); k++) {
check_array_data(ctx, &ctx->Array.VertexAttrib[k], k, j);
}
}
if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
ctx->Driver.UnmapBuffer(ctx, ctx->Array.ElementArrayBufferObj);
}
for (k = 0; k < Elements(ctx->Array.VertexAttrib); k++) {
unmap_array_buffer(ctx, &ctx->Array.VertexAttrib[k]);
}
}
/**
* Check array data, looking for NaNs, etc.
*/
@ -593,82 +478,6 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
index_bounds_valid, start, end );
}
/**
* Called by glDrawRangeElements() in immediate mode.
*/
static void GLAPIENTRY
vbo_exec_DrawRangeElements(GLenum mode,
GLuint start, GLuint end,
GLsizei count, GLenum type,
const GLvoid *indices)
{
static GLuint warnCount = 0;
GLboolean index_bounds_valid = GL_TRUE;
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx,
"glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
_mesa_lookup_enum_by_nr(mode), start, end, count,
_mesa_lookup_enum_by_nr(type), indices);
if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
type, indices ))
return;
if (end < start ||
end >= ctx->Array._MaxElement) {
/* The application requested we draw using a range of indices that's
* outside the bounds of the current VBO. This is invalid and appears
* to give undefined results. The safest thing to do is to simply
* ignore the range, in case the application botched their range tracking
* but did provide valid indices. Also issue a warning indicating that
* the application is broken.
*/
if (warnCount++ < 10) {
_mesa_warning(ctx, "glDrawRangeElements(start %u, end %u, "
"count %d, type 0x%x, indices=%p):\n"
"\trange is outside VBO bounds (max=%u); ignoring.\n"
"\tThis should be fixed in the application.",
start, end, count, type, indices,
ctx->Array._MaxElement - 1);
}
index_bounds_valid = GL_FALSE;
}
/* NOTE: It's important that 'end' is a reasonable value.
* in _tnl_draw_prims(), we use end to determine how many vertices
* to transform. If it's too large, we can unnecessarily split prims
* or we can read/write out of memory in several different places!
*/
/* Catch/fix some potential user errors */
if (type == GL_UNSIGNED_BYTE) {
start = MIN2(start, 0xff);
end = MIN2(end, 0xff);
}
else if (type == GL_UNSIGNED_SHORT) {
start = MIN2(start, 0xffff);
end = MIN2(end, 0xffff);
}
if (0) {
printf("glDraw[Range]Elements"
"(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n",
start, end, type, count,
ctx->Array.ElementArrayBufferObj->Name);
}
#if 0
check_draw_elements_data(ctx, count, type, indices);
#else
(void) check_draw_elements_data;
#endif
vbo_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end,
count, type, indices, 1);
}
/**
* Called by glDrawElements() in immediate mode.
@ -701,7 +510,6 @@ vbo_exec_array_init( struct vbo_exec_context *exec )
{
exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays;
exec->vtxfmt.DrawElements = vbo_exec_DrawElements;
exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements;
}
@ -733,11 +541,3 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
vbo_exec_DrawElements(mode, count, type, indices);
}
void GLAPIENTRY
_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
GLenum type, const GLvoid *indices)
{
vbo_exec_DrawRangeElements(mode, start, end, count, type, indices);
}

View file

@ -72,10 +72,10 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec )
}
if (ctx->Eval.Map1Color4)
set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 );
set_active_eval1( exec, VBO_ATTRIB_COLOR, 4, &ctx->EvalMap.Map1Color4 );
if (ctx->Eval.Map2Color4)
set_active_eval2( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map2Color4 );
set_active_eval2( exec, VBO_ATTRIB_COLOR, 4, &ctx->EvalMap.Map2Color4 );
if (ctx->Eval.Map1TextureCoord4)
set_active_eval1( exec, VBO_ATTRIB_TEX, 4, &ctx->EvalMap.Map1Texture4 );

View file

@ -87,16 +87,6 @@ _mesa_noop_Color3fv(const GLfloat * v)
{
}
static void GLAPIENTRY
_mesa_noop_SecondaryColor3fEXT(GLfloat a, GLfloat b, GLfloat c)
{
}
static void GLAPIENTRY
_mesa_noop_SecondaryColor3fvEXT(const GLfloat * v)
{
}
static void GLAPIENTRY
_mesa_noop_TexCoord1f(GLfloat a)
{
@ -275,15 +265,6 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
{
}
static void GLAPIENTRY
_mesa_noop_DrawRangeElements(GLenum mode,
GLuint start, GLuint end,
GLsizei count, GLenum type,
const GLvoid * indices)
{
}
static void GLAPIENTRY
_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2)
{
@ -325,8 +306,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt)
vfmt->Materialfv = _mesa_noop_Materialfv;
vfmt->Normal3f = _mesa_noop_Normal3f;
vfmt->Normal3fv = _mesa_noop_Normal3fv;
vfmt->SecondaryColor3fEXT = _mesa_noop_SecondaryColor3fEXT;
vfmt->SecondaryColor3fvEXT = _mesa_noop_SecondaryColor3fvEXT;
vfmt->TexCoord1f = _mesa_noop_TexCoord1f;
vfmt->TexCoord1fv = _mesa_noop_TexCoord1fv;
vfmt->TexCoord2f = _mesa_noop_TexCoord2f;
@ -354,7 +333,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt)
vfmt->DrawArrays = _mesa_noop_DrawArrays;
vfmt->DrawElements = _mesa_noop_DrawElements;
vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements;
}

View file

@ -950,21 +950,6 @@ _save_DrawElements(GLenum mode, GLsizei count, GLenum type,
}
static void GLAPIENTRY
_save_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
GLsizei count, GLenum type, const GLvoid * indices)
{
GET_CURRENT_CONTEXT(ctx);
(void) mode;
(void) start;
(void) end;
(void) count;
(void) type;
(void) indices;
_mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements");
}
static void GLAPIENTRY
_save_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
@ -1114,25 +1099,6 @@ _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type,
}
static void GLAPIENTRY
_save_OBE_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
GLsizei count, GLenum type,
const GLvoid * indices)
{
GET_CURRENT_CONTEXT(ctx);
struct vbo_save_context *save = &vbo_context(ctx)->save;
if (!_mesa_validate_DrawRangeElements(ctx, mode,
start, end, count, type, indices))
return;
if (save->out_of_memory)
return;
_save_OBE_DrawElements(mode, count, type, indices);
}
static void
_save_vtxfmt_init(struct gl_context *ctx)
{
@ -1155,8 +1121,6 @@ _save_vtxfmt_init(struct gl_context *ctx)
vfmt->Materialfv = _save_Materialfv;
vfmt->Normal3f = _save_Normal3f;
vfmt->Normal3fv = _save_Normal3fv;
vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT;
vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT;
vfmt->TexCoord1f = _save_TexCoord1f;
vfmt->TexCoord1fv = _save_TexCoord1fv;
vfmt->TexCoord2f = _save_TexCoord2f;
@ -1194,7 +1158,6 @@ _save_vtxfmt_init(struct gl_context *ctx)
vfmt->Rectf = _save_Rectf;
vfmt->DrawArrays = _save_DrawArrays;
vfmt->DrawElements = _save_DrawElements;
vfmt->DrawRangeElements = _save_DrawRangeElements;
}
@ -1395,7 +1358,6 @@ vbo_save_api_init(struct vbo_save_context *save)
ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf;
ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays;
ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements;
ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
_mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt);
}

View file

@ -96,7 +96,7 @@ _playback_copy_to_current(struct gl_context *ctx,
/* Colormaterial -- this kindof sucks.
*/
if (ctx->Light.ColorMaterialEnabled) {
_mesa_update_color_material(ctx, ctx->Current.Attrib[VBO_ATTRIB_COLOR0]);
_mesa_update_color_material(ctx, ctx->Current.Attrib[VBO_ATTRIB_COLOR]);
}
/* CurrentExecPrimitive

View file

@ -229,7 +229,6 @@ int main( int argc, char **argv )
OFFSET( "LIGHT_MODEL_AMBIENT ", struct gl_lightmodel, Ambient );
OFFSET( "LIGHT_MODEL_LOCAL_VIEWER ", struct gl_lightmodel, LocalViewer );
OFFSET( "LIGHT_MODEL_TWO_SIDE ", struct gl_lightmodel, TwoSide );
OFFSET( "LIGHT_MODEL_COLOR_CONTROL ", struct gl_lightmodel, ColorControl );
printf( "\n" );

View file

@ -41,16 +41,6 @@ _mesa_mmx_blend_add( struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *rgba, const GLvoid *dest,
GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_min( struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *rgba, const GLvoid *dest,
GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_max( struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *rgba, const GLvoid *dest,
GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_modulate( struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *rgba, const GLvoid *dest,

View file

@ -304,70 +304,6 @@ TWO(MOVQ ( MM1, REGIND(rgba) ))
#include "mmx_blendtmp.h"
/* Blend min function
*/
#define TAG(x) CONCAT(x,_min)
#define LLTAG(x) LLBL2(x,_min)
/* Kevin F. Quinn 2nd July 2006
* Replace data segment constants with text-segment instructions
#define INIT \
MOVQ ( CONTENT(const_80), MM7 )
*/
#define INIT \
PUSH_L ( CONST(const_80_h) ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ ;\
PUSH_L ( CONST(const_80_l) ) ;\
MOVQ ( REGIND(ESP), MM7 ) ;\
ADD_L ( CONST(8), ESP)
#define MAIN( rgba, dest ) \
GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
MOVQ ( MM1, MM3 ) ;\
MOVQ ( MM2, MM4 ) ;\
PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\
PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\
PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\
PAND ( MM4, MM1 ) /* q > p ? p : 0 */ ;\
PANDN ( MM2, MM4 ) /* q > p ? 0 : q */ ;\
POR ( MM1, MM4 ) /* q > p ? p : q */ ;\
GMB_STORE( rgba, MM4 )
#include "mmx_blendtmp.h"
/* Blend max function
*/
#define TAG(x) CONCAT(x,_max)
#define LLTAG(x) LLBL2(x,_max)
/* Kevin F. Quinn 2nd July 2006
* Replace data segment constants with text-segment instructions
#define INIT \
MOVQ ( CONTENT(const_80), MM7 )
*/
#define INIT \
PUSH_L ( CONST(const_80_l) ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ ;\
PUSH_L ( CONST(const_80_h) ) ;\
MOVQ ( REGIND(ESP), MM7 ) ;\
ADD_L ( CONST(8), ESP)
#define MAIN( rgba, dest ) \
GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
MOVQ ( MM1, MM3 ) ;\
MOVQ ( MM2, MM4 ) ;\
PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\
PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\
PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\
PAND ( MM4, MM2 ) /* q > p ? q : 0 */ ;\
PANDN ( MM1, MM4 ) /* q > p ? 0 : p */ ;\
POR ( MM2, MM4 ) /* q > p ? p : q */ ;\
GMB_STORE( rgba, MM4 )
#include "mmx_blendtmp.h"
/* Blend modulate function
*/