summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralanh <alanh>2003-12-03 11:54:32 +0000
committeralanh <alanh>2003-12-03 11:54:32 +0000
commit0c01ccebb6639238af92d83bbedb89e6c64f196b (patch)
tree63736b0ed85a2119e2e3673d7dcb336f9ca70c05
parent894004ce81b582093e5022df7c84be4f2e5d9ccb (diff)
changes from XFree86 CVS.
XFree86 bug: Reported by: Submitted by: Reviewed by: Obtained from:
-rw-r--r--xc/extras/Mesa/include/GL/glxext.h12
-rw-r--r--xc/extras/Mesa/src/OSmesa/osmesa.c4
-rw-r--r--xc/extras/Mesa/src/X/fakeglx.c7
-rw-r--r--xc/extras/Mesa/src/X/xm_api.c4
-rw-r--r--xc/extras/Mesa/src/X/xm_dd.c4
-rw-r--r--xc/extras/Mesa/src/X86/assyntax.h11
-rw-r--r--xc/extras/Mesa/src/X86/mmx_blend.S15
-rw-r--r--xc/extras/Mesa/src/X86/mmx_blendtmp.h31
-rw-r--r--xc/extras/Mesa/src/api_validate.c7
-rw-r--r--xc/extras/Mesa/src/convolve.c14
-rw-r--r--xc/extras/Mesa/src/extensions.c2
-rw-r--r--xc/extras/Mesa/src/mmath.c3
-rw-r--r--xc/extras/Mesa/src/swrast/s_drawpix.c6
-rw-r--r--xc/extras/Mesa/src/swrast/s_pointtemp.h10
-rw-r--r--xc/extras/Mesa/src/texcompress.c27
-rw-r--r--xc/extras/Mesa/src/teximage.c14
-rw-r--r--xc/extras/Mesa/src/texstore.c9
-rw-r--r--xc/extras/Mesa/src/texutil_tmp.h20
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_api.h3
-rw-r--r--xc/extras/Mesa/src/tnl/t_pipeline.c6
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_lighttmp.h296
-rw-r--r--xc/extras/Mesa/src/vpparse.c2
22 files changed, 264 insertions, 243 deletions
diff --git a/xc/extras/Mesa/include/GL/glxext.h b/xc/extras/Mesa/include/GL/glxext.h
index a99c7e33a..057e810e5 100644
--- a/xc/extras/Mesa/include/GL/glxext.h
+++ b/xc/extras/Mesa/include/GL/glxext.h
@@ -315,6 +315,11 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
+#ifdef __UNIXOS2__
+typedef long int int32_t;
+typedef long long int int64_t;
+#endif
+
#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
#ifdef GLX_GLXEXT_PROTOTYPES
@@ -597,11 +602,6 @@ typedef GLint ( * PFNGLXGETSWAPINTERVALMESAPROC) ( void );
#define GLX_OML_swap_method 1
#endif
-#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
- defined(_STDINT_H) || defined(_SYS_INTTYPES_H_) || defined(_INTTYPES_H_)
-/* Include ISO C99 integer types for OML_sync_control; need a better test */
-#include <inttypes.h>
-
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
@@ -632,8 +632,6 @@ typedef GLint ( * PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawab
typedef GLint ( * PFNGLXQUERYFRAMETRACKINGMESAPROC) (Display *dpy, GLXDrawable drawable, int64_t *sbc, int64_t *missedFrames, GLfloat *lastMissedUsage);
#endif
-#endif /* C99 version test */
-
#ifdef __cplusplus
}
#endif
diff --git a/xc/extras/Mesa/src/OSmesa/osmesa.c b/xc/extras/Mesa/src/OSmesa/osmesa.c
index 02303cd73..748eab2c7 100644
--- a/xc/extras/Mesa/src/OSmesa/osmesa.c
+++ b/xc/extras/Mesa/src/OSmesa/osmesa.c
@@ -1230,7 +1230,7 @@ write_rgba_pixels_RGB( const GLcontext *ctx, GLuint n,
const GLint x[], const GLint y[],
CONST GLchan rgba[][4], const GLubyte mask[] )
{
- const OSMesaContext osmesa = (const OSMesaContext) ctx;
+ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
GLuint i;
for (i = 0; i < n; i++) {
if (mask[i]) {
@@ -1245,7 +1245,7 @@ write_rgba_pixels_BGR( const GLcontext *ctx, GLuint n,
const GLint x[], const GLint y[],
CONST GLchan rgba[][4], const GLubyte mask[] )
{
- const OSMesaContext osmesa = (const OSMesaContext) ctx;
+ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
GLuint i;
for (i = 0; i < n; i++) {
if (mask[i]) {
diff --git a/xc/extras/Mesa/src/X/fakeglx.c b/xc/extras/Mesa/src/X/fakeglx.c
index 719c9f694..ca2bd76a1 100644
--- a/xc/extras/Mesa/src/X/fakeglx.c
+++ b/xc/extras/Mesa/src/X/fakeglx.c
@@ -1051,6 +1051,7 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list )
case GLX_VISUAL_CAVEAT_EXT:
parselist++;
caveat = *parselist++; /* ignored for now */
+ (void) caveat;
break;
/*
@@ -1990,7 +1991,6 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
XMesaBuffer xmbuf;
const int *attrib;
int width = 0, height = 0;
- GLboolean useLargest = GL_FALSE, preserveContents = GL_FALSE;
(void) dpy;
@@ -2006,11 +2006,9 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
break;
case GLX_PRESERVED_CONTENTS:
attrib++;
- preserveContents = *attrib; /* ignored */
break;
case GLX_LARGEST_PBUFFER:
attrib++;
- useLargest = *attrib; /* ignored */
break;
default:
return 0;
@@ -2352,7 +2350,6 @@ Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config,
XMesaVisual xmvis = (XMesaVisual) config;
XMesaBuffer xmbuf;
const int *attrib;
- GLboolean useLargest = GL_FALSE, preserveContents = GL_FALSE;
(void) dpy;
@@ -2360,11 +2357,9 @@ Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config,
switch (*attrib) {
case GLX_PRESERVED_CONTENTS_SGIX:
attrib++;
- preserveContents = *attrib; /* ignored */
break;
case GLX_LARGEST_PBUFFER_SGIX:
attrib++;
- useLargest = *attrib; /* ignored */
break;
default:
return 0;
diff --git a/xc/extras/Mesa/src/X/xm_api.c b/xc/extras/Mesa/src/X/xm_api.c
index f7c4dd282..09f4e968b 100644
--- a/xc/extras/Mesa/src/X/xm_api.c
+++ b/xc/extras/Mesa/src/X/xm_api.c
@@ -174,7 +174,7 @@ static int host_byte_order( void )
* Error handling.
*/
#ifndef XFree86Server
-static int mesaXErrorFlag = 0;
+static volatile int mesaXErrorFlag = 0;
static int mesaHandleXError( XMesaDisplay *dpy, XErrorEvent *event )
{
@@ -881,6 +881,8 @@ static GLboolean setup_grayscale( int client, XMesaVisual v,
static GLboolean setup_dithered_color( int client, XMesaVisual v,
XMesaBuffer buffer, XMesaColormap cmap )
{
+ (void) DitherValues; /* Muffle compiler */
+
if (GET_VISUAL_DEPTH(v)<4 || GET_VISUAL_DEPTH(v)>16) {
return GL_FALSE;
}
diff --git a/xc/extras/Mesa/src/X/xm_dd.c b/xc/extras/Mesa/src/X/xm_dd.c
index bdf906aea..1d7021fbd 100644
--- a/xc/extras/Mesa/src/X/xm_dd.c
+++ b/xc/extras/Mesa/src/X/xm_dd.c
@@ -151,7 +151,7 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
ASSERT(target->db_state);
if (target->backpixmap) {
/* back buffer is a pixmape */
- target->buffer = target->backpixmap; /* incompatible types? */
+ target->buffer = (XMesaDrawable)target->backpixmap;
}
else if (target->backimage) {
/* back buffer is an XImage */
@@ -426,6 +426,7 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all,
const GLubyte r = xmesa->clearcolor[0];
const GLubyte g = xmesa->clearcolor[1];
const GLubyte b = xmesa->clearcolor[2];
+#if 0 /* See below */
register GLuint clearPixel;
if (xmesa->swapbytes) {
clearPixel = (b << 16) | (g << 8) | r;
@@ -433,6 +434,7 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all,
else {
clearPixel = (r << 16) | (g << 8) | b;
}
+#endif
if (all) {
if (r==g && g==b) {
diff --git a/xc/extras/Mesa/src/X86/assyntax.h b/xc/extras/Mesa/src/X86/assyntax.h
index 0230d8d0d..07532e8f3 100644
--- a/xc/extras/Mesa/src/X86/assyntax.h
+++ b/xc/extras/Mesa/src/X86/assyntax.h
@@ -78,9 +78,11 @@
#endif
#if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__))
-#define CONCAT(x, y) x ## y
+#define CONCAT(x, y) x ## y
+#define CONCAT3(x, y, z) x ## y ## z
#else
-#define CONCAT(x, y) x/**/y
+#define CONCAT(x, y) x/**/y
+#define CONCAT3(x, y, z) x/**/y/**/z
#endif
#ifdef ACK_ASSEMBLER
@@ -862,7 +864,8 @@
#define P_XMM6 xmm6
#define P_XMM7 xmm7
-#define CONCAT(x, y) x ## y
+#define CONCAT(x, y) x ## y
+#define CONCAT3(x, y, z) x ## y ## z
#if defined(NASM_ASSEMBLER)
@@ -1688,8 +1691,10 @@ SECTION _DATA public align=16 class=DATA use32 flat
/* Added by BrianP for FreeBSD (per David Dawes) */
#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__)
#define LLBL(a) CONCAT(.L,a)
+#define LLBL2(a,b) CONCAT3(.L,a,b)
#else
#define LLBL(a) a
+#define LLBL2(a,b) CONCAT(a,b)
#endif
diff --git a/xc/extras/Mesa/src/X86/mmx_blend.S b/xc/extras/Mesa/src/X86/mmx_blend.S
index 9fe3e7179..d049aa12b 100644
--- a/xc/extras/Mesa/src/X86/mmx_blend.S
+++ b/xc/extras/Mesa/src/X86/mmx_blend.S
@@ -254,7 +254,8 @@ const_80:
/* Blend transparency function
*/
-#define TAG(x) x##_transparency
+#define TAG(x) CONCAT(x,_transparency)
+#define LLTAG(x) LLBL2(x,_transparency)
#define INIT \
PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */
@@ -275,7 +276,8 @@ const_80:
* FIXME: Add some loop unrolling here...
*/
-#define TAG(x) x##_add
+#define TAG(x) CONCAT(x,_add)
+#define LLTAG(x) LLBL2(x,_add)
#define INIT
@@ -295,7 +297,8 @@ TWO(MOVQ ( MM1, REGIND(rgba) ))
/* Blend min function
*/
-#define TAG(x) x##_min
+#define TAG(x) CONCAT(x,_min)
+#define LLTAG(x) LLBL2(x,_min)
#define INIT \
MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
@@ -318,7 +321,8 @@ TWO(MOVQ ( MM1, REGIND(rgba) ))
/* Blend max function
*/
-#define TAG(x) x##_max
+#define TAG(x) CONCAT(x,_max)
+#define LLTAG(x) LLBL2(x,_max)
#define INIT \
MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
@@ -341,7 +345,8 @@ TWO(MOVQ ( MM1, REGIND(rgba) ))
/* Blend modulate function
*/
-#define TAG(x) x##_modulate
+#define TAG(x) CONCAT(x,_modulate)
+#define LLTAG(x) LLBL2(x,_modulate)
#define INIT \
PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */ ;\
diff --git a/xc/extras/Mesa/src/X86/mmx_blendtmp.h b/xc/extras/Mesa/src/X86/mmx_blendtmp.h
index 1a8190355..5d22f288a 100644
--- a/xc/extras/Mesa/src/X86/mmx_blendtmp.h
+++ b/xc/extras/Mesa/src/X86/mmx_blendtmp.h
@@ -24,7 +24,7 @@ GLNAME( TAG(_mesa_mmx_blend) ):
MOV_L ( REGOFF(12, EBP), ECX ) /* n */
CMP_L ( CONST(0), ECX)
- JE ( LLBL ( TAG(GMB_return) ) )
+ JE ( LLTAG(GMB_return) )
MOV_L ( REGOFF(16, EBP), EBX ) /* mask */
MOV_L ( REGOFF(20, EBP), EDI ) /* rgba */
@@ -33,10 +33,10 @@ GLNAME( TAG(_mesa_mmx_blend) ):
INIT
TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */
- JZ ( LLBL ( TAG(GMB_align_end) ) )
+ JZ ( LLTAG(GMB_align_end) )
CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
- JE ( LLBL ( TAG(GMB_align_continue) ) )
+ JE ( LLTAG(GMB_align_continue) )
/* runin */
#define ONE(x) x
@@ -45,23 +45,23 @@ GLNAME( TAG(_mesa_mmx_blend) ):
#undef ONE
#undef TWO
-LLBL ( TAG(GMB_align_continue) ):
+LLTAG(GMB_align_continue):
DEC_L ( ECX ) /* n -= 1 */
INC_L ( EBX ) /* mask += 1 */
ADD_L ( CONST(4), EDI ) /* rgba += 1 */
ADD_L ( CONST(4), ESI ) /* dest += 1 */
-LLBL ( TAG(GMB_align_end) ):
+LLTAG(GMB_align_end):
CMP_L ( CONST(2), ECX)
- JB ( LLBL ( TAG(GMB_loop_end) ) )
+ JB ( LLTAG(GMB_loop_end) )
ALIGNTEXT16
-LLBL ( TAG(GMB_loop_begin) ):
+LLTAG(GMB_loop_begin):
CMP_W ( CONST(0), REGIND(EBX) ) /* *mask == 0 && *(mask + 1) == 0 */
- JE ( LLBL ( TAG(GMB_loop_continue) ) )
+ JE ( LLTAG(GMB_loop_continue) )
/* main loop */
#define ONE(x)
@@ -70,7 +70,7 @@ LLBL ( TAG(GMB_loop_begin) ):
#undef ONE
#undef TWO
-LLBL ( TAG(GMB_loop_continue) ):
+LLTAG(GMB_loop_continue):
DEC_L ( ECX )
DEC_L ( ECX ) /* n -= 2 */
@@ -78,15 +78,15 @@ LLBL ( TAG(GMB_loop_continue) ):
ADD_L ( CONST(8), EDI ) /* rgba += 2 */
ADD_L ( CONST(8), ESI ) /* dest += 2 */
CMP_L ( CONST(2), ECX )
- JAE ( LLBL ( TAG(GMB_loop_begin) ) )
+ JAE ( LLTAG(GMB_loop_begin) )
-LLBL ( TAG(GMB_loop_end) ):
+LLTAG(GMB_loop_end):
CMP_L ( CONST(1), ECX )
- JB ( LLBL ( TAG(GMB_done) ) )
+ JB ( LLTAG(GMB_done) )
CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
- JE ( LLBL ( TAG(GMB_done) ) )
+ JE ( LLTAG(GMB_done) )
/* runout */
#define ONE(x) x
@@ -95,11 +95,11 @@ LLBL ( TAG(GMB_loop_end) ):
#undef ONE
#undef TWO
-LLBL ( TAG(GMB_done) ):
+LLTAG(GMB_done):
EMMS
-LLBL ( TAG(GMB_return) ):
+LLTAG(GMB_return):
POP_L ( EBX )
POP_L ( EDI )
@@ -109,5 +109,6 @@ LLBL ( TAG(GMB_return) ):
RET
#undef TAG
+#undef LLTAG
#undef INIT
#undef MAIN
diff --git a/xc/extras/Mesa/src/api_validate.c b/xc/extras/Mesa/src/api_validate.c
index 37ac4a142..3b8fb102a 100644
--- a/xc/extras/Mesa/src/api_validate.c
+++ b/xc/extras/Mesa/src/api_validate.c
@@ -44,8 +44,7 @@ _mesa_validate_DrawElements(GLcontext *ctx,
return GL_FALSE;
}
- if (mode < 0 ||
- mode > GL_POLYGON) {
+ if (mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
@@ -85,7 +84,7 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
return GL_FALSE;
}
- if (mode < 0 || mode > GL_POLYGON) {
+ if (mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
@@ -125,7 +124,7 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
return GL_FALSE;
}
- if (mode < 0 || mode > GL_POLYGON) {
+ if (mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
diff --git a/xc/extras/Mesa/src/convolve.c b/xc/extras/Mesa/src/convolve.c
index 341d60eac..7c45aef0b 100644
--- a/xc/extras/Mesa/src/convolve.c
+++ b/xc/extras/Mesa/src/convolve.c
@@ -178,7 +178,7 @@ void
_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
{
GLint baseFormat;
- GLint i, components;
+ GLint i;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -215,8 +215,8 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G
return;
}
- components = _mesa_components_in_format(format);
- assert(components > 0); /* this should have been caught earlier */
+ /* this should have been caught earlier */
+ assert(_mesa_components_in_format(format) > 0);
ctx->Convolution2D.Format = format;
ctx->Convolution2D.InternalFormat = internalFormat;
@@ -304,22 +304,18 @@ void
_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl_convolution_attrib *conv;
GLuint c;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
switch (target) {
case GL_CONVOLUTION_1D:
c = 0;
- conv = &ctx->Convolution1D;
break;
case GL_CONVOLUTION_2D:
c = 1;
- conv = &ctx->Convolution2D;
break;
case GL_SEPARABLE_2D:
c = 2;
- conv = &ctx->Separable2D;
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(target)");
@@ -403,22 +399,18 @@ void
_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl_convolution_attrib *conv;
GLuint c;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
switch (target) {
case GL_CONVOLUTION_1D:
c = 0;
- conv = &ctx->Convolution1D;
break;
case GL_CONVOLUTION_2D:
c = 1;
- conv = &ctx->Convolution2D;
break;
case GL_SEPARABLE_2D:
c = 2;
- conv = &ctx->Separable2D;
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(target)");
diff --git a/xc/extras/Mesa/src/extensions.c b/xc/extras/Mesa/src/extensions.c
index 1124780a2..7fc58b096 100644
--- a/xc/extras/Mesa/src/extensions.c
+++ b/xc/extras/Mesa/src/extensions.c
@@ -40,7 +40,7 @@ struct extension {
void (*notify)( GLcontext *, GLboolean );
};
-#define F(x) (int)&(((struct gl_extensions *)0)->x)
+#define F(x) (int)(unsigned long)&(((struct gl_extensions *)0)->x)
#define ON GL_TRUE
#define OFF GL_FALSE
diff --git a/xc/extras/Mesa/src/mmath.c b/xc/extras/Mesa/src/mmath.c
index 212628a4c..3537c1f06 100644
--- a/xc/extras/Mesa/src/mmath.c
+++ b/xc/extras/Mesa/src/mmath.c
@@ -28,8 +28,6 @@
#include "mmath.h"
-static int in_fast_math;
-
/*
* A High Speed, Low Precision Square Root
* by Paul Lalonde and Robert Dawson
@@ -141,7 +139,6 @@ _mesa_init_math(void)
init_sqrt();
initialized = GL_TRUE;
- in_fast_math = 0;
#if defined(_FPU_GETCW) && defined(_FPU_SETCW)
{
diff --git a/xc/extras/Mesa/src/swrast/s_drawpix.c b/xc/extras/Mesa/src/swrast/s_drawpix.c
index 976c8ad8b..5ce08945c 100644
--- a/xc/extras/Mesa/src/swrast/s_drawpix.c
+++ b/xc/extras/Mesa/src/swrast/s_drawpix.c
@@ -128,7 +128,6 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLint skipPixels = unpack->SkipPixels;
GLint skipRows = unpack->SkipRows;
GLint rowLength;
- GLdepth zSpan[MAX_WIDTH]; /* only used when zooming */
GLint zoomY0 = 0;
if (unpack->RowLength > 0)
@@ -188,12 +187,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
return GL_TRUE;
}
else {
- /* setup array of fragment Z value to pass to zoom function */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
- GLint i;
ASSERT(drawWidth < MAX_WIDTH);
- for (i=0; i<drawWidth; i++)
- zSpan[i] = z;
/* save Y value of first row */
zoomY0 = IROUND(ctx->Current.RasterPos[1]);
diff --git a/xc/extras/Mesa/src/swrast/s_pointtemp.h b/xc/extras/Mesa/src/swrast/s_pointtemp.h
index 8f07fa25a..096461dc3 100644
--- a/xc/extras/Mesa/src/swrast/s_pointtemp.h
+++ b/xc/extras/Mesa/src/swrast/s_pointtemp.h
@@ -63,10 +63,10 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
GLfloat size;
#endif
-#if FLAGS & ATTENUATE
+#if FLAGS & RGBA
+#if (FLAGS & ATTENUATE) && (FLAGS & SMOOTH)
GLfloat alphaAtten;
#endif
-#if FLAGS & RGBA
const GLchan red = vert->color[0];
const GLchan green = vert->color[1];
const GLchan blue = vert->color[2];
@@ -134,12 +134,16 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
#if FLAGS & ATTENUATE
if (vert->pointSize >= ctx->Point.Threshold) {
size = MIN2(vert->pointSize, ctx->Point.MaxSize);
+#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
alphaAtten = 1.0F;
+#endif
}
else {
+#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
- size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
alphaAtten = dsize * dsize;
+#endif
+ size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
}
#elif FLAGS & (LARGE | SMOOTH | SPRITE)
size = ctx->Point._Size;
diff --git a/xc/extras/Mesa/src/texcompress.c b/xc/extras/Mesa/src/texcompress.c
index 6ecf8cad0..ea0bc6233 100644
--- a/xc/extras/Mesa/src/texcompress.c
+++ b/xc/extras/Mesa/src/texcompress.c
@@ -90,15 +90,17 @@ _mesa_compressed_texture_size( GLcontext *ctx,
GLint
_mesa_compressed_row_stride(GLenum format, GLsizei width)
{
+#if 0
GLint bytesPerTile, stride;
- switch (format) {
- default:
- return 0;
- }
-
stride = ((width + 3) / 4) * bytesPerTile;
return stride;
+#else
+ (void) format;
+ (void) width;
+
+ return 0;
+#endif
}
@@ -116,6 +118,7 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
GLenum format,
GLsizei width, const GLubyte *image)
{
+#if 0
GLint bytesPerTile, stride;
GLubyte *addr;
@@ -123,15 +126,19 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
ASSERT((col & 3) == 0);
(void) img;
- switch (format) {
- default:
- return 0;
- }
-
stride = ((width + 3) / 4) * bytesPerTile;
addr = (GLubyte *) image + (row / 4) * stride + (col / 4) * bytesPerTile;
return addr;
+#else
+ (void) col;
+ (void) row;
+ (void) img;
+ (void) format;
+ (void) image;
+
+ return (GLubyte *)0;
+#endif
}
diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c
index 8e1d63d35..bd57977cf 100644
--- a/xc/extras/Mesa/src/teximage.c
+++ b/xc/extras/Mesa/src/teximage.c
@@ -1167,10 +1167,8 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
if (destTex->IsCompressed) {
const struct gl_texture_unit *texUnit;
- const struct gl_texture_object *texObj;
const struct gl_texture_image *texImage;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
@@ -2209,7 +2207,6 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
GLint xoffset, GLint x, GLint y, GLsizei width )
{
struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLsizei postConvWidth = width;
GET_CURRENT_CONTEXT(ctx);
@@ -2226,7 +2223,6 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
return;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
/* If we have a border, xoffset=-1 is legal. Bias by border width */
@@ -2245,7 +2241,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
@@ -2262,7 +2257,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
return;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
/* If we have a border, xoffset=-1 is legal. Bias by border width */
@@ -2283,7 +2277,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
@@ -2300,7 +2293,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
return;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
/* If we have a border, xoffset=-1 is legal. Bias by border width */
@@ -2334,7 +2326,6 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
GLsizei height, GLsizei depth, GLint border,
GLsizei imageSize)
{
- GLboolean isProxy = GL_FALSE;
GLint expectedSize, maxLevels = 0, maxTextureSize;
if (dimensions == 1) {
@@ -2344,7 +2335,6 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
else if (dimensions == 2) {
if (target == GL_PROXY_TEXTURE_2D) {
maxLevels = ctx->Const.MaxTextureLevels;
- isProxy = GL_TRUE;
}
else if (target == GL_TEXTURE_2D) {
maxLevels = ctx->Const.MaxTextureLevels;
@@ -2353,7 +2343,6 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
if (!ctx->Extensions.ARB_texture_cube_map)
return GL_INVALID_ENUM; /*target*/
maxLevels = ctx->Const.MaxCubeTextureLevels;
- isProxy = GL_TRUE;
}
else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
@@ -2417,7 +2406,6 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLsizei imageSize)
{
- GLboolean isProxy = GL_FALSE;
GLint expectedSize, maxLevels = 0, maxTextureSize;
if (dimensions == 1) {
@@ -2427,7 +2415,6 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions,
else if (dimensions == 2) {
if (target == GL_PROXY_TEXTURE_2D) {
maxLevels = ctx->Const.MaxTextureLevels;
- isProxy = GL_TRUE;
}
else if (target == GL_TEXTURE_2D) {
maxLevels = ctx->Const.MaxTextureLevels;
@@ -2436,7 +2423,6 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions,
if (!ctx->Extensions.ARB_texture_cube_map)
return GL_INVALID_ENUM; /*target*/
maxLevels = ctx->Const.MaxCubeTextureLevels;
- isProxy = GL_TRUE;
}
else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
diff --git a/xc/extras/Mesa/src/texstore.c b/xc/extras/Mesa/src/texstore.c
index 1f20d2cfa..f443c2233 100644
--- a/xc/extras/Mesa/src/texstore.c
+++ b/xc/extras/Mesa/src/texstore.c
@@ -626,6 +626,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
srcFormat, srcType,
srcPacking, srcAddr,
dstAddr);
+ (void)b;
assert(b);
}
else if (dimensions == 2) {
@@ -637,6 +638,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
srcFormat, srcType,
srcPacking, srcAddr,
dstAddr);
+ (void)b;
assert(b);
}
else {
@@ -647,6 +649,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
dstRowStridePixels, dstImageStridePixels,
srcFormat, srcType,
srcPacking, srcAddr, dstAddr);
+ (void)b;
assert(b);
}
}
@@ -1275,14 +1278,12 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
GLint width, GLint height, GLint depth, GLint border)
{
struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
(void) format;
(void) type;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
/* We always pass.
@@ -1635,9 +1636,7 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border,
const GLint dstRowStride = bpt * dstWidth;
const GLubyte *srcA, *srcB;
GLubyte *dst;
- GLint row, colStride;
-
- colStride = (srcWidth == dstWidth) ? 1 : 2;
+ GLint row;
/* Compute src and dst pointers, skipping any border */
srcA = srcPtr + border * ((srcWidth + 1) * bpt);
diff --git a/xc/extras/Mesa/src/texutil_tmp.h b/xc/extras/Mesa/src/texutil_tmp.h
index becbd24f1..44803518d 100644
--- a/xc/extras/Mesa/src/texutil_tmp.h
+++ b/xc/extras/Mesa/src/texutil_tmp.h
@@ -352,18 +352,17 @@ TAG(texsubimage2d_stride_unpack)( const struct convert_info *convert )
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
(convert->yoffset * convert->dstImageWidth +
convert->xoffset) * DST_TEXEL_BYTES);
- GLint adjust;
- GLint row, col;
- (void) col;
+ GLint row;
- adjust = convert->dstImageWidth - convert->width;
+#ifndef CONVERT_DIRECT
+ GLint adjust = convert->dstImageWidth - convert->width;
+#endif
#if DEBUG_TEXUTIL
_mesa_debug( NULL, __FUNCTION__ ":\n" );
_mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n",
convert->xoffset, convert->yoffset, convert->width,
convert->height, convert->dstImageWidth );
- _mesa_debug( NULL, " adjust=%d\n", adjust );
#endif
for ( row = 0 ; row < convert->height ; row++ ) {
@@ -373,6 +372,7 @@ TAG(texsubimage2d_stride_unpack)( const struct convert_info *convert )
dst += convert->dstImageWidth;
#else
const GLubyte *srcRow = src;
+ GLint col;
for ( col = 0 ; col < convert->width ; col++ ) {
CONVERT_TEXEL( *dst++, src );
src += SRC_TEXEL_BYTES;
@@ -405,18 +405,17 @@ TAG(texsubimage3d_stride_unpack)( const struct convert_info *convert )
((convert->zoffset * convert->dstImageHeight +
convert->yoffset) * convert->dstImageWidth +
convert->xoffset) * DST_TEXEL_BYTES);
- GLint adjust;
- GLint row, col, img;
- (void) col;
+ GLint row, img;
- adjust = convert->dstImageWidth - convert->width;
+#ifndef CONVERT_DIRECT
+ GLint adjust = convert->dstImageWidth - convert->width;
+#endif
#if DEBUG_TEXUTIL
_mesa_debug( NULL, __FUNCTION__ ":\n" );
_mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n",
convert->xoffset, convert->yoffset, convert->width,
convert->height, convert->dstImageWidth );
- _mesa_debug( NULL, " adjust=%d\n", adjust );
#endif
for ( img = 0 ; img < convert->depth ; img++ ) {
@@ -428,6 +427,7 @@ TAG(texsubimage3d_stride_unpack)( const struct convert_info *convert )
dst += convert->dstImageWidth;
#else
const GLubyte *srcRow = src;
+ GLint col;
for ( col = 0 ; col < convert->width ; col++ ) {
CONVERT_TEXEL( *dst++, src );
src += SRC_TEXEL_BYTES;
diff --git a/xc/extras/Mesa/src/tnl/t_imm_api.h b/xc/extras/Mesa/src/tnl/t_imm_api.h
index 1cb89fd4d..c936fed98 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_api.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_api.h
@@ -33,9 +33,6 @@
extern void _tnl_save_Begin( GLenum mode );
extern void _tnl_Begin( GLenum mode );
-
-extern void _tnl_Begin( GLenum mode );
-
extern void _tnl_End(void);
diff --git a/xc/extras/Mesa/src/tnl/t_pipeline.c b/xc/extras/Mesa/src/tnl/t_pipeline.c
index 144710e51..91a0a26ff 100644
--- a/xc/extras/Mesa/src/tnl/t_pipeline.c
+++ b/xc/extras/Mesa/src/tnl/t_pipeline.c
@@ -125,7 +125,9 @@ void _tnl_run_pipeline( GLcontext *ctx )
GLuint changed_state = pipe->run_state_changes;
GLuint changed_inputs = pipe->run_input_changes;
GLboolean running = GL_TRUE;
+#ifdef HAVE_FAST_MATH
unsigned short __tmp;
+#endif
pipe->run_state_changes = 0;
pipe->run_input_changes = 0;
@@ -134,7 +136,9 @@ void _tnl_run_pipeline( GLcontext *ctx )
*/
ASSERT(pipe->build_state_changes == 0);
+#ifdef HAVE_FAST_MATH
START_FAST_MATH(__tmp);
+#endif
/* If something changes in the pipeline, tag all subsequent stages
* using this value for recalculation. Inactive stages have their
@@ -158,7 +162,9 @@ void _tnl_run_pipeline( GLcontext *ctx )
}
}
+#ifdef HAVE_FAST_MATH
END_FAST_MATH(__tmp);
+#endif
}
diff --git a/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h b/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h
index c0ef45cce..7004245d5 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h
+++ b/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h
@@ -104,12 +104,18 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
+#if IDX & LIGHT_COLORMATERIAL
GLuint CMstride;
+#endif
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
+#if IDX & LIGHT_TWOSIDE
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
+#endif
GLchan (*Fspec)[4] = (GLchan (*)[4]) store->LitSecondary[0].Ptr;
+#if IDX & LIGHT_TWOSIDE
GLchan (*Bspec)[4] = (GLchan (*)[4]) store->LitSecondary[1].Ptr;
+#endif
const GLuint nr = VB->Count;
const GLuint *flags = VB->Flag;
@@ -124,24 +130,24 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
fprintf(stderr, "%s\n", __FUNCTION__ );
#endif
- if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT ||
- VB->ColorPtr[0]->Size != 4)
- import_color_material( ctx, stage );
+#if IDX & LIGHT_COLORMATERIAL
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
+ import_color_material( ctx, stage );
- CMcolor = (GLfloat *) VB->ColorPtr[0]->Ptr;
- CMstride = VB->ColorPtr[0]->StrideB;
- }
+ CMcolor = (GLfloat *) VB->ColorPtr[0]->Ptr;
+ CMstride = VB->ColorPtr[0]->StrideB;
+#endif
VB->ColorPtr[0] = &store->LitColor[0];
VB->SecondaryColorPtr[0] = &store->LitSecondary[0];
UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
- if (IDX & LIGHT_TWOSIDE) {
- VB->ColorPtr[1] = &store->LitColor[1];
- VB->SecondaryColorPtr[1] = &store->LitSecondary[1];
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
- }
+#if IDX & LIGHT_TWOSIDE
+ VB->ColorPtr[1] = &store->LitColor[1];
+ VB->SecondaryColorPtr[1] = &store->LitSecondary[1];
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#endif
/* Side-effects done, can we finish now?
*/
@@ -164,17 +170,18 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
if ( CHECK_VALIDATE(j) ) {
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
- if (IDX & LIGHT_TWOSIDE)
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#if IDX & LIGHT_TWOSIDE
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#endif
}
COPY_3V(sum[0], base[0]);
ZERO_3V(spec[0]);
- if (IDX & LIGHT_TWOSIDE) {
- COPY_3V(sum[1], base[1]);
- ZERO_3V(spec[1]);
- }
+#if IDX & LIGHT_TWOSIDE
+ COPY_3V(sum[1], base[1]);
+ ZERO_3V(spec[1]);
+#endif
/* Add contribution from each enabled light source */
foreach (light, &ctx->Light.EnabledList) {
@@ -235,17 +242,18 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
/* Which side gets the diffuse & specular terms? */
if (n_dot_VP < 0.0F) {
ACC_SCALE_SCALAR_3V(sum[0], attenuation, light->_MatAmbient[0]);
- if (!(IDX & LIGHT_TWOSIDE)) {
- continue;
- }
+#if IDX & LIGHT_TWOSIDE
side = 1;
correction = -1;
n_dot_VP = -n_dot_VP;
+#else
+ continue;
+#endif
}
else {
- if (IDX & LIGHT_TWOSIDE) {
- ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]);
- }
+#if IDX & LIGHT_TWOSIDE
+ ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]);
+#endif
side = 0;
correction = 1;
}
@@ -292,11 +300,11 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fspec[j], spec[0] );
Fcolor[j][3] = sumA[0];
- if (IDX & LIGHT_TWOSIDE) {
- UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
- UNCLAMPED_FLOAT_TO_RGB_CHAN( Bspec[j], spec[1] );
- Bcolor[j][3] = sumA[1];
- }
+#if IDX & LIGHT_TWOSIDE
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Bspec[j], spec[1] );
+ Bcolor[j][3] = sumA[1];
+#endif
}
}
@@ -318,11 +326,14 @@ static void TAG(light_rgba)( GLcontext *ctx,
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
+#if IDX & LIGHT_COLORMATERIAL
GLuint CMstride;
+#endif
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
+#if IDX & LIGHT_TWOSIDE
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
- GLchan (*color[2])[4];
+#endif
const GLuint *flags = VB->Flag;
struct gl_material (*new_material)[2] = VB->Material;
@@ -337,25 +348,22 @@ static void TAG(light_rgba)( GLcontext *ctx,
(void) nstride;
(void) vstride;
- color[0] = Fcolor;
- color[1] = Bcolor;
-
- if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT ||
- VB->ColorPtr[0]->Size != 4)
- import_color_material( ctx, stage );
+#if IDX & LIGHT_COLORMATERIAL
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
+ import_color_material( ctx, stage );
- CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
- CMstride = VB->ColorPtr[0]->StrideB;
- }
+ CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
+ CMstride = VB->ColorPtr[0]->StrideB;
+#endif
VB->ColorPtr[0] = &store->LitColor[0];
UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
- if (IDX & LIGHT_TWOSIDE) {
- VB->ColorPtr[1] = &store->LitColor[1];
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
- }
+#if IDX & LIGHT_TWOSIDE
+ VB->ColorPtr[1] = &store->LitColor[1];
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#endif
if (stage->changed_inputs == 0)
return;
@@ -376,14 +384,16 @@ static void TAG(light_rgba)( GLcontext *ctx,
if ( CHECK_VALIDATE(j) ) {
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
- if (IDX & LIGHT_TWOSIDE)
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#if IDX & LIGHT_TWOSIDE
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#endif
}
COPY_3V(sum[0], base[0]);
- if ( IDX & LIGHT_TWOSIDE )
- COPY_3V(sum[1], base[1]);
+#if IDX & LIGHT_TWOSIDE
+ COPY_3V(sum[1], base[1]);
+#endif
/* Add contribution from each enabled light source */
foreach (light, &ctx->Light.EnabledList) {
@@ -446,18 +456,18 @@ static void TAG(light_rgba)( GLcontext *ctx,
/* which side are we lighting? */
if (n_dot_VP < 0.0F) {
ACC_SCALE_SCALAR_3V(sum[0], attenuation, light->_MatAmbient[0]);
-
- if (!(IDX & LIGHT_TWOSIDE))
- continue;
-
+#if IDX & LIGHT_TWOSIDE
side = 1;
correction = -1;
n_dot_VP = -n_dot_VP;
+#else
+ continue;
+#endif
}
else {
- if (IDX & LIGHT_TWOSIDE) {
- ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]);
- }
+#if IDX & LIGHT_TWOSIDE
+ ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]);
+#endif
side = 0;
correction = 1;
}
@@ -506,10 +516,10 @@ static void TAG(light_rgba)( GLcontext *ctx,
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0];
- if (IDX & LIGHT_TWOSIDE) {
- UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
- Bcolor[j][3] = sumA[1];
- }
+#if IDX & LIGHT_TWOSIDE
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
+ Bcolor[j][3] = sumA[1];
+#endif
}
}
@@ -528,9 +538,13 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
+#if IDX & LIGHT_COLORMATERIAL
GLuint CMstride;
+#endif
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
+#if IDX & LIGHT_TWOSIDE
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
+#endif
const struct gl_light *light = ctx->Light.EnabledList.next;
const GLuint *flags = VB->Flag;
GLchan basechan[2][4];
@@ -549,18 +563,19 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
(void) nr;
(void) nstride;
- if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT ||
- VB->ColorPtr[0]->Size != 4)
- import_color_material( ctx, stage );
+#if IDX & LIGHT_COLORMATERIAL
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
+ import_color_material( ctx, stage );
- CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
- CMstride = VB->ColorPtr[0]->StrideB;
- }
+ CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
+ CMstride = VB->ColorPtr[0]->StrideB;
+#endif
VB->ColorPtr[0] = &store->LitColor[0];
- if (IDX & LIGHT_TWOSIDE)
- VB->ColorPtr[1] = &store->LitColor[1];
+#if IDX & LIGHT_TWOSIDE
+ VB->ColorPtr[1] = &store->LitColor[1];
+#endif
if (stage->changed_inputs == 0)
return;
@@ -586,34 +601,33 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
UNCLAMPED_FLOAT_TO_CHAN(basechan[0][3],
ctx->Light.Material[0].Diffuse[3]);
- if (IDX & LIGHT_TWOSIDE) {
- COPY_3V(base[1], light->_MatAmbient[1]);
- ACC_3V(base[1], ctx->Light._BaseColor[1]);
- UNCLAMPED_FLOAT_TO_RGB_CHAN( basechan[1], base[1]);
- UNCLAMPED_FLOAT_TO_CHAN(basechan[1][3],
- ctx->Light.Material[1].Diffuse[3]);
- }
+#if IDX & LIGHT_TWOSIDE
+ COPY_3V(base[1], light->_MatAmbient[1]);
+ ACC_3V(base[1], ctx->Light._BaseColor[1]);
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( basechan[1], base[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(basechan[1][3],
+ ctx->Light.Material[1].Diffuse[3]);
+#endif
do {
GLfloat n_dot_VP = DOT3(normal, light->_VP_inf_norm);
if (n_dot_VP < 0.0F) {
- if (IDX & LIGHT_TWOSIDE) {
- GLfloat n_dot_h = -DOT3(normal, light->_h_inf_norm);
- GLfloat sum[3];
- COPY_3V(sum, base[1]);
- ACC_SCALE_SCALAR_3V(sum, -n_dot_VP, light->_MatDiffuse[1]);
- if (n_dot_h > 0.0F) {
- GLfloat spec;
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec );
- ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]);
- }
- UNCLAMPED_FLOAT_TO_RGB_CHAN(Bcolor[j], sum );
- Bcolor[j][3] = basechan[1][3];
+#if IDX & LIGHT_TWOSIDE
+ GLfloat n_dot_h = -DOT3(normal, light->_h_inf_norm);
+ GLfloat sum[3];
+ COPY_3V(sum, base[1]);
+ ACC_SCALE_SCALAR_3V(sum, -n_dot_VP, light->_MatDiffuse[1]);
+ if (n_dot_h > 0.0F) {
+ GLfloat spec;
+ GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec );
+ ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]);
}
+ UNCLAMPED_FLOAT_TO_RGB_CHAN(Bcolor[j], sum );
+ Bcolor[j][3] = basechan[1][3];
+#endif
COPY_CHAN4(Fcolor[j], basechan[0]);
- }
- else {
+ } else {
GLfloat n_dot_h = DOT3(normal, light->_h_inf_norm);
GLfloat sum[3];
COPY_3V(sum, base[0]);
@@ -626,7 +640,9 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
}
UNCLAMPED_FLOAT_TO_RGB_CHAN(Fcolor[j], sum );
Fcolor[j][3] = basechan[0][3];
- if (IDX & LIGHT_TWOSIDE) COPY_CHAN4(Bcolor[j], basechan[1]);
+#if IDX & LIGHT_TWOSIDE
+ COPY_CHAN4(Bcolor[j], basechan[1]);
+#endif
}
j++;
@@ -638,8 +654,9 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
for ( ; REUSE_LIGHT_RESULTS(j) ; j++, CMSTRIDE, STRIDE_F(normal,NSTRIDE))
{
COPY_CHAN4(Fcolor[j], Fcolor[j-1]);
- if (IDX & LIGHT_TWOSIDE)
- COPY_CHAN4(Bcolor[j], Bcolor[j-1]);
+#if IDX & LIGHT_TWOSIDE
+ COPY_CHAN4(Bcolor[j], Bcolor[j-1]);
+#endif
}
} while (!CHECK_END_VB(j));
@@ -658,9 +675,13 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
+#if IDX & LIGHT_COLORMATERIAL
GLuint CMstride;
+#endif
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
+#if IDX & LIGHT_TWOSIDE
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
+#endif
const GLuint *flags = VB->Flag;
GLuint j = 0;
struct gl_material (*new_material)[2] = VB->Material;
@@ -680,18 +701,19 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
- if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT ||
- VB->ColorPtr[0]->Size != 4)
- import_color_material( ctx, stage );
+#if IDX & LIGHT_COLORMATERIAL
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
+ import_color_material( ctx, stage );
- CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
- CMstride = VB->ColorPtr[0]->StrideB;
- }
+ CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
+ CMstride = VB->ColorPtr[0]->StrideB;
+#endif
VB->ColorPtr[0] = &store->LitColor[0];
- if (IDX & LIGHT_TWOSIDE)
- VB->ColorPtr[1] = &store->LitColor[1];
+#if IDX & LIGHT_TWOSIDE
+ VB->ColorPtr[1] = &store->LitColor[1];
+#endif
if (stage->changed_inputs == 0)
return;
@@ -709,22 +731,23 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
if ( CHECK_VALIDATE(j) ) {
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
- if (IDX & LIGHT_TWOSIDE)
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1],
- ctx->Light.Material[1].Diffuse[3]);
+#if IDX & LIGHT_TWOSIDE
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+#endif
}
-
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
- if (IDX & LIGHT_TWOSIDE)
- COPY_3V(sum[1], ctx->Light._BaseColor[1]);
+#if IDX & LIGHT_TWOSIDE
+ COPY_3V(sum[1], ctx->Light._BaseColor[1]);
+#endif
foreach (light, &ctx->Light.EnabledList) {
GLfloat n_dot_h, n_dot_VP, spec;
ACC_3V(sum[0], light->_MatAmbient[0]);
- if (IDX & LIGHT_TWOSIDE)
- ACC_3V(sum[1], light->_MatAmbient[1]);
+#if IDX & LIGHT_TWOSIDE
+ ACC_3V(sum[1], light->_MatAmbient[1]);
+#endif
n_dot_VP = DOT3(normal, light->_VP_inf_norm);
@@ -738,7 +761,8 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
light->_MatSpecular[0]);
}
}
- else if (IDX & LIGHT_TWOSIDE) {
+#if IDX & LIGHT_TWOSIDE
+ else {
ACC_SCALE_SCALAR_3V(sum[1], -n_dot_VP, light->_MatDiffuse[1]);
n_dot_h = -DOT3(normal, light->_h_inf_norm);
if (n_dot_h > 0.0F) {
@@ -748,15 +772,16 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
light->_MatSpecular[1]);
}
}
+#endif
}
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0];
- if (IDX & LIGHT_TWOSIDE) {
- UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
- Bcolor[j][3] = sumA[1];
- }
+#if IDX & LIGHT_TWOSIDE
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
+ Bcolor[j][3] = sumA[1];
+#endif
j++;
CMSTRIDE;
@@ -769,8 +794,9 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
for ( ; REUSE_LIGHT_RESULTS(j) ; j++, CMSTRIDE, STRIDE_F(normal, NSTRIDE))
{
COPY_CHAN4(Fcolor[j], Fcolor[j-1]);
- if (IDX & LIGHT_TWOSIDE)
- COPY_CHAN4(Bcolor[j], Bcolor[j-1]);
+#if IDX & LIGHT_TWOSIDE
+ COPY_CHAN4(Bcolor[j], Bcolor[j-1]);
+#endif
}
} while (!CHECK_END_VB(j));
@@ -801,7 +827,9 @@ static void TAG(light_ci)( GLcontext *ctx,
const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
+#if IDX & LIGHT_COLORMATERIAL
GLuint CMstride;
+#endif
const GLuint *flags = VB->Flag;
GLuint *indexResult[2];
struct gl_material (*new_material)[2] = VB->Material;
@@ -817,24 +845,26 @@ static void TAG(light_ci)( GLcontext *ctx,
(void) vstride;
VB->IndexPtr[0] = &store->LitIndex[0];
- if (IDX & LIGHT_TWOSIDE)
- VB->IndexPtr[1] = &store->LitIndex[1];
+#if IDX & LIGHT_TWOSIDE
+ VB->IndexPtr[1] = &store->LitIndex[1];
+#endif
if (stage->changed_inputs == 0)
return;
indexResult[0] = VB->IndexPtr[0]->data;
- if (IDX & LIGHT_TWOSIDE)
- indexResult[1] = VB->IndexPtr[1]->data;
+#if IDX & LIGHT_TWOSIDE
+ indexResult[1] = VB->IndexPtr[1]->data;
+#endif
- if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT ||
- VB->ColorPtr[0]->Size != 4)
- import_color_material( ctx, stage );
+#if IDX & LIGHT_COLORMATERIAL
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
+ import_color_material( ctx, stage );
- CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
- CMstride = VB->ColorPtr[0]->StrideB;
- }
+ CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
+ CMstride = VB->ColorPtr[0]->StrideB;
+#endif
/* loop over vertices */
for ( j=0 ;
@@ -856,9 +886,9 @@ static void TAG(light_ci)( GLcontext *ctx,
diffuse[0] = specular[0] = 0.0F;
- if ( IDX & LIGHT_TWOSIDE ) {
- diffuse[1] = specular[1] = 0.0F;
- }
+#if IDX & LIGHT_TWOSIDE
+ diffuse[1] = specular[1] = 0.0F;
+#endif
/* Accumulate diffuse and specular from each light source */
foreach (light, &ctx->Light.EnabledList) {
@@ -911,11 +941,13 @@ static void TAG(light_ci)( GLcontext *ctx,
/* which side are we lighting? */
if (n_dot_VP < 0.0F) {
- if (!(IDX & LIGHT_TWOSIDE))
- continue;
+#if IDX & LIGHT_TWOSIDE
side = 1;
correction = -1;
n_dot_VP = -n_dot_VP;
+#else
+ continue;
+#endif
}
/* accumulate diffuse term */
diff --git a/xc/extras/Mesa/src/vpparse.c b/xc/extras/Mesa/src/vpparse.c
index 4526d79b0..1cb0ce483 100644
--- a/xc/extras/Mesa/src/vpparse.c
+++ b/xc/extras/Mesa/src/vpparse.c
@@ -339,7 +339,7 @@ IsProgRegister(GLuint r)
static GLuint
IsInputRegister(GLuint r)
{
- return (GLuint) (r >= VP_INPUT_REG_START && r <= VP_INPUT_REG_END);
+ return (GLuint) (/* r >= VP_INPUT_REG_START && */ r <= VP_INPUT_REG_END);
}
static GLuint