aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-13 08:50:32 +0100
committermarha <marha@users.sourceforge.net>2012-02-13 08:50:32 +0100
commit179ebdfaf7fe0a0017054c052b76210eeff084a9 (patch)
tree5daa6e5583ced6a6b12b03e12c16ef2acedb5b5c /mesalib/src/mesa/main
parent535951cba015f2a2b63292e0ca983d0d6e736b71 (diff)
parenteaa70945cb3f1a432b8c505ecede9ebc7769f36d (diff)
downloadvcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.tar.gz
vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.tar.bz2
vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/extensions.c3
-rw-r--r--mesalib/src/mesa/main/light.c65
-rw-r--r--mesalib/src/mesa/main/light.h37
-rw-r--r--mesalib/src/mesa/main/mtypes.h6
-rw-r--r--mesalib/src/mesa/main/pixel.c2
-rw-r--r--mesalib/src/mesa/main/pixeltransfer.c26
-rw-r--r--mesalib/src/mesa/main/pixeltransfer.h6
-rw-r--r--mesalib/src/mesa/main/texcompress.c12
-rw-r--r--mesalib/src/mesa/main/texgetimage.c60
-rw-r--r--mesalib/src/mesa/main/teximage.c22
-rw-r--r--mesalib/src/mesa/main/texparam.c24
-rw-r--r--mesalib/src/mesa/main/texstate.c19
-rw-r--r--mesalib/src/mesa/main/version.h2
13 files changed, 83 insertions, 201 deletions
diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c
index b02a49de4..d945124d2 100644
--- a/mesalib/src/mesa/main/extensions.c
+++ b/mesalib/src/mesa/main/extensions.c
@@ -931,9 +931,6 @@ _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index)
size_t n;
const struct extension *i;
- if (index < 0)
- return NULL;
-
base = (GLboolean*) &ctx->Extensions;
n = 0;
for (i = extension_table; i->name != 0; ++i) {
diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c
index bf4bee3d6..a16d0e998 100644
--- a/mesalib/src/mesa/main/light.c
+++ b/mesalib/src/mesa/main/light.c
@@ -154,7 +154,6 @@ _mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *pa
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->SpotExponent = params[0];
- _mesa_invalidate_spot_exp_table(light);
break;
case GL_SPOT_CUTOFF:
ASSERT(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0));
@@ -624,6 +623,11 @@ _mesa_material_bitmask( struct gl_context *ctx, GLenum face, GLenum pname,
+static void
+invalidate_shine_table( struct gl_context *ctx, GLuint side );
+
+
+
/* Update derived values following a change in ctx->Light.Material
*/
void
@@ -697,11 +701,11 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
}
if (bitmask & MAT_BIT_FRONT_SHININESS) {
- _mesa_invalidate_shine_table( ctx, 0 );
+ invalidate_shine_table( ctx, 0 );
}
if (bitmask & MAT_BIT_BACK_SHININESS) {
- _mesa_invalidate_shine_table( ctx, 1 );
+ invalidate_shine_table( ctx, 1 );
}
}
@@ -911,52 +915,12 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
-/*
- * Whenever the spotlight exponent for a light changes we must call
- * this function to recompute the exponent lookup table.
- */
-void
-_mesa_invalidate_spot_exp_table( struct gl_light *l )
-{
- l->_SpotExpTable[0][0] = -1;
-}
-
-
-static void
-validate_spot_exp_table( struct gl_light *l )
-{
- GLint i;
- GLdouble exponent = l->SpotExponent;
- GLdouble tmp = 0;
- GLint clamp = 0;
-
- l->_SpotExpTable[0][0] = 0.0;
-
- for (i = EXP_TABLE_SIZE - 1; i > 0 ;i--) {
- if (clamp == 0) {
- tmp = pow(i / (GLdouble) (EXP_TABLE_SIZE - 1), exponent);
- if (tmp < FLT_MIN * 100.0) {
- tmp = 0.0;
- clamp = 1;
- }
- }
- l->_SpotExpTable[i][0] = (GLfloat) tmp;
- }
- for (i = 0; i < EXP_TABLE_SIZE - 1; i++) {
- l->_SpotExpTable[i][1] = (l->_SpotExpTable[i+1][0] -
- l->_SpotExpTable[i][0]);
- }
- l->_SpotExpTable[EXP_TABLE_SIZE-1][1] = 0.0;
-}
-
-
-
/* Calculate a new shine table. Doing this here saves a branch in
* lighting, and the cost of doing it early may be partially offset
* by keeping a MRU cache of shine tables for various shine values.
*/
-void
-_mesa_invalidate_shine_table( struct gl_context *ctx, GLuint side )
+static void
+invalidate_shine_table( struct gl_context *ctx, GLuint side )
{
ASSERT(side < 2);
if (ctx->_ShineTable[side])
@@ -1020,7 +984,6 @@ validate_shine_table( struct gl_context *ctx, GLuint side, GLfloat shininess )
void
_mesa_validate_all_lighting_tables( struct gl_context *ctx )
{
- GLuint i;
GLfloat shininess;
shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
@@ -1030,10 +993,6 @@ _mesa_validate_all_lighting_tables( struct gl_context *ctx )
shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_SHININESS][0];
if (!ctx->_ShineTable[1] || ctx->_ShineTable[1]->shininess != shininess)
validate_shine_table( ctx, 1, shininess );
-
- for (i = 0; i < ctx->Const.MaxLights; i++)
- if (ctx->Light.Light[i]._SpotExpTable[0][0] == -1)
- validate_spot_exp_table( &ctx->Light.Light[i] );
}
@@ -1180,11 +1139,8 @@ compute_light_positions( struct gl_context *ctx )
light->_NormSpotDirection);
if (PV_dot_dir > light->_CosCutoff) {
- double x = PV_dot_dir * (EXP_TABLE_SIZE-1);
- int k = (int) x;
light->_VP_inf_spot_attenuation =
- (GLfloat) (light->_SpotExpTable[k][0] +
- (x-k)*light->_SpotExpTable[k][1]);
+ powf(PV_dot_dir, light->SpotExponent);
}
else {
light->_VP_inf_spot_attenuation = 0;
@@ -1303,7 +1259,6 @@ init_light( struct gl_light *l, GLuint n )
ASSIGN_4V( l->EyePosition, 0.0, 0.0, 1.0, 0.0 );
ASSIGN_3V( l->SpotDirection, 0.0, 0.0, -1.0 );
l->SpotExponent = 0.0;
- _mesa_invalidate_spot_exp_table( l );
l->SpotCutoff = 180.0;
l->_CosCutoffNeg = -1.0f;
l->_CosCutoff = 0.0; /* KW: -ve values not admitted */
diff --git a/mesalib/src/mesa/main/light.h b/mesalib/src/mesa/main/light.h
index 9b66c7ed8..996698793 100644
--- a/mesalib/src/mesa/main/light.h
+++ b/mesalib/src/mesa/main/light.h
@@ -87,22 +87,24 @@ extern void
_mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *params);
-/* Lerp between adjacent values in the f(x) lookup table, giving a
- * continuous function, with adequeate overall accuracy. (Though
- * still pretty good compared to a straight lookup).
- * Result should be a GLfloat.
+/*
+ * Compute dp ^ SpecularExponent.
+ * Lerp between adjacent values in the f(x) lookup table, giving a
+ * continuous function, with adequate overall accuracy. (Though still
+ * pretty good compared to a straight lookup).
*/
-#define GET_SHINE_TAB_ENTRY( table, dp, result ) \
-do { \
- struct gl_shine_tab *_tab = table; \
- float f = (dp * (SHINE_TABLE_SIZE-1)); \
- int k = (int) f; \
- if (k < 0 /* gcc may cast an overflow float value to negative int value*/ \
- || k > SHINE_TABLE_SIZE-2) \
- result = (GLfloat) pow( dp, _tab->shininess ); \
- else \
- result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \
-} while (0)
+static inline GLfloat
+_mesa_lookup_shininess(const struct gl_context *ctx, GLuint face, GLfloat dp)
+{
+ const struct gl_shine_tab *tab = ctx->_ShineTable[face];
+ float f = dp * (SHINE_TABLE_SIZE - 1);
+ int k = (int) f;
+ if (k < 0 /* gcc may cast an overflow float value to negative int value */
+ || k > SHINE_TABLE_SIZE - 2)
+ return powf(dp, tab->shininess);
+ else
+ return tab->tab[k] + (f - k) * (tab->tab[k+1] - tab->tab[k]);
+}
extern GLuint _mesa_material_bitmask( struct gl_context *ctx,
@@ -110,10 +112,6 @@ extern GLuint _mesa_material_bitmask( struct gl_context *ctx,
GLuint legal,
const char * );
-extern void _mesa_invalidate_spot_exp_table( struct gl_light *l );
-
-extern void _mesa_invalidate_shine_table( struct gl_context *ctx, GLuint i );
-
extern void _mesa_validate_all_lighting_tables( struct gl_context *ctx );
extern void _mesa_update_lighting( struct gl_context *ctx );
@@ -135,7 +133,6 @@ extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag )
#else
#define _mesa_update_color_material( c, r ) ((void)0)
#define _mesa_validate_all_lighting_tables( c ) ((void)0)
-#define _mesa_invalidate_spot_exp_table( l ) ((void)0)
#define _mesa_material_bitmask( c, f, p, l, s ) 0
#define _mesa_init_lighting( c ) ((void)0)
#define _mesa_free_lighting_data( c ) ((void)0)
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index d3001d35c..5ef97c86c 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -689,7 +689,6 @@ struct gl_light
GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */
GLfloat _VP_inf_spot_attenuation;
- GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */
GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */
GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */
GLfloat _MatSpecular[2][3]; /**< material spec * light specular */
@@ -1046,7 +1045,6 @@ struct gl_pixelmap
{
GLint Size;
GLfloat Map[MAX_PIXEL_MAP_TABLE];
- GLubyte Map8[MAX_PIXEL_MAP_TABLE]; /**< converted to 8-bit color */
};
@@ -2529,8 +2527,6 @@ struct gl_shared_state
/** GL_ARB_sampler_objects */
struct _mesa_HashTable *SamplerObjects;
-
- void *DriverData; /**< Device driver shared state */
};
@@ -2829,7 +2825,7 @@ struct gl_constants
* borders and mipmapped textures. (Note: not static border color, but the
* old 1-pixel border around each edge). Implementations then have to do
* slow fallbacks to be correct, or just ignore the border and be fast but
- * wrong. Setting the flag stripts the border off of TexImage calls,
+ * wrong. Setting the flag strips the border off of TexImage calls,
* providing "fast but wrong" at significantly reduced driver complexity.
*
* Texture borders are deprecated in GL 3.0.
diff --git a/mesalib/src/mesa/main/pixel.c b/mesalib/src/mesa/main/pixel.c
index e73c5a49a..450c936b7 100644
--- a/mesalib/src/mesa/main/pixel.c
+++ b/mesalib/src/mesa/main/pixel.c
@@ -137,7 +137,6 @@ store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize,
for (i = 0; i < mapsize; i++) {
GLfloat val = CLAMP(values[i], 0.0F, 1.0F);
pm->Map[i] = val;
- pm->Map8[i] = (GLint) (val * 255.0F);
}
}
}
@@ -683,7 +682,6 @@ init_pixelmap(struct gl_pixelmap *map)
{
map->Size = 1;
map->Map[0] = 0.0;
- map->Map8[0] = 0;
}
diff --git a/mesalib/src/mesa/main/pixeltransfer.c b/mesalib/src/mesa/main/pixeltransfer.c
index 5c167e0a9..c6172b9fd 100644
--- a/mesalib/src/mesa/main/pixeltransfer.c
+++ b/mesalib/src/mesa/main/pixeltransfer.c
@@ -125,32 +125,6 @@ _mesa_map_ci_to_rgba( const struct gl_context *ctx, GLuint n,
}
-/**
- * Map ubyte color indexes to ubyte/RGBA values.
- */
-void
-_mesa_map_ci8_to_rgba8(const struct gl_context *ctx,
- GLuint n, const GLubyte index[],
- GLubyte rgba[][4])
-{
- GLuint rmask = ctx->PixelMaps.ItoR.Size - 1;
- GLuint gmask = ctx->PixelMaps.ItoG.Size - 1;
- GLuint bmask = ctx->PixelMaps.ItoB.Size - 1;
- GLuint amask = ctx->PixelMaps.ItoA.Size - 1;
- const GLubyte *rMap = ctx->PixelMaps.ItoR.Map8;
- const GLubyte *gMap = ctx->PixelMaps.ItoG.Map8;
- const GLubyte *bMap = ctx->PixelMaps.ItoB.Map8;
- const GLubyte *aMap = ctx->PixelMaps.ItoA.Map8;
- GLuint i;
- for (i=0;i<n;i++) {
- rgba[i][RCOMP] = rMap[index[i] & rmask];
- rgba[i][GCOMP] = gMap[index[i] & gmask];
- rgba[i][BCOMP] = bMap[index[i] & bmask];
- rgba[i][ACOMP] = aMap[index[i] & amask];
- }
-}
-
-
void
_mesa_scale_and_bias_depth(const struct gl_context *ctx, GLuint n,
GLfloat depthValues[])
diff --git a/mesalib/src/mesa/main/pixeltransfer.h b/mesalib/src/mesa/main/pixeltransfer.h
index a8c14757f..3cd7ebe77 100644
--- a/mesalib/src/mesa/main/pixeltransfer.h
+++ b/mesalib/src/mesa/main/pixeltransfer.h
@@ -46,12 +46,6 @@ _mesa_map_ci_to_rgba(const struct gl_context *ctx,
extern void
-_mesa_map_ci8_to_rgba8(const struct gl_context *ctx,
- GLuint n, const GLubyte index[],
- GLubyte rgba[][4]);
-
-
-extern void
_mesa_scale_and_bias_depth(const struct gl_context *ctx, GLuint n,
GLfloat depthValues[]);
diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c
index 44590ea96..c376b970e 100644
--- a/mesalib/src/mesa/main/texcompress.c
+++ b/mesalib/src/mesa/main/texcompress.c
@@ -465,6 +465,8 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
/**
* Decompress a compressed texture image, returning a GL_RGBA/GL_FLOAT image.
+ * \param srcRowStride stride in bytes between rows of blocks in the
+ * compressed source image.
*/
void
_mesa_decompress_image(gl_format format, GLuint width, GLuint height,
@@ -475,11 +477,19 @@ _mesa_decompress_image(gl_format format, GLuint width, GLuint height,
GLint i, GLint j, GLint k, GLfloat *texel);
struct swrast_texture_image texImage; /* dummy teximage */
GLuint i, j;
+ GLuint bytes, bw, bh;
+
+ bytes = _mesa_get_format_bytes(format);
+ _mesa_get_format_block_size(format, &bw, &bh);
/* setup dummy texture image info */
memset(&texImage, 0, sizeof(texImage));
texImage.Map = (void *) src;
- texImage.RowStride = srcRowStride;
+
+ /* XXX This line is a bit of a hack to adapt to the row stride
+ * convention used by the texture decompression functions.
+ */
+ texImage.RowStride = srcRowStride * bh / bytes;
switch (format) {
/* DXT formats */
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index bff003d24..a02a49156 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -246,23 +246,12 @@ get_tex_rgba_compressed(struct gl_context *ctx, GLuint dimensions,
{
GLubyte *srcMap;
GLint srcRowStride;
- GLuint bytes, bw, bh;
-
- bytes = _mesa_get_format_bytes(texFormat);
- _mesa_get_format_block_size(texFormat, &bw, &bh);
ctx->Driver.MapTextureImage(ctx, texImage, 0,
0, 0, width, height,
GL_MAP_READ_BIT,
&srcMap, &srcRowStride);
if (srcMap) {
- /* XXX This line is a bit of a hack to work around the
- * mismatch of compressed row strides as returned by
- * MapTextureImage() vs. what the texture decompression code
- * uses. This will be fixed in the future.
- */
- srcRowStride = srcRowStride * bh / bytes;
-
_mesa_decompress_image(texFormat, width, height,
srcMap, srcRowStride, tempImage);
@@ -270,6 +259,8 @@ get_tex_rgba_compressed(struct gl_context *ctx, GLuint dimensions,
}
else {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage");
+ free(tempImage);
+ return;
}
}
@@ -496,52 +487,17 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type,
GLboolean memCopy = GL_FALSE;
/*
- * Check if the src/dst formats are compatible.
- * Also note that GL's pixel transfer ops don't apply to glGetTexImage()
- * so we don't have to worry about those.
- * XXX more format combinations could be supported here.
+ * Check if we can use memcpy to copy from the hardware texture
+ * format to the user's format/type.
+ * Note that GL's pixel transfer ops don't apply to glGetTexImage()
*/
if (target == GL_TEXTURE_1D ||
target == GL_TEXTURE_2D ||
target == GL_TEXTURE_RECTANGLE ||
_mesa_is_cube_face(target)) {
- if ((texImage->TexFormat == MESA_FORMAT_ARGB8888 ||
- texImage->TexFormat == MESA_FORMAT_SARGB8) &&
- format == GL_BGRA &&
- (type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) &&
- !ctx->Pack.SwapBytes &&
- _mesa_little_endian()) {
- memCopy = GL_TRUE;
- }
- else if ((texImage->TexFormat == MESA_FORMAT_AL88 ||
- texImage->TexFormat == MESA_FORMAT_SLA8) &&
- format == GL_LUMINANCE_ALPHA &&
- type == GL_UNSIGNED_BYTE &&
- !ctx->Pack.SwapBytes &&
- _mesa_little_endian()) {
- memCopy = GL_TRUE;
- }
- else if ((texImage->TexFormat == MESA_FORMAT_L8 ||
- texImage->TexFormat == MESA_FORMAT_SL8) &&
- format == GL_LUMINANCE &&
- type == GL_UNSIGNED_BYTE) {
- memCopy = GL_TRUE;
- }
- else if (texImage->TexFormat == MESA_FORMAT_L16 &&
- format == GL_LUMINANCE &&
- type == GL_UNSIGNED_SHORT) {
- memCopy = GL_TRUE;
- }
- else if (texImage->TexFormat == MESA_FORMAT_A8 &&
- format == GL_ALPHA &&
- type == GL_UNSIGNED_BYTE) {
- memCopy = GL_TRUE;
- }
- else if (texImage->TexFormat == MESA_FORMAT_A16 &&
- format == GL_ALPHA &&
- type == GL_UNSIGNED_SHORT) {
- memCopy = GL_TRUE;
- }
+ memCopy = _mesa_format_matches_format_and_type(texImage->TexFormat,
+ format, type,
+ ctx->Pack.SwapBytes);
}
if (memCopy) {
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 25da75369..e4eb7f67d 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
switch (target) {
case GL_PROXY_TEXTURE_1D:
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > maxSize)
+ if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
if (level >= ctx->Const.MaxTextureLevels)
return GL_FALSE;
@@ -1191,9 +1191,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
case GL_PROXY_TEXTURE_2D:
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > maxSize)
+ if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
- if (height < 2 * border || height > maxSize)
+ if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
if (level >= ctx->Const.MaxTextureLevels)
return GL_FALSE;
@@ -1207,11 +1207,11 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
case GL_PROXY_TEXTURE_3D:
maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
- if (width < 2 * border || width > maxSize)
+ if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
- if (height < 2 * border || height > maxSize)
+ if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
- if (depth < 2 * border || depth > maxSize)
+ if (depth < 2 * border || depth > 2 * border + maxSize)
return GL_FALSE;
if (level >= ctx->Const.Max3DTextureLevels)
return GL_FALSE;
@@ -1237,9 +1237,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
- if (width < 2 * border || width > maxSize)
+ if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
- if (height < 2 * border || height > maxSize)
+ if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
if (level >= ctx->Const.MaxCubeTextureLevels)
return GL_FALSE;
@@ -1253,7 +1253,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > maxSize)
+ if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
return GL_FALSE;
@@ -1267,9 +1267,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > maxSize)
+ if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
- if (height < 2 * border || height > maxSize)
+ if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
return GL_FALSE;
diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c
index 0f92a5b98..9a2ec518f 100644
--- a/mesalib/src/mesa/main/texparam.c
+++ b/mesalib/src/mesa/main/texparam.c
@@ -1233,19 +1233,19 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
switch (pname) {
case GL_TEXTURE_MAG_FILTER:
*params = (GLint) obj->Sampler.MagFilter;
- break;;
+ break;
case GL_TEXTURE_MIN_FILTER:
*params = (GLint) obj->Sampler.MinFilter;
- break;;
+ break;
case GL_TEXTURE_WRAP_S:
*params = (GLint) obj->Sampler.WrapS;
- break;;
+ break;
case GL_TEXTURE_WRAP_T:
*params = (GLint) obj->Sampler.WrapT;
- break;;
+ break;
case GL_TEXTURE_WRAP_R:
*params = (GLint) obj->Sampler.WrapR;
- break;;
+ break;
case GL_TEXTURE_BORDER_COLOR:
{
GLfloat b[4];
@@ -1258,25 +1258,25 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
params[2] = FLOAT_TO_INT(b[2]);
params[3] = FLOAT_TO_INT(b[3]);
}
- break;;
+ break;
case GL_TEXTURE_RESIDENT:
*params = 1;
- break;;
+ break;
case GL_TEXTURE_PRIORITY:
*params = FLOAT_TO_INT(obj->Priority);
- break;;
+ break;
case GL_TEXTURE_MIN_LOD:
*params = (GLint) obj->Sampler.MinLod;
- break;;
+ break;
case GL_TEXTURE_MAX_LOD:
*params = (GLint) obj->Sampler.MaxLod;
- break;;
+ break;
case GL_TEXTURE_BASE_LEVEL:
*params = obj->BaseLevel;
- break;;
+ break;
case GL_TEXTURE_MAX_LEVEL:
*params = obj->MaxLevel;
- break;;
+ break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
if (!ctx->Extensions.EXT_texture_filter_anisotropic)
goto invalid_pname;
diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c
index 8e9537fae..cc49916a9 100644
--- a/mesalib/src/mesa/main/texstate.c
+++ b/mesalib/src/mesa/main/texstate.c
@@ -682,20 +682,25 @@ _mesa_update_texture( struct gl_context *ctx, GLuint new_state )
static GLboolean
alloc_proxy_textures( struct gl_context *ctx )
{
+ /* NOTE: these values must be in the same order as the TEXTURE_x_INDEX
+ * values!
+ */
static const GLenum targets[] = {
- GL_TEXTURE_1D,
- GL_TEXTURE_2D,
- GL_TEXTURE_3D,
+ GL_TEXTURE_BUFFER,
+ GL_TEXTURE_2D_ARRAY_EXT,
+ GL_TEXTURE_1D_ARRAY_EXT,
+ GL_TEXTURE_EXTERNAL_OES,
GL_TEXTURE_CUBE_MAP_ARB,
+ GL_TEXTURE_3D,
GL_TEXTURE_RECTANGLE_NV,
- GL_TEXTURE_1D_ARRAY_EXT,
- GL_TEXTURE_2D_ARRAY_EXT,
- GL_TEXTURE_BUFFER,
- GL_TEXTURE_EXTERNAL_OES
+ GL_TEXTURE_2D,
+ GL_TEXTURE_1D,
};
GLint tgt;
STATIC_ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
+ assert(targets[TEXTURE_2D_INDEX] == GL_TEXTURE_2D);
+ assert(targets[TEXTURE_CUBE_INDEX] == GL_TEXTURE_CUBE_MAP);
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
if (!(ctx->Texture.ProxyTex[tgt]
diff --git a/mesalib/src/mesa/main/version.h b/mesalib/src/mesa/main/version.h
index 8723c1f57..35bf53392 100644
--- a/mesalib/src/mesa/main/version.h
+++ b/mesalib/src/mesa/main/version.h
@@ -33,7 +33,7 @@ struct gl_context;
/* Mesa version */
#define MESA_MAJOR 8
-#define MESA_MINOR 0
+#define MESA_MINOR 1
#define MESA_PATCH 0
#define MESA_VERSION_STRING "8.0-devel"