summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/api_arrayelt.c4
-rw-r--r--src/mesa/main/api_loopback.c8
-rw-r--r--src/mesa/main/api_noop.c2
-rw-r--r--src/mesa/main/api_validate.c19
-rw-r--r--src/mesa/main/arrayobj.c2
-rw-r--r--src/mesa/main/context.c25
-rw-r--r--src/mesa/main/context.h2
-rw-r--r--src/mesa/main/dlist.c18
-rw-r--r--src/mesa/main/execmem.c2
-rw-r--r--src/mesa/main/framebuffer.c4
-rw-r--r--src/mesa/main/hash.c2
-rw-r--r--src/mesa/main/image.c54
-rw-r--r--src/mesa/main/image.h6
-rw-r--r--src/mesa/main/mtypes.h4
-rw-r--r--src/mesa/main/state.c12
-rw-r--r--src/mesa/main/texenvprogram.c8
-rw-r--r--src/mesa/main/teximage.c32
-rw-r--r--src/mesa/main/texstore.c8
-rw-r--r--src/mesa/main/varray.c2
-rw-r--r--src/mesa/main/vtxfmt_tmp.h4
20 files changed, 132 insertions, 86 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 1899975213..72091b0789 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -31,8 +31,8 @@
#include "context.h"
#include "imports.h"
#include "macros.h"
-#include "glapioffsets.h"
-#include "dispatch.h"
+#include "glapi/glapioffsets.h"
+#include "glapi/dispatch.h"
typedef void (GLAPIENTRY *array_func)( const void * );
diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c
index efe5a77d58..924d7134a2 100644
--- a/src/mesa/main/api_loopback.c
+++ b/src/mesa/main/api_loopback.c
@@ -30,14 +30,14 @@
#include "glheader.h"
-#include "glapi.h"
-#include "glapitable.h"
#include "macros.h"
#include "colormac.h"
#include "api_loopback.h"
-#include "glthread.h"
#include "mtypes.h"
-#include "dispatch.h"
+#include "glapi/glapi.h"
+#include "glapi/glapitable.h"
+#include "glapi/glthread.h"
+#include "glapi/dispatch.h"
/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
* calls to a smaller set of driver-provided formats. Currently just
diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c
index 0c1a35361f..3df64362ea 100644
--- a/src/mesa/main/api_noop.c
+++ b/src/mesa/main/api_noop.c
@@ -31,7 +31,7 @@
#include "light.h"
#include "macros.h"
#include "dlist.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
/**
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 3d20ba7d14..841c6a5302 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 7.0.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * 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"),
@@ -100,6 +100,11 @@ _mesa_validate_DrawElements(GLcontext *ctx,
(const GLubyte *) indices);
}
}
+ else {
+ /* not using a VBO */
+ if (!indices)
+ return GL_FALSE;
+ }
if (ctx->Const.CheckArrayBounds) {
/* find max array index */
@@ -170,6 +175,16 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
&& !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
return GL_FALSE;
+ /* Vertex buffer object tests */
+ if (ctx->Array.ElementArrayBufferObj->Name) {
+ /* XXX re-use code from above? */
+ }
+ else {
+ /* not using VBO */
+ if (!indices)
+ return GL_FALSE;
+ }
+
if (ctx->Const.CheckArrayBounds) {
/* Find max array index.
* We don't trust the user's start and end values.
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index d601ee461e..f08f99d8e1 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -46,7 +46,7 @@
#include "bufferobj.h"
#endif
#include "arrayobj.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
/**
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 255023c0fa..2ad1badac7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -97,12 +97,9 @@
#include "fog.h"
#include "framebuffer.h"
#include "get.h"
-#include "glthread.h"
-#include "glapioffsets.h"
#include "histogram.h"
#include "hint.h"
#include "hash.h"
-#include "atifragshader.h"
#include "light.h"
#include "lines.h"
#include "macros.h"
@@ -110,9 +107,6 @@
#include "pixel.h"
#include "points.h"
#include "polygon.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "program.h"
-#endif
#include "queryobj.h"
#include "rastpos.h"
#include "simple_list.h"
@@ -126,13 +120,19 @@
#include "varray.h"
#include "version.h"
#include "vtxfmt.h"
+#include "glapi/glthread.h"
+#include "glapi/glapioffsets.h"
+#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#include "shader/program.h"
+#endif
+#include "shader/shader_api.h"
+#include "shader/atifragshader.h"
#if _HAVE_FULL_GL
#include "math/m_translate.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "math/mathmod.h"
#endif
-#include "shader_api.h"
#ifdef USE_SPARC_ASM
#include "sparc/sparc.h"
@@ -1495,9 +1495,20 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
*/
if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
_mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
+ /* fix up the fb fields - these will end up wrong otherwise
+ if the DRIdrawable changes, and someone may rely on them.
+ */
+ /* What a mess!?! */
+ int i;
+ GLenum buffers[MAX_DRAW_BUFFERS];
+ for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
+ buffers[i] = newCtx->Color.DrawBuffer[i];
+ }
+ _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers, buffers, NULL);
}
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
+ _mesa_ReadBuffer(newCtx->Pixel.ReadBuffer);
}
newCtx->NewState |= _NEW_BUFFERS;
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index b6a9d13149..099912aa15 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -49,7 +49,7 @@
#define CONTEXT_H
-#include "glapi.h"
+#include "glapi/glapi.h"
#include "imports.h"
#include "mtypes.h"
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 91ddcbf9ed..293ee5fa34 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -33,10 +33,6 @@
#include "api_arrayelt.h"
#include "api_loopback.h"
#include "config.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-#include "arbprogram.h"
-#include "program.h"
-#endif
#include "attrib.h"
#include "blend.h"
#include "buffers.h"
@@ -57,7 +53,7 @@
#include "extensions.h"
#include "feedback.h"
#include "get.h"
-#include "glapi.h"
+#include "glapi/glapi.h"
#include "hash.h"
#include "histogram.h"
#include "image.h"
@@ -76,18 +72,22 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+#include "shader/arbprogram.h"
+#include "shader/program.h"
+#endif
#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "nvprogram.h"
-#include "program.h"
+#include "shader/nvprogram.h"
+#include "shader/program.h"
#endif
#if FEATURE_ATI_fragment_shader
-#include "atifragshader.h"
+#include "shader/atifragshader.h"
#endif
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
/**
diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c
index df3095232d..40f66d7da2 100644
--- a/src/mesa/main/execmem.c
+++ b/src/mesa/main/execmem.c
@@ -32,7 +32,7 @@
#include "imports.h"
-#include "glthread.h"
+#include "glapi/glthread.h"
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 1fd31a5321..dc10d9ffbc 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -65,7 +65,9 @@ compute_depth_max(struct gl_framebuffer *fb)
fb->_DepthMax = 0xffffffff;
}
fb->_DepthMaxF = (GLfloat) fb->_DepthMax;
- fb->_MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */
+
+ /* Minimum resolvable depth value, for polygon offset */
+ fb->_MRD = 1.0 / fb->_DepthMaxF;
}
diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c
index 2d5bcc3e01..ffb2c4d946 100644
--- a/src/mesa/main/hash.c
+++ b/src/mesa/main/hash.c
@@ -37,7 +37,7 @@
#include "glheader.h"
#include "imports.h"
-#include "glthread.h"
+#include "glapi/glthread.h"
#include "hash.h"
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index e2e7f806ab..ba46cdc1b1 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -3648,11 +3648,13 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
* Try simple cases first
*/
if (transferOps == 0 &&
+ !ctx->Pixel.MapStencilFlag &&
srcType == GL_UNSIGNED_BYTE &&
dstType == GL_UNSIGNED_BYTE) {
_mesa_memcpy(dest, source, n * sizeof(GLubyte));
}
else if (transferOps == 0 &&
+ !ctx->Pixel.MapStencilFlag &&
srcType == GL_UNSIGNED_INT &&
dstType == GL_UNSIGNED_INT &&
!srcPacking->SwapBytes) {
@@ -3668,19 +3670,17 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source,
srcPacking);
- if (transferOps) {
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- /* shift and offset indexes */
- shift_and_offset_ci(ctx, n, indexes);
- }
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ /* shift and offset indexes */
+ shift_and_offset_ci(ctx, n, indexes);
+ }
- if (ctx->Pixel.MapStencilFlag) {
- /* Apply stencil lookup table */
- GLuint mask = ctx->PixelMaps.StoS.Size - 1;
- GLuint i;
- for (i=0;i<n;i++) {
- indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
- }
+ if (ctx->Pixel.MapStencilFlag) {
+ /* Apply stencil lookup table */
+ const GLuint mask = ctx->PixelMaps.StoS.Size - 1;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
}
}
@@ -3882,9 +3882,19 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
} \
} while (0)
+
+/**
+ * Unpack a row of depth/z values from memory, returning GLushort, GLuint
+ * or GLfloat values.
+ * The glPixelTransfer (scale/bias) params will be applied.
+ *
+ * \param dstType one of GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, GL_FLOAT
+ * \param depthMax max value for returned GLushort or GLuint values
+ * (ignored for GLfloat).
+ */
void
_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
- GLenum dstType, GLvoid *dest, GLfloat depthScale,
+ GLenum dstType, GLvoid *dest, GLuint depthMax,
GLenum srcType, const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking )
{
@@ -3907,7 +3917,9 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
}
return;
}
- if (srcType == GL_UNSIGNED_SHORT && dstType == GL_UNSIGNED_INT) {
+ if (srcType == GL_UNSIGNED_SHORT
+ && dstType == GL_UNSIGNED_INT
+ && depthMax == 0xffffffff) {
const GLushort *src = (const GLushort *) source;
GLuint *dst = (GLuint *) dest;
GLuint i;
@@ -3955,7 +3967,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
break;
case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */
if (dstType == GL_UNSIGNED_INT &&
- depthScale == (GLfloat) 0xffffff &&
+ depthMax == 0xffffff &&
ctx->Pixel.DepthScale == 1.0 &&
ctx->Pixel.DepthBias == 0.0) {
const GLuint *src = (const GLuint *) source;
@@ -4033,16 +4045,16 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
if (dstType == GL_UNSIGNED_INT) {
GLuint *zValues = (GLuint *) dest;
GLuint i;
- if (depthScale <= (GLfloat) 0xffffff) {
+ if (depthMax <= 0xffffff) {
/* no overflow worries */
for (i = 0; i < n; i++) {
- zValues[i] = (GLuint) (depthValues[i] * depthScale);
+ zValues[i] = (GLuint) (depthValues[i] * (GLfloat) depthMax);
}
}
else {
/* need to use double precision to prevent overflow problems */
for (i = 0; i < n; i++) {
- GLdouble z = depthValues[i] * depthScale;
+ GLdouble z = depthValues[i] * (GLfloat) depthMax;
if (z >= (GLdouble) 0xffffffff)
zValues[i] = 0xffffffff;
else
@@ -4053,14 +4065,14 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
else if (dstType == GL_UNSIGNED_SHORT) {
GLushort *zValues = (GLushort *) dest;
GLuint i;
- ASSERT(depthScale <= 65535.0);
+ ASSERT(depthMax <= 0xffff);
for (i = 0; i < n; i++) {
- zValues[i] = (GLushort) (depthValues[i] * depthScale);
+ zValues[i] = (GLushort) (depthValues[i] * (GLfloat) depthMax);
}
}
else {
ASSERT(dstType == GL_FLOAT);
- ASSERT(depthScale == 1.0F);
+ /*ASSERT(depthMax == 1.0F);*/
}
}
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 990398a7c4..2a16989fa7 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 7.1
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * 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"),
@@ -181,7 +181,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
extern void
_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
- GLenum dstType, GLvoid *dest, GLfloat depthScale,
+ GLenum dstType, GLvoid *dest, GLuint depthMax,
GLenum srcType, const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking );
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 05c08c19fe..709b88d2ef 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -38,8 +38,8 @@
#include "glheader.h"
#include <GL/internal/glcore.h> /* __GLcontextModes (GLvisual) */
#include "config.h" /* Hardwired parameters */
-#include "glapitable.h"
-#include "glthread.h"
+#include "glapi/glapitable.h"
+#include "glapi/glthread.h"
#include "math/m_matrix.h" /* GLmatrix */
#include "bitset.h"
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 0a83abc7dd..66f8ac6408 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -35,10 +35,10 @@
#include "accum.h"
#include "api_loopback.h"
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-#include "arbprogram.h"
+#include "shader/arbprogram.h"
#endif
#if FEATURE_ATI_fragment_shader
-#include "atifragshader.h"
+#include "shader/atifragshader.h"
#endif
#include "attrib.h"
#include "blend.h"
@@ -85,18 +85,18 @@
#include "mtypes.h"
#include "varray.h"
#if FEATURE_NV_vertex_program
-#include "nvprogram.h"
+#include "shader/nvprogram.h"
#endif
#if FEATURE_NV_fragment_program
-#include "nvprogram.h"
-#include "program.h"
+#include "shader/nvprogram.h"
+#include "shader/program.h"
#include "texenvprogram.h"
#endif
#if FEATURE_ARB_shader_objects
#include "shaders.h"
#endif
#include "debug.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 1a46c10ffa..72b54b27d9 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -28,10 +28,10 @@
#include "glheader.h"
#include "macros.h"
#include "enums.h"
-#include "prog_parameter.h"
-#include "prog_instruction.h"
-#include "prog_print.h"
-#include "prog_statevars.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_print.h"
+#include "shader/prog_statevars.h"
#include "texenvprogram.h"
/**
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index f902365b9b..3420d8e2ba 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1264,6 +1264,10 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
* A hardware driver might override this function if, for example, the
* max 3D texture size is 512x512x64 (i.e. not a cube).
*
+ * Note that width, height, depth == 0 is not an error. However, a
+ * texture with zero width/height/depth will be considered "incomplete"
+ * and texturing will effectively be disabled.
+ *
* \param target one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D,
* GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV,
* GL_PROXY_TEXTURE_CUBE_MAP_ARB.
@@ -1293,7 +1297,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
if (width < 2 * border || width > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(width - 2 * border) != 1) ||
+ width >0 && _mesa_bitcount(width - 2 * border) != 1) ||
level >= ctx->Const.MaxTextureLevels) {
/* bad width or level */
return GL_FALSE;
@@ -1303,10 +1307,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
if (width < 2 * border || width > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(width - 2 * border) != 1) ||
+ width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
height < 2 * border || height > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(height - 2 * border) != 1) ||
+ height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
level >= ctx->Const.MaxTextureLevels) {
/* bad width or height or level */
return GL_FALSE;
@@ -1316,21 +1320,21 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
if (width < 2 * border || width > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(width - 2 * border) != 1) ||
+ width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
height < 2 * border || height > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(height - 2 * border) != 1) ||
+ height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
depth < 2 * border || depth > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(depth - 2 * border) != 1) ||
+ depth > 0 && _mesa_bitcount(depth - 2 * border) != 1) ||
level >= ctx->Const.Max3DTextureLevels) {
/* bad width or height or depth or level */
return GL_FALSE;
}
return GL_TRUE;
case GL_PROXY_TEXTURE_RECTANGLE_NV:
- if (width < 1 || width > ctx->Const.MaxTextureRectSize ||
- height < 1 || height > ctx->Const.MaxTextureRectSize ||
+ if (width < 0 || width > ctx->Const.MaxTextureRectSize ||
+ height < 0 || height > ctx->Const.MaxTextureRectSize ||
level != 0) {
/* bad width or height or level */
return GL_FALSE;
@@ -1340,10 +1344,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
if (width < 2 * border || width > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(width - 2 * border) != 1) ||
+ width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
height < 2 * border || height > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(height - 2 * border) != 1) ||
+ height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
level >= ctx->Const.MaxCubeTextureLevels) {
/* bad width or height */
return GL_FALSE;
@@ -1353,7 +1357,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
if (width < 2 * border || width > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(width - 2 * border) != 1) ||
+ width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
level >= ctx->Const.MaxTextureLevels) {
/* bad width or level */
return GL_FALSE;
@@ -1367,10 +1371,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
if (width < 2 * border || width > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(width - 2 * border) != 1) ||
+ width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
height < 2 * border || height > 2 + maxSize ||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
- _mesa_bitcount(height - 2 * border) != 1) ||
+ height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
level >= ctx->Const.MaxTextureLevels) {
/* bad width or height or level */
return GL_FALSE;
@@ -1472,7 +1476,7 @@ texture_error_check( GLcontext *ctx, GLenum target,
if (target == GL_PROXY_TEXTURE_1D || target == GL_TEXTURE_1D) {
proxy_target = GL_PROXY_TEXTURE_1D;
height = 1;
- width = 1;
+ depth = 1;
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" );
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 9b8a06df14..3b5151ed17 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1077,7 +1077,7 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_z32(TEXSTORE_PARAMS)
{
- const GLfloat depthScale = (GLfloat) 0xffffffff;
+ const GLuint depthScale = 0xffffffff;
(void) dims;
ASSERT(dstFormat == &_mesa_texformat_z32);
ASSERT(dstFormat->TexelBytes == sizeof(GLuint));
@@ -1124,7 +1124,7 @@ _mesa_texstore_z32(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_z16(TEXSTORE_PARAMS)
{
- const GLfloat depthScale = 65535.0f;
+ const GLuint depthScale = 0xffff;
(void) dims;
ASSERT(dstFormat == &_mesa_texformat_z16);
ASSERT(dstFormat->TexelBytes == sizeof(GLushort));
@@ -2319,6 +2319,8 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_z24_s8(TEXSTORE_PARAMS)
{
+ const GLuint depthScale = 0xffffff;
+
ASSERT(dstFormat == &_mesa_texformat_z24_s8);
ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT);
ASSERT(srcType == GL_UNSIGNED_INT_24_8_EXT);
@@ -2357,7 +2359,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
_mesa_unpack_depth_span(ctx, srcWidth,
GL_UNSIGNED_INT, /* dst type */
dstRow, /* dst addr */
- (GLfloat) 0xffffff, /* depthScale */
+ depthScale,
srcType, src, srcPacking);
/* get the 8-bit stencil values */
_mesa_unpack_stencil_span(ctx, srcWidth,
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index bf1ad0165e..fe4a7c684f 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -32,7 +32,7 @@
#include "mtypes.h"
#include "varray.h"
#include "arrayobj.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
/**
diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h
index 783b06558d..6f5d01e40f 100644
--- a/src/mesa/main/vtxfmt_tmp.h
+++ b/src/mesa/main/vtxfmt_tmp.h
@@ -29,8 +29,8 @@
#define PRE_LOOPBACK( FUNC )
#endif
-#include "dispatch.h"
-#include "glapioffsets.h"
+#include "glapi/dispatch.h"
+#include "glapi/glapioffsets.h"
static void GLAPIENTRY TAG(ArrayElement)( GLint i )
{