summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/config.h3
-rw-r--r--src/mesa/main/context.c1
-rw-r--r--src/mesa/main/ffvertex_prog.c1
-rw-r--r--src/mesa/main/get.c8
-rw-r--r--src/mesa/main/get_gen.py2
-rw-r--r--src/mesa/main/imports.c21
-rw-r--r--src/mesa/main/macros.h11
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/texgetimage.c3
-rw-r--r--src/mesa/main/texobj.c3
-rw-r--r--src/mesa/main/version.h6
11 files changed, 32 insertions, 28 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index c5048970cc..2eac1cc2ed 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -243,7 +243,8 @@
/*@{*/
#define MAX_VERTEX_GENERIC_ATTRIBS 16
#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
-#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
+#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_VERTEX_TEXTURE_IMAGE_UNITS + \
+ MAX_TEXTURE_IMAGE_UNITS)
/*@}*/
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 87eae96639..5c20ce017f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -571,6 +571,7 @@ _mesa_init_constants(GLcontext *ctx)
#if FEATURE_ARB_vertex_shader
ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVarying = MAX_VARYING;
#endif
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index fe2416d894..5cfa898031 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -523,7 +523,6 @@ static void emit_dst( struct prog_dst_register *dst,
dst->CondMask = COND_TR; /* always pass cond test */
dst->CondSwizzle = SWIZZLE_NOOP;
dst->CondSrc = 0;
- dst->pad = 0;
/* Check that bitfield sizes aren't exceeded */
ASSERT(dst->Index == reg.idx);
}
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 3f6b03c88a..3d32649bad 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1877,7 +1877,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
- params[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ params[0] = INT_TO_BOOLEAN(ctx->Const.MaxCombinedTextureImageUnits);
break;
case GL_CURRENT_PROGRAM:
CHECK_EXT1(ARB_shader_objects, "GetBooleanv");
@@ -3712,7 +3712,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
- params[0] = (GLfloat)(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ params[0] = (GLfloat)(ctx->Const.MaxCombinedTextureImageUnits);
break;
case GL_CURRENT_PROGRAM:
CHECK_EXT1(ARB_shader_objects, "GetFloatv");
@@ -5547,7 +5547,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
- params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+ params[0] = ctx->Const.MaxCombinedTextureImageUnits;
break;
case GL_CURRENT_PROGRAM:
CHECK_EXT1(ARB_shader_objects, "GetIntegerv");
@@ -7383,7 +7383,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
- params[0] = (GLint64)(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ params[0] = (GLint64)(ctx->Const.MaxCombinedTextureImageUnits);
break;
case GL_CURRENT_PROGRAM:
CHECK_EXT1(ARB_shader_objects, "GetInteger64v");
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index 697c4cfd92..01170a42a7 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -1006,7 +1006,7 @@ StateVars = [
( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint,
["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ),
( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint,
- ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ),
+ ["ctx->Const.MaxCombinedTextureImageUnits"], "", ["ARB_vertex_shader"] ),
# GL_ARB_shader_objects
# Actually, this token isn't part of GL_ARB_shader_objects, but is
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 46ffb929b6..f2ef84f35c 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -460,7 +460,7 @@ _mesa_inv_sqrtf(float n)
#if 0 /* not used, see below -BP */
float r3, x3, y3;
#endif
- union { float f; unsigned int i; } u;
+ fi_type u;
unsigned int magic;
/*
@@ -629,11 +629,15 @@ _mesa_ffsll(int64_t val)
unsigned int
_mesa_bitcount(unsigned int n)
{
+#if defined(__GNUC__)
+ return __builtin_popcount(n);
+#else
unsigned int bits;
for (bits = 0; n > 0; n = n >> 1) {
bits += (n & 1);
}
return bits;
+#endif
}
@@ -645,10 +649,10 @@ _mesa_bitcount(unsigned int n)
GLhalfARB
_mesa_float_to_half(float val)
{
- const int flt = *((int *) (void *) &val);
- const int flt_m = flt & 0x7fffff;
- const int flt_e = (flt >> 23) & 0xff;
- const int flt_s = (flt >> 31) & 0x1;
+ const fi_type fi = {val};
+ const int flt_m = fi.i & 0x7fffff;
+ const int flt_e = (fi.i >> 23) & 0xff;
+ const int flt_s = (fi.i >> 31) & 0x1;
int s, e, m = 0;
GLhalfARB result;
@@ -735,7 +739,8 @@ _mesa_half_to_float(GLhalfARB val)
const int m = val & 0x3ff;
const int e = (val >> 10) & 0x1f;
const int s = (val >> 15) & 0x1;
- int flt_m, flt_e, flt_s, flt;
+ int flt_m, flt_e, flt_s;
+ fi_type fi;
float result;
/* sign bit */
@@ -770,8 +775,8 @@ _mesa_half_to_float(GLhalfARB val)
flt_m = m << 13;
}
- flt = (flt_s << 31) | (flt_e << 23) | flt_m;
- result = *((float *) (void *) &flt);
+ fi.i = (flt_s << 31) | (flt_e << 23) | flt_m;
+ result = fi.f;
return result;
}
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 3d9a1aba98..f0ea463fb9 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -202,17 +202,12 @@ do { \
#endif
/**
- * Copy a 4-element float vector (avoid using FPU registers)
- * XXX Could use two 64-bit moves on 64-bit systems
+ * Copy a 4-element float vector
+ * memcpy seems to be most efficient
*/
#define COPY_4FV( DST, SRC ) \
do { \
- const GLuint *_s = (const GLuint *) (SRC); \
- GLuint *_d = (GLuint *) (DST); \
- _d[0] = _s[0]; \
- _d[1] = _s[1]; \
- _d[2] = _s[2]; \
- _d[3] = _s[3]; \
+ _mesa_memcpy(DST, SRC, sizeof(GLfloat) * 4); \
} while (0)
/** Copy \p SZ elements into a 4-element vector */
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index cde2f5fe06..b52c84b491 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2319,6 +2319,7 @@ struct gl_constants
GLuint MaxTextureCoordUnits;
GLuint MaxTextureImageUnits;
GLuint MaxVertexTextureImageUnits;
+ GLuint MaxCombinedTextureImageUnits;
GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */
GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 23765d2753..bd7cc8d278 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -555,7 +555,8 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level,
_mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) {
memcpy((GLubyte *)img + i * row_stride,
- (GLubyte *)texImage->Data + i * row_stride_stored, row_stride);
+ (GLubyte *)texImage->Data + i * row_stride_stored,
+ row_stride);
}
}
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 237b6eb00d..09fe7b85ba 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -940,7 +940,8 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
/**
* Convert a GL texture target enum such as GL_TEXTURE_2D or GL_TEXTURE_3D
* into the corresponding Mesa texture target index.
- * Return -1 if target is invalid.
+ * Note that proxy targets are not valid here.
+ * \return TEXTURE_x_INDEX or -1 if target is invalid
*/
static GLint
target_enum_to_index(GLenum target)
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index fa233b9f30..dc55cb7ccc 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 7.7
+ * Version: 7.8
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
* Copyright (C) 2009 VMware, Inc. All Rights Reserved.
@@ -30,9 +30,9 @@
/* Mesa version */
#define MESA_MAJOR 7
-#define MESA_MINOR 7
+#define MESA_MINOR 8
#define MESA_PATCH 0
-#define MESA_VERSION_STRING "7.7-rc2"
+#define MESA_VERSION_STRING "7.8-devel"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))