aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/context.c38
-rw-r--r--mesalib/src/mesa/main/context.h8
-rw-r--r--mesalib/src/mesa/main/dlist.c6
-rw-r--r--mesalib/src/mesa/main/fbobject.c12
-rw-r--r--mesalib/src/mesa/main/get.c344
-rw-r--r--mesalib/src/mesa/main/histogram.c7
-rw-r--r--mesalib/src/mesa/main/image.c4
-rw-r--r--mesalib/src/mesa/main/imports.c23
-rw-r--r--mesalib/src/mesa/main/mipmap.c19
-rw-r--r--mesalib/src/mesa/main/renderbuffer.c2
-rw-r--r--mesalib/src/mesa/main/syncobj.c12
-rw-r--r--mesalib/src/mesa/main/syncobj.h12
-rw-r--r--mesalib/src/mesa/main/texcompress.c50
-rw-r--r--mesalib/src/mesa/main/texcompress.h4
-rw-r--r--mesalib/src/mesa/main/texformat.c16
-rw-r--r--mesalib/src/mesa/main/texobj.c2
-rw-r--r--mesalib/src/mesa/main/texparam.c10
-rw-r--r--mesalib/src/mesa/main/texstate.c22
-rw-r--r--mesalib/src/mesa/main/texstore.c6
-rw-r--r--mesalib/src/mesa/main/version.h6
20 files changed, 359 insertions, 244 deletions
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index f6d4ac459..e844a7432 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -898,6 +898,7 @@ _mesa_initialize_context(GLcontext *ctx,
_mesa_free_shared_state(ctx, ctx->Shared);
if (ctx->Exec)
_mesa_free(ctx->Exec);
+ return GL_FALSE;
}
#if FEATURE_dispatch
_mesa_init_exec_table(ctx->Exec);
@@ -1543,6 +1544,33 @@ _mesa_record_error(GLcontext *ctx, GLenum error)
/**
+ * Flush commands and wait for completion.
+ */
+void
+_mesa_finish(GLcontext *ctx)
+{
+ FLUSH_CURRENT( ctx, 0 );
+ if (ctx->Driver.Finish) {
+ ctx->Driver.Finish(ctx);
+ }
+}
+
+
+/**
+ * Flush commands.
+ */
+void
+_mesa_flush(GLcontext *ctx)
+{
+ FLUSH_CURRENT( ctx, 0 );
+ if (ctx->Driver.Flush) {
+ ctx->Driver.Flush(ctx);
+ }
+}
+
+
+
+/**
* Execute glFinish().
*
* Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
@@ -1553,10 +1581,7 @@ _mesa_Finish(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT( ctx, 0 );
- if (ctx->Driver.Finish) {
- ctx->Driver.Finish(ctx);
- }
+ _mesa_finish(ctx);
}
@@ -1571,10 +1596,7 @@ _mesa_Flush(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT( ctx, 0 );
- if (ctx->Driver.Flush) {
- ctx->Driver.Flush(ctx);
- }
+ _mesa_flush(ctx);
}
diff --git a/mesalib/src/mesa/main/context.h b/mesalib/src/mesa/main/context.h
index 5587695fa..c3be1063f 100644
--- a/mesalib/src/mesa/main/context.h
+++ b/mesalib/src/mesa/main/context.h
@@ -170,6 +170,14 @@ _mesa_valid_to_render(GLcontext *ctx, const char *where);
extern void
_mesa_record_error( GLcontext *ctx, GLenum error );
+
+extern void
+_mesa_finish(GLcontext *ctx);
+
+extern void
+_mesa_flush(GLcontext *ctx);
+
+
extern void GLAPIENTRY
_mesa_Finish( void );
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index b53c1733f..41a5b6140 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -1956,6 +1956,9 @@ save_Fogiv(GLenum pname, const GLint *params)
case GL_FOG_END:
case GL_FOG_INDEX:
p[0] = (GLfloat) *params;
+ p[1] = 0.0f;
+ p[2] = 0.0f;
+ p[3] = 0.0f;
break;
case GL_FOG_COLOR:
p[0] = INT_TO_FLOAT(params[0]);
@@ -2244,6 +2247,9 @@ save_LightModeliv(GLenum pname, const GLint *params)
case GL_LIGHT_MODEL_TWO_SIDE:
case GL_LIGHT_MODEL_COLOR_CONTROL:
fparam[0] = (GLfloat) params[0];
+ fparam[1] = 0.0F;
+ fparam[2] = 0.0F;
+ fparam[3] = 0.0F;
break;
default:
/* Error will be caught later in gl_LightModelfv */
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 825a23090..ed1db0fec 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -1511,18 +1511,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
return;
}
- if (texObj && attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
- /* the texture format must be depth+stencil */
- const struct gl_texture_image *texImg;
- texImg = texObj->Image[0][texObj->BaseLevel];
- if (!texImg || texImg->_BaseFormat != GL_DEPTH_STENCIL) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture%sEXT(texture is not"
- " DEPTH_STENCIL format)", caller);
- return;
- }
- }
-
FLUSH_CURRENT(ctx, _NEW_BUFFERS);
/* The above doesn't fully flush the drivers in the way that a
* glFlush does, but that is required here:
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 477ed0103..604b10621 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -5580,16 +5580,16 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
switch (pname) {
case GL_ACCUM_RED_BITS:
- params[0] = ctx->DrawBuffer->Visual.accumRedBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumRedBits);
break;
case GL_ACCUM_GREEN_BITS:
- params[0] = ctx->DrawBuffer->Visual.accumGreenBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumGreenBits);
break;
case GL_ACCUM_BLUE_BITS:
- params[0] = ctx->DrawBuffer->Visual.accumBlueBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumBlueBits);
break;
case GL_ACCUM_ALPHA_BITS:
- params[0] = ctx->DrawBuffer->Visual.accumAlphaBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumAlphaBits);
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_INT64(ctx->Accum.ClearColor[0]);
@@ -5601,7 +5601,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = IROUND64(ctx->Pixel.AlphaBias);
break;
case GL_ALPHA_BITS:
- params[0] = ctx->DrawBuffer->Visual.alphaBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.alphaBits);
break;
case GL_ALPHA_SCALE:
params[0] = IROUND64(ctx->Pixel.AlphaScale);
@@ -5616,13 +5616,13 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = FLOAT_TO_INT64(ctx->Color.AlphaRef);
break;
case GL_ATTRIB_STACK_DEPTH:
- params[0] = ctx->AttribStackDepth;
+ params[0] = (GLint64)(ctx->AttribStackDepth);
break;
case GL_AUTO_NORMAL:
params[0] = BOOLEAN_TO_INT64(ctx->Eval.AutoNormal);
break;
case GL_AUX_BUFFERS:
- params[0] = ctx->DrawBuffer->Visual.numAuxBuffers;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.numAuxBuffers);
break;
case GL_BLEND:
params[0] = BOOLEAN_TO_INT64(ctx->Color.BlendEnabled);
@@ -5661,13 +5661,13 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = IROUND64(ctx->Pixel.BlueBias);
break;
case GL_BLUE_BITS:
- params[0] = ctx->DrawBuffer->Visual.blueBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.blueBits);
break;
case GL_BLUE_SCALE:
params[0] = IROUND64(ctx->Pixel.BlueScale);
break;
case GL_CLIENT_ATTRIB_STACK_DEPTH:
- params[0] = ctx->ClientAttribStackDepth;
+ params[0] = (GLint64)(ctx->ClientAttribStackDepth);
break;
case GL_CLIP_PLANE0:
params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 0) & 1);
@@ -5703,10 +5703,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = ENUM_TO_INT64(ctx->Light.ColorMaterialMode);
break;
case GL_COLOR_WRITEMASK:
- params[0] = ctx->Color.ColorMask[RCOMP] ? 1 : 0;
- params[1] = ctx->Color.ColorMask[GCOMP] ? 1 : 0;
- params[2] = ctx->Color.ColorMask[BCOMP] ? 1 : 0;
- params[3] = ctx->Color.ColorMask[ACOMP] ? 1 : 0;
+ params[0] = (GLint64)(ctx->Color.ColorMask[RCOMP] ? 1 : 0);
+ params[1] = (GLint64)(ctx->Color.ColorMask[GCOMP] ? 1 : 0);
+ params[2] = (GLint64)(ctx->Color.ColorMask[BCOMP] ? 1 : 0);
+ params[3] = (GLint64)(ctx->Color.ColorMask[ACOMP] ? 1 : 0);
break;
case GL_CULL_FACE:
params[0] = BOOLEAN_TO_INT64(ctx->Polygon.CullFlag);
@@ -5787,7 +5787,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = IROUND64(ctx->Pixel.DepthBias);
break;
case GL_DEPTH_BITS:
- params[0] = ctx->DrawBuffer->Visual.depthBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.depthBits);
break;
case GL_DEPTH_CLEAR_VALUE:
params[0] = FLOAT_TO_INT64(((GLfloat) ctx->Depth.Clear));
@@ -5824,7 +5824,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
}
break;
case GL_FEEDBACK_BUFFER_SIZE:
- params[0] = ctx->Feedback.BufferSize;
+ params[0] = (GLint64)(ctx->Feedback.BufferSize);
break;
case GL_FEEDBACK_BUFFER_TYPE:
params[0] = ENUM_TO_INT64(ctx->Feedback.Type);
@@ -5863,28 +5863,28 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = IROUND64(ctx->Pixel.GreenBias);
break;
case GL_GREEN_BITS:
- params[0] = ctx->DrawBuffer->Visual.greenBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.greenBits);
break;
case GL_GREEN_SCALE:
params[0] = IROUND64(ctx->Pixel.GreenScale);
break;
case GL_INDEX_BITS:
- params[0] = ctx->DrawBuffer->Visual.indexBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.indexBits);
break;
case GL_INDEX_CLEAR_VALUE:
- params[0] = ctx->Color.ClearIndex;
+ params[0] = (GLint64)(ctx->Color.ClearIndex);
break;
case GL_INDEX_MODE:
params[0] = BOOLEAN_TO_INT64(!ctx->DrawBuffer->Visual.rgbMode);
break;
case GL_INDEX_OFFSET:
- params[0] = ctx->Pixel.IndexOffset;
+ params[0] = (GLint64)(ctx->Pixel.IndexOffset);
break;
case GL_INDEX_SHIFT:
- params[0] = ctx->Pixel.IndexShift;
+ params[0] = (GLint64)(ctx->Pixel.IndexShift);
break;
case GL_INDEX_WRITEMASK:
- params[0] = ctx->Color.IndexMask;
+ params[0] = (GLint64)(ctx->Color.IndexMask);
break;
case GL_LIGHT0:
params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[0].Enabled);
@@ -5938,10 +5938,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = BOOLEAN_TO_INT64(ctx->Line.StippleFlag);
break;
case GL_LINE_STIPPLE_PATTERN:
- params[0] = ctx->Line.StipplePattern;
+ params[0] = (GLint64)(ctx->Line.StipplePattern);
break;
case GL_LINE_STIPPLE_REPEAT:
- params[0] = ctx->Line.StippleFactor;
+ params[0] = (GLint64)(ctx->Line.StippleFactor);
break;
case GL_LINE_WIDTH:
params[0] = IROUND64(ctx->Line.Width);
@@ -5958,10 +5958,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[1] = IROUND64(ctx->Const.MaxLineWidth);
break;
case GL_LIST_BASE:
- params[0] = ctx->List.ListBase;
+ params[0] = (GLint64)(ctx->List.ListBase);
break;
case GL_LIST_INDEX:
- params[0] = (ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0);
+ params[0] = (GLint64)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0));
break;
case GL_LIST_MODE:
{
@@ -5992,7 +5992,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[1] = IROUND64(ctx->Eval.MapGrid1u2);
break;
case GL_MAP1_GRID_SEGMENTS:
- params[0] = ctx->Eval.MapGrid1un;
+ params[0] = (GLint64)(ctx->Eval.MapGrid1un);
break;
case GL_MAP1_INDEX:
params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Index);
@@ -6028,8 +6028,8 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[3] = IROUND64(ctx->Eval.MapGrid2v2);
break;
case GL_MAP2_GRID_SEGMENTS:
- params[0] = ctx->Eval.MapGrid2un;
- params[1] = ctx->Eval.MapGrid2vn;
+ params[0] = (GLint64)(ctx->Eval.MapGrid2un);
+ params[1] = (GLint64)(ctx->Eval.MapGrid2vn);
break;
case GL_MAP2_INDEX:
params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Index);
@@ -6065,53 +6065,53 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = ENUM_TO_INT64(ctx->Transform.MatrixMode);
break;
case GL_MAX_ATTRIB_STACK_DEPTH:
- params[0] = MAX_ATTRIB_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_ATTRIB_STACK_DEPTH);
break;
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
- params[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_CLIENT_ATTRIB_STACK_DEPTH);
break;
case GL_MAX_CLIP_PLANES:
- params[0] = ctx->Const.MaxClipPlanes;
+ params[0] = (GLint64)(ctx->Const.MaxClipPlanes);
break;
case GL_MAX_ELEMENTS_VERTICES:
- params[0] = ctx->Const.MaxArrayLockSize;
+ params[0] = (GLint64)(ctx->Const.MaxArrayLockSize);
break;
case GL_MAX_ELEMENTS_INDICES:
- params[0] = ctx->Const.MaxArrayLockSize;
+ params[0] = (GLint64)(ctx->Const.MaxArrayLockSize);
break;
case GL_MAX_EVAL_ORDER:
- params[0] = MAX_EVAL_ORDER;
+ params[0] = (GLint64)(MAX_EVAL_ORDER);
break;
case GL_MAX_LIGHTS:
- params[0] = ctx->Const.MaxLights;
+ params[0] = (GLint64)(ctx->Const.MaxLights);
break;
case GL_MAX_LIST_NESTING:
- params[0] = MAX_LIST_NESTING;
+ params[0] = (GLint64)(MAX_LIST_NESTING);
break;
case GL_MAX_MODELVIEW_STACK_DEPTH:
- params[0] = MAX_MODELVIEW_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_MODELVIEW_STACK_DEPTH);
break;
case GL_MAX_NAME_STACK_DEPTH:
- params[0] = MAX_NAME_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_NAME_STACK_DEPTH);
break;
case GL_MAX_PIXEL_MAP_TABLE:
- params[0] = MAX_PIXEL_MAP_TABLE;
+ params[0] = (GLint64)(MAX_PIXEL_MAP_TABLE);
break;
case GL_MAX_PROJECTION_STACK_DEPTH:
- params[0] = MAX_PROJECTION_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_PROJECTION_STACK_DEPTH);
break;
case GL_MAX_TEXTURE_SIZE:
- params[0] = 1 << (ctx->Const.MaxTextureLevels - 1);
+ params[0] = (GLint64)(1 << (ctx->Const.MaxTextureLevels - 1));
break;
case GL_MAX_3D_TEXTURE_SIZE:
- params[0] = 1 << (ctx->Const.Max3DTextureLevels - 1);
+ params[0] = (GLint64)(1 << (ctx->Const.Max3DTextureLevels - 1));
break;
case GL_MAX_TEXTURE_STACK_DEPTH:
- params[0] = MAX_TEXTURE_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_TEXTURE_STACK_DEPTH);
break;
case GL_MAX_VIEWPORT_DIMS:
- params[0] = ctx->Const.MaxViewportWidth;
- params[1] = ctx->Const.MaxViewportHeight;
+ params[0] = (GLint64)(ctx->Const.MaxViewportWidth);
+ params[1] = (GLint64)(ctx->Const.MaxViewportHeight);
break;
case GL_MODELVIEW_MATRIX:
{
@@ -6135,37 +6135,37 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- params[0] = ctx->ModelviewMatrixStack.Depth + 1;
+ params[0] = (GLint64)(ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
- params[0] = ctx->Select.NameStackDepth;
+ params[0] = (GLint64)(ctx->Select.NameStackDepth);
break;
case GL_NORMALIZE:
params[0] = BOOLEAN_TO_INT64(ctx->Transform.Normalize);
break;
case GL_PACK_ALIGNMENT:
- params[0] = ctx->Pack.Alignment;
+ params[0] = (GLint64)(ctx->Pack.Alignment);
break;
case GL_PACK_LSB_FIRST:
params[0] = BOOLEAN_TO_INT64(ctx->Pack.LsbFirst);
break;
case GL_PACK_ROW_LENGTH:
- params[0] = ctx->Pack.RowLength;
+ params[0] = (GLint64)(ctx->Pack.RowLength);
break;
case GL_PACK_SKIP_PIXELS:
- params[0] = ctx->Pack.SkipPixels;
+ params[0] = (GLint64)(ctx->Pack.SkipPixels);
break;
case GL_PACK_SKIP_ROWS:
- params[0] = ctx->Pack.SkipRows;
+ params[0] = (GLint64)(ctx->Pack.SkipRows);
break;
case GL_PACK_SWAP_BYTES:
params[0] = BOOLEAN_TO_INT64(ctx->Pack.SwapBytes);
break;
case GL_PACK_SKIP_IMAGES_EXT:
- params[0] = ctx->Pack.SkipImages;
+ params[0] = (GLint64)(ctx->Pack.SkipImages);
break;
case GL_PACK_IMAGE_HEIGHT_EXT:
- params[0] = ctx->Pack.ImageHeight;
+ params[0] = (GLint64)(ctx->Pack.ImageHeight);
break;
case GL_PACK_INVERT_MESA:
params[0] = BOOLEAN_TO_INT64(ctx->Pack.Invert);
@@ -6174,34 +6174,34 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = ENUM_TO_INT64(ctx->Hint.PerspectiveCorrection);
break;
case GL_PIXEL_MAP_A_TO_A_SIZE:
- params[0] = ctx->PixelMaps.AtoA.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.AtoA.Size);
break;
case GL_PIXEL_MAP_B_TO_B_SIZE:
- params[0] = ctx->PixelMaps.BtoB.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.BtoB.Size);
break;
case GL_PIXEL_MAP_G_TO_G_SIZE:
- params[0] = ctx->PixelMaps.GtoG.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.GtoG.Size);
break;
case GL_PIXEL_MAP_I_TO_A_SIZE:
- params[0] = ctx->PixelMaps.ItoA.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.ItoA.Size);
break;
case GL_PIXEL_MAP_I_TO_B_SIZE:
- params[0] = ctx->PixelMaps.ItoB.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.ItoB.Size);
break;
case GL_PIXEL_MAP_I_TO_G_SIZE:
- params[0] = ctx->PixelMaps.ItoG.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.ItoG.Size);
break;
case GL_PIXEL_MAP_I_TO_I_SIZE:
- params[0] = ctx->PixelMaps.ItoI.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.ItoI.Size);
break;
case GL_PIXEL_MAP_I_TO_R_SIZE:
- params[0] = ctx->PixelMaps.ItoR.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.ItoR.Size);
break;
case GL_PIXEL_MAP_R_TO_R_SIZE:
- params[0] = ctx->PixelMaps.RtoR.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.RtoR.Size);
break;
case GL_PIXEL_MAP_S_TO_S_SIZE:
- params[0] = ctx->PixelMaps.StoS.Size;
+ params[0] = (GLint64)(ctx->PixelMaps.StoS.Size);
break;
case GL_POINT_SIZE:
params[0] = IROUND64(ctx->Point.Size);
@@ -6290,7 +6290,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
}
break;
case GL_PROJECTION_STACK_DEPTH:
- params[0] = ctx->ProjectionMatrixStack.Depth + 1;
+ params[0] = (GLint64)(ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
params[0] = ENUM_TO_INT64(ctx->ReadBuffer->ColorReadBuffer);
@@ -6299,7 +6299,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = IROUND64(ctx->Pixel.RedBias);
break;
case GL_RED_BITS:
- params[0] = ctx->DrawBuffer->Visual.redBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.redBits);
break;
case GL_RED_SCALE:
params[0] = IROUND64(ctx->Pixel.RedScale);
@@ -6314,16 +6314,16 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.rgbMode);
break;
case GL_SCISSOR_BOX:
- params[0] = ctx->Scissor.X;
- params[1] = ctx->Scissor.Y;
- params[2] = ctx->Scissor.Width;
- params[3] = ctx->Scissor.Height;
+ params[0] = (GLint64)(ctx->Scissor.X);
+ params[1] = (GLint64)(ctx->Scissor.Y);
+ params[2] = (GLint64)(ctx->Scissor.Width);
+ params[3] = (GLint64)(ctx->Scissor.Height);
break;
case GL_SCISSOR_TEST:
params[0] = BOOLEAN_TO_INT64(ctx->Scissor.Enabled);
break;
case GL_SELECTION_BUFFER_SIZE:
- params[0] = ctx->Select.BufferSize;
+ params[0] = (GLint64)(ctx->Select.BufferSize);
break;
case GL_SHADE_MODEL:
params[0] = ENUM_TO_INT64(ctx->Light.ShadeModel);
@@ -6332,10 +6332,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = BOOLEAN_TO_INT64(ctx->Texture.SharedPalette);
break;
case GL_STENCIL_BITS:
- params[0] = ctx->DrawBuffer->Visual.stencilBits;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.stencilBits);
break;
case GL_STENCIL_CLEAR_VALUE:
- params[0] = ctx->Stencil.Clear;
+ params[0] = (GLint64)(ctx->Stencil.Clear);
break;
case GL_STENCIL_FAIL:
params[0] = ENUM_TO_INT64(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
@@ -6350,22 +6350,22 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = ENUM_TO_INT64(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- params[0] = ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
+ params[0] = (GLint64)(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_TEST:
params[0] = BOOLEAN_TO_INT64(ctx->Stencil.Enabled);
break;
case GL_STENCIL_VALUE_MASK:
- params[0] = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
+ params[0] = (GLint64)(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_WRITEMASK:
- params[0] = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
+ params[0] = (GLint64)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
break;
case GL_STEREO:
params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.stereoMode);
break;
case GL_SUBPIXEL_BITS:
- params[0] = ctx->Const.SubPixelBits;
+ params[0] = (GLint64)(ctx->Const.SubPixelBits);
break;
case GL_TEXTURE_1D:
params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_1D));
@@ -6385,21 +6385,21 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT));
break;
case GL_TEXTURE_BINDING_1D:
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name);
break;
case GL_TEXTURE_BINDING_2D:
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name);
break;
case GL_TEXTURE_BINDING_3D:
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name);
break;
case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
CHECK_EXT1(MESA_texture_array, "GetInteger64v");
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name);
break;
case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
CHECK_EXT1(MESA_texture_array, "GetInteger64v");
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name);
break;
case GL_TEXTURE_GEN_S:
params[0] = BOOLEAN_TO_INT64(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0));
@@ -6435,40 +6435,40 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
}
break;
case GL_TEXTURE_STACK_DEPTH:
- params[0] = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1;
+ params[0] = (GLint64)(ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
- params[0] = ctx->Unpack.Alignment;
+ params[0] = (GLint64)(ctx->Unpack.Alignment);
break;
case GL_UNPACK_LSB_FIRST:
params[0] = BOOLEAN_TO_INT64(ctx->Unpack.LsbFirst);
break;
case GL_UNPACK_ROW_LENGTH:
- params[0] = ctx->Unpack.RowLength;
+ params[0] = (GLint64)(ctx->Unpack.RowLength);
break;
case GL_UNPACK_SKIP_PIXELS:
- params[0] = ctx->Unpack.SkipPixels;
+ params[0] = (GLint64)(ctx->Unpack.SkipPixels);
break;
case GL_UNPACK_SKIP_ROWS:
- params[0] = ctx->Unpack.SkipRows;
+ params[0] = (GLint64)(ctx->Unpack.SkipRows);
break;
case GL_UNPACK_SWAP_BYTES:
params[0] = BOOLEAN_TO_INT64(ctx->Unpack.SwapBytes);
break;
case GL_UNPACK_SKIP_IMAGES_EXT:
- params[0] = ctx->Unpack.SkipImages;
+ params[0] = (GLint64)(ctx->Unpack.SkipImages);
break;
case GL_UNPACK_IMAGE_HEIGHT_EXT:
- params[0] = ctx->Unpack.ImageHeight;
+ params[0] = (GLint64)(ctx->Unpack.ImageHeight);
break;
case GL_UNPACK_CLIENT_STORAGE_APPLE:
params[0] = BOOLEAN_TO_INT64(ctx->Unpack.ClientStorage);
break;
case GL_VIEWPORT:
- params[0] = ctx->Viewport.X;
- params[1] = ctx->Viewport.Y;
- params[2] = ctx->Viewport.Width;
- params[3] = ctx->Viewport.Height;
+ params[0] = (GLint64)(ctx->Viewport.X);
+ params[1] = (GLint64)(ctx->Viewport.Y);
+ params[2] = (GLint64)(ctx->Viewport.Width);
+ params[3] = (GLint64)(ctx->Viewport.Height);
break;
case GL_ZOOM_X:
params[0] = IROUND64(ctx->Pixel.ZoomX);
@@ -6480,16 +6480,16 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Vertex.Enabled);
break;
case GL_VERTEX_ARRAY_SIZE:
- params[0] = ctx->Array.ArrayObj->Vertex.Size;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.Size);
break;
case GL_VERTEX_ARRAY_TYPE:
params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Vertex.Type);
break;
case GL_VERTEX_ARRAY_STRIDE:
- params[0] = ctx->Array.ArrayObj->Vertex.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.Stride);
break;
case GL_VERTEX_ARRAY_COUNT_EXT:
- params[0] = 0;
+ params[0] = (GLint64)(0);
break;
case GL_NORMAL_ARRAY:
params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Normal.Enabled);
@@ -6498,25 +6498,25 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Normal.Type);
break;
case GL_NORMAL_ARRAY_STRIDE:
- params[0] = ctx->Array.ArrayObj->Normal.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Normal.Stride);
break;
case GL_NORMAL_ARRAY_COUNT_EXT:
- params[0] = 0;
+ params[0] = (GLint64)(0);
break;
case GL_COLOR_ARRAY:
params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Color.Enabled);
break;
case GL_COLOR_ARRAY_SIZE:
- params[0] = ctx->Array.ArrayObj->Color.Size;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Color.Size);
break;
case GL_COLOR_ARRAY_TYPE:
params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Color.Type);
break;
case GL_COLOR_ARRAY_STRIDE:
- params[0] = ctx->Array.ArrayObj->Color.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Color.Stride);
break;
case GL_COLOR_ARRAY_COUNT_EXT:
- params[0] = 0;
+ params[0] = (GLint64)(0);
break;
case GL_INDEX_ARRAY:
params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Index.Enabled);
@@ -6525,46 +6525,46 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Index.Type);
break;
case GL_INDEX_ARRAY_STRIDE:
- params[0] = ctx->Array.ArrayObj->Index.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Index.Stride);
break;
case GL_INDEX_ARRAY_COUNT_EXT:
- params[0] = 0;
+ params[0] = (GLint64)(0);
break;
case GL_TEXTURE_COORD_ARRAY:
params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled);
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size);
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride);
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
- params[0] = 0;
+ params[0] = (GLint64)(0);
break;
case GL_EDGE_FLAG_ARRAY:
params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->EdgeFlag.Enabled);
break;
case GL_EDGE_FLAG_ARRAY_STRIDE:
- params[0] = ctx->Array.ArrayObj->EdgeFlag.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->EdgeFlag.Stride);
break;
case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
- params[0] = 0;
+ params[0] = (GLint64)(0);
break;
case GL_MAX_TEXTURE_UNITS_ARB:
CHECK_EXT1(ARB_multitexture, "GetInteger64v");
- params[0] = ctx->Const.MaxTextureUnits;
+ params[0] = (GLint64)(ctx->Const.MaxTextureUnits);
break;
case GL_ACTIVE_TEXTURE_ARB:
CHECK_EXT1(ARB_multitexture, "GetInteger64v");
- params[0] = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
+ params[0] = (GLint64)(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
CHECK_EXT1(ARB_multitexture, "GetInteger64v");
- params[0] = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
+ params[0] = (GLint64)(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
case GL_TEXTURE_CUBE_MAP_ARB:
CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v");
@@ -6572,17 +6572,17 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v");
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name);
break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v");
- params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ params[0] = (GLint64)((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
break;
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- params[0] = ctx->Hint.TextureCompression;
+ params[0] = (GLint64)(ctx->Hint.TextureCompression);
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE);
+ params[0] = (GLint64)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
{
@@ -6595,11 +6595,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
CHECK_EXT1(EXT_compiled_vertex_array, "GetInteger64v");
- params[0] = ctx->Array.LockFirst;
+ params[0] = (GLint64)(ctx->Array.LockFirst);
break;
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
CHECK_EXT1(EXT_compiled_vertex_array, "GetInteger64v");
- params[0] = ctx->Array.LockCount;
+ params[0] = (GLint64)(ctx->Array.LockCount);
break;
case GL_TRANSPOSE_COLOR_MATRIX_ARB:
{
@@ -6707,10 +6707,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- params[0] = ctx->ColorMatrixStack.Depth + 1;
+ params[0] = (GLint64)(ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
- params[0] = MAX_COLOR_STACK_DEPTH;
+ params[0] = (GLint64)(MAX_COLOR_STACK_DEPTH);
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
params[0] = IROUND64(ctx->Pixel.PostColorMatrixScale[0]);
@@ -6828,11 +6828,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
- params[0] = ctx->Array.ArrayObj->SecondaryColor.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.Stride);
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
- params[0] = ctx->Array.ArrayObj->SecondaryColor.Size;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.Size);
break;
case GL_CURRENT_FOG_COORDINATE_EXT:
CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
@@ -6851,7 +6851,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
- params[0] = ctx->Array.ArrayObj->FogCoord.Stride;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->FogCoord.Stride);
break;
case GL_FOG_COORDINATE_SOURCE_EXT:
CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
@@ -6884,10 +6884,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = BOOLEAN_TO_INT64(ctx->Multisample.SampleCoverageInvert);
break;
case GL_SAMPLE_BUFFERS_ARB:
- params[0] = ctx->DrawBuffer->Visual.sampleBuffers;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.sampleBuffers);
break;
case GL_SAMPLES_ARB:
- params[0] = ctx->DrawBuffer->Visual.samples;
+ params[0] = (GLint64)(ctx->DrawBuffer->Visual.samples);
break;
case GL_RASTER_POSITION_UNCLIPPED_IBM:
CHECK_EXT1(IBM_rasterpos_clip, "GetInteger64v");
@@ -6911,7 +6911,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_VERTEX_PROGRAM_BINDING_NV:
CHECK_EXT1(NV_vertex_program, "GetInteger64v");
- params[0] = (ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0);
+ params[0] = (GLint64)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0));
break;
case GL_VERTEX_ATTRIB_ARRAY0_NV:
CHECK_EXT1(NV_vertex_program, "GetInteger64v");
@@ -7047,11 +7047,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_FRAGMENT_PROGRAM_BINDING_NV:
CHECK_EXT1(NV_fragment_program, "GetInteger64v");
- params[0] = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0;
+ params[0] = (GLint64)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0);
break;
case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
CHECK_EXT1(NV_fragment_program, "GetInteger64v");
- params[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
+ params[0] = (GLint64)(MAX_NV_FRAGMENT_PROGRAM_PARAMS);
break;
case GL_TEXTURE_RECTANGLE_NV:
CHECK_EXT1(NV_texture_rectangle, "GetInteger64v");
@@ -7059,11 +7059,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_TEXTURE_BINDING_RECTANGLE_NV:
CHECK_EXT1(NV_texture_rectangle, "GetInteger64v");
- params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name;
+ params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name);
break;
case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
CHECK_EXT1(NV_texture_rectangle, "GetInteger64v");
- params[0] = ctx->Const.MaxTextureRectSize;
+ params[0] = (GLint64)(ctx->Const.MaxTextureRectSize);
break;
case GL_STENCIL_TEST_TWO_SIDE_EXT:
CHECK_EXT1(EXT_stencil_two_side, "GetInteger64v");
@@ -7082,42 +7082,42 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[0] = IROUND64(ctx->Const.MaxSpotExponent);
break;
case GL_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayBufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayBufferObj->Name);
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.BufferObj->Name);
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Normal.BufferObj->Name);
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Color.BufferObj->Name);
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Index.BufferObj->Name);
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name);
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name);
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name);
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name);
break;
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
- params[0] = ctx->Array.ElementArrayBufferObj->Name;
+ params[0] = (GLint64)(ctx->Array.ElementArrayBufferObj->Name);
break;
case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
CHECK_EXT1(EXT_pixel_buffer_object, "GetInteger64v");
- params[0] = ctx->Pack.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Pack.BufferObj->Name);
break;
case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
CHECK_EXT1(EXT_pixel_buffer_object, "GetInteger64v");
- params[0] = ctx->Unpack.BufferObj->Name;
+ params[0] = (GLint64)(ctx->Unpack.BufferObj->Name);
break;
case GL_VERTEX_PROGRAM_ARB:
CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetInteger64v");
@@ -7133,11 +7133,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB:
CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v");
- params[0] = ctx->Const.MaxProgramMatrixStackDepth;
+ params[0] = (GLint64)(ctx->Const.MaxProgramMatrixStackDepth);
break;
case GL_MAX_PROGRAM_MATRICES_ARB:
CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v");
- params[0] = ctx->Const.MaxProgramMatrices;
+ params[0] = (GLint64)(ctx->Const.MaxProgramMatrices);
break;
case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v");
@@ -7189,11 +7189,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_MAX_VERTEX_ATTRIBS_ARB:
CHECK_EXT1(ARB_vertex_program, "GetInteger64v");
- params[0] = ctx->Const.VertexProgram.MaxAttribs;
+ params[0] = (GLint64)(ctx->Const.VertexProgram.MaxAttribs);
break;
case GL_PROGRAM_ERROR_POSITION_ARB:
CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetInteger64v");
- params[0] = ctx->Program.ErrorPos;
+ params[0] = (GLint64)(ctx->Program.ErrorPos);
break;
case GL_FRAGMENT_PROGRAM_ARB:
CHECK_EXT1(ARB_fragment_program, "GetInteger64v");
@@ -7201,11 +7201,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_MAX_TEXTURE_COORDS_ARB:
CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetInteger64v");
- params[0] = ctx->Const.MaxTextureCoordUnits;
+ params[0] = (GLint64)(ctx->Const.MaxTextureCoordUnits);
break;
case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetInteger64v");
- params[0] = ctx->Const.MaxTextureImageUnits;
+ params[0] = (GLint64)(ctx->Const.MaxTextureImageUnits);
break;
case GL_DEPTH_BOUNDS_TEST_EXT:
CHECK_EXT1(EXT_depth_bounds_test, "GetInteger64v");
@@ -7217,7 +7217,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
params[1] = IROUND64(ctx->Depth.BoundsMax);
break;
case GL_MAX_DRAW_BUFFERS_ARB:
- params[0] = ctx->Const.MaxDrawBuffers;
+ params[0] = (GLint64)(ctx->Const.MaxDrawBuffers);
break;
case GL_DRAW_BUFFER0_ARB:
params[0] = ENUM_TO_INT64(ctx->DrawBuffer->ColorDrawBuffer[0]);
@@ -7257,31 +7257,31 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
CHECK_EXT1(OES_read_format, "GetInteger64v");
- params[0] = ctx->Const.ColorReadType;
+ params[0] = (GLint64)(ctx->Const.ColorReadType);
break;
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
CHECK_EXT1(OES_read_format, "GetInteger64v");
- params[0] = ctx->Const.ColorReadFormat;
+ params[0] = (GLint64)(ctx->Const.ColorReadFormat);
break;
case GL_NUM_FRAGMENT_REGISTERS_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 6;
+ params[0] = (GLint64)(6);
break;
case GL_NUM_FRAGMENT_CONSTANTS_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 8;
+ params[0] = (GLint64)(8);
break;
case GL_NUM_PASSES_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 2;
+ params[0] = (GLint64)(2);
break;
case GL_NUM_INSTRUCTIONS_PER_PASS_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 8;
+ params[0] = (GLint64)(8);
break;
case GL_NUM_INSTRUCTIONS_TOTAL_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 16;
+ params[0] = (GLint64)(16);
break;
case GL_COLOR_ALPHA_PAIRING_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
@@ -7289,23 +7289,23 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_NUM_LOOPBACK_COMPONENTS_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 3;
+ params[0] = (GLint64)(3);
break;
case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI:
CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
- params[0] = 3;
+ params[0] = (GLint64)(3);
break;
case GL_STENCIL_BACK_FUNC:
params[0] = ENUM_TO_INT64(ctx->Stencil.Function[1]);
break;
case GL_STENCIL_BACK_VALUE_MASK:
- params[0] = ctx->Stencil.ValueMask[1];
+ params[0] = (GLint64)(ctx->Stencil.ValueMask[1]);
break;
case GL_STENCIL_BACK_WRITEMASK:
- params[0] = ctx->Stencil.WriteMask[1];
+ params[0] = (GLint64)(ctx->Stencil.WriteMask[1]);
break;
case GL_STENCIL_BACK_REF:
- params[0] = ctx->Stencil.Ref[1];
+ params[0] = (GLint64)(ctx->Stencil.Ref[1]);
break;
case GL_STENCIL_BACK_FAIL:
params[0] = ENUM_TO_INT64(ctx->Stencil.FailFunc[1]);
@@ -7318,23 +7318,23 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_FRAMEBUFFER_BINDING_EXT:
CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
- params[0] = ctx->DrawBuffer->Name;
+ params[0] = (GLint64)(ctx->DrawBuffer->Name);
break;
case GL_RENDERBUFFER_BINDING_EXT:
CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
- params[0] = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
+ params[0] = (GLint64)(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0);
break;
case GL_MAX_COLOR_ATTACHMENTS_EXT:
CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
- params[0] = ctx->Const.MaxColorAttachments;
+ params[0] = (GLint64)(ctx->Const.MaxColorAttachments);
break;
case GL_MAX_RENDERBUFFER_SIZE_EXT:
CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
- params[0] = ctx->Const.MaxRenderbufferSize;
+ params[0] = (GLint64)(ctx->Const.MaxRenderbufferSize);
break;
case GL_READ_FRAMEBUFFER_BINDING_EXT:
CHECK_EXT1(EXT_framebuffer_blit, "GetInteger64v");
- params[0] = ctx->ReadBuffer->Name;
+ params[0] = (GLint64)(ctx->ReadBuffer->Name);
break;
case GL_PROVOKING_VERTEX_EXT:
CHECK_EXT1(EXT_provoking_vertex, "GetInteger64v");
@@ -7346,7 +7346,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetInteger64v");
- params[0] = ctx->Const.FragmentProgram.MaxUniformComponents;
+ params[0] = (GLint64)(ctx->Const.FragmentProgram.MaxUniformComponents);
break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetInteger64v");
@@ -7354,31 +7354,31 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
break;
case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
- params[0] = ctx->Const.VertexProgram.MaxUniformComponents;
+ params[0] = (GLint64)(ctx->Const.VertexProgram.MaxUniformComponents);
break;
case GL_MAX_VARYING_FLOATS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
- params[0] = ctx->Const.MaxVarying * 4;
+ params[0] = (GLint64)(ctx->Const.MaxVarying * 4);
break;
case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
- params[0] = ctx->Const.MaxVertexTextureImageUnits;
+ params[0] = (GLint64)(ctx->Const.MaxVertexTextureImageUnits);
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
- params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+ params[0] = (GLint64)(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
break;
case GL_CURRENT_PROGRAM:
CHECK_EXT1(ARB_shader_objects, "GetInteger64v");
- params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0;
+ params[0] = (GLint64)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
break;
case GL_MAX_SAMPLES:
CHECK_EXT1(ARB_framebuffer_object, "GetInteger64v");
- params[0] = ctx->Const.MaxSamples;
+ params[0] = (GLint64)(ctx->Const.MaxSamples);
break;
case GL_VERTEX_ARRAY_BINDING_APPLE:
CHECK_EXT1(APPLE_vertex_array_object, "GetInteger64v");
- params[0] = ctx->Array.ArrayObj->Name;
+ params[0] = (GLint64)(ctx->Array.ArrayObj->Name);
break;
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
CHECK_EXT1(ARB_seamless_cube_map, "GetInteger64v");
diff --git a/mesalib/src/mesa/main/histogram.c b/mesalib/src/mesa/main/histogram.c
index ceb0d5a6a..2b3e62c7d 100644
--- a/mesalib/src/mesa/main/histogram.c
+++ b/mesalib/src/mesa/main/histogram.c
@@ -186,16 +186,17 @@ pack_histogram( GLcontext *ctx,
{
/* temporarily store as GLuints */
GLuint temp[4*HISTOGRAM_TABLE_SIZE];
- GLhalfARB *dst = (GLhalfARB *) destination;
+ GLuint *dst = temp;
+ GLhalfARB *half = (GLhalfARB *) destination;
GLuint i;
/* get GLuint values */
PACK_MACRO(GLuint);
/* convert to GLhalf */
for (i = 0; i < n * comps; i++) {
- dst[i] = _mesa_float_to_half((GLfloat) temp[i]);
+ half[i] = _mesa_float_to_half((GLfloat) temp[i]);
}
if (packing->SwapBytes) {
- _mesa_swap2((GLushort *) dst, n * comps);
+ _mesa_swap2((GLushort *) half, n * comps);
}
}
break;
diff --git a/mesalib/src/mesa/main/image.c b/mesalib/src/mesa/main/image.c
index baecbab0a..139e56a96 100644
--- a/mesalib/src/mesa/main/image.c
+++ b/mesalib/src/mesa/main/image.c
@@ -5511,7 +5511,7 @@ _mesa_clip_drawpixels(const GLcontext *ctx,
}
if (*height <= 0)
- return GL_TRUE;
+ return GL_FALSE;
return GL_TRUE;
}
@@ -5564,7 +5564,7 @@ _mesa_clip_readpixels(const GLcontext *ctx,
*height -= (*srcY + *height - buffer->Height);
if (*height <= 0)
- return GL_TRUE;
+ return GL_FALSE;
return GL_TRUE;
}
diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c
index 6ffaddcde..46ffb929b 100644
--- a/mesalib/src/mesa/main/imports.c
+++ b/mesalib/src/mesa/main/imports.c
@@ -48,6 +48,13 @@
#include "context.h"
#include "version.h"
+#ifdef _GNU_SOURCE
+#include <locale.h>
+#ifdef __APPLE__
+#include <xlocale.h>
+#endif
+#endif
+
#define MAXSTRING 4000 /* for vsnprintf() */
@@ -101,8 +108,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
{
#if defined(HAVE_POSIX_MEMALIGN)
void *mem;
-
- (void) posix_memalign(& mem, alignment, bytes);
+ int err = posix_memalign(& mem, alignment, bytes);
+ (void) err;
return mem;
#elif defined(_WIN32) && defined(_MSC_VER)
return _aligned_malloc(bytes, alignment);
@@ -908,7 +915,15 @@ _mesa_atoi(const char *s)
double
_mesa_strtod( const char *s, char **end )
{
+#ifdef _GNU_SOURCE
+ static locale_t loc = NULL;
+ if (!loc) {
+ loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+ }
+ return strtod_l(s, end, loc);
+#else
return strtod(s, end);
+#endif
}
/** Compute simple checksum/hash for a string */
@@ -919,9 +934,9 @@ _mesa_str_checksum(const char *str)
unsigned int sum, i;
const char *c;
sum = i = 1;
- for (c = str; *c; c++)
+ for (c = str; *c; c++, i++)
sum += *c * (i % 100);
- return sum;
+ return sum + i;
}
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index 3dca09d9f..c3928fa51 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -1501,8 +1501,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
GLuint comps;
ASSERT(texObj);
- /* XXX choose cube map face here??? */
- srcImage = texObj->Image[0][texObj->BaseLevel];
+ srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel);
ASSERT(srcImage);
maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
@@ -1510,7 +1509,9 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
/* Find convertFormat - the format that do_row() will process */
if (srcImage->IsCompressed) {
- /* setup for compressed textures */
+ /* setup for compressed textures - need to allocate temporary
+ * image buffers to hold uncompressed images.
+ */
GLuint row;
GLint components, size;
GLchan *dst;
@@ -1587,11 +1588,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
&dstWidth, &dstHeight, &dstDepth);
if (!nextLevel) {
/* all done */
- if (srcImage->IsCompressed) {
- _mesa_free((void *) srcData);
- _mesa_free(dstData);
- }
- return;
+ break;
}
/* get dest gl_texture_image */
@@ -1682,6 +1679,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
}
} /* loop over mipmap levels */
+
+ if (srcImage->IsCompressed) {
+ /* free uncompressed image buffers */
+ _mesa_free((void *) srcData);
+ _mesa_free(dstData);
+ }
}
diff --git a/mesalib/src/mesa/main/renderbuffer.c b/mesalib/src/mesa/main/renderbuffer.c
index 38be8266e..5bef7c84f 100644
--- a/mesalib/src/mesa/main/renderbuffer.c
+++ b/mesalib/src/mesa/main/renderbuffer.c
@@ -1955,7 +1955,7 @@ _mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb,
return GL_FALSE;
}
- assert(numBuffers < MAX_AUX_BUFFERS);
+ assert(numBuffers <= MAX_AUX_BUFFERS);
for (i = 0; i < numBuffers; i++) {
struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, 0);
diff --git a/mesalib/src/mesa/main/syncobj.c b/mesalib/src/mesa/main/syncobj.c
index 64f923ff9..ac3f9eb17 100644
--- a/mesalib/src/mesa/main/syncobj.c
+++ b/mesalib/src/mesa/main/syncobj.c
@@ -190,7 +190,7 @@ _mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj)
}
-GLboolean
+GLboolean GLAPIENTRY
_mesa_IsSync(GLsync sync)
{
GET_CURRENT_CONTEXT(ctx);
@@ -201,7 +201,7 @@ _mesa_IsSync(GLsync sync)
}
-void
+void GLAPIENTRY
_mesa_DeleteSync(GLsync sync)
{
GET_CURRENT_CONTEXT(ctx);
@@ -231,7 +231,7 @@ _mesa_DeleteSync(GLsync sync)
}
-GLsync
+GLsync GLAPIENTRY
_mesa_FenceSync(GLenum condition, GLbitfield flags)
{
GET_CURRENT_CONTEXT(ctx);
@@ -278,7 +278,7 @@ _mesa_FenceSync(GLenum condition, GLbitfield flags)
}
-GLenum
+GLenum GLAPIENTRY
_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
{
GET_CURRENT_CONTEXT(ctx);
@@ -319,7 +319,7 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
}
-void
+void GLAPIENTRY
_mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
{
GET_CURRENT_CONTEXT(ctx);
@@ -348,7 +348,7 @@ _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
}
-void
+void GLAPIENTRY
_mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
GLint *values)
{
diff --git a/mesalib/src/mesa/main/syncobj.h b/mesalib/src/mesa/main/syncobj.h
index fc160af28..f23fa281e 100644
--- a/mesalib/src/mesa/main/syncobj.h
+++ b/mesalib/src/mesa/main/syncobj.h
@@ -48,22 +48,22 @@ _mesa_ref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj);
extern void
_mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj);
-extern GLboolean
+extern GLboolean GLAPIENTRY
_mesa_IsSync(GLsync sync);
-extern void
+extern void GLAPIENTRY
_mesa_DeleteSync(GLsync sync);
-extern GLsync
+extern GLsync GLAPIENTRY
_mesa_FenceSync(GLenum condition, GLbitfield flags);
-extern GLenum
+extern GLenum GLAPIENTRY
_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-extern void
+extern void GLAPIENTRY
_mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-extern void
+extern void GLAPIENTRY
_mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
GLint *values);
diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c
index c1b8c7675..2cda4dd85 100644
--- a/mesalib/src/mesa/main/texcompress.c
+++ b/mesalib/src/mesa/main/texcompress.c
@@ -360,3 +360,53 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
return addr;
}
+
+
+/**
+ * Given a compressed MESA_FORMAT_x value, return the corresponding
+ * GLenum for that format.
+ * This is needed for glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT)
+ * which must return the specific texture format used when the user might
+ * have originally specified a generic compressed format in their
+ * glTexImage2D() call.
+ * For non-compressed textures, we always return the user-specified
+ * internal format unchanged.
+ */
+GLenum
+_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat)
+{
+ switch (mesaFormat) {
+#if FEATURE_texture_fxt1
+ case MESA_FORMAT_RGB_FXT1:
+ return GL_COMPRESSED_RGB_FXT1_3DFX;
+ case MESA_FORMAT_RGBA_FXT1:
+ return GL_COMPRESSED_RGBA_FXT1_3DFX;
+#endif
+#if FEATURE_texture_s3tc
+ case MESA_FORMAT_RGB_DXT1:
+ return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ case MESA_FORMAT_RGBA_DXT1:
+ return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ case MESA_FORMAT_RGBA_DXT3:
+ return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ case MESA_FORMAT_RGBA_DXT5:
+ return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SRGB_DXT1:
+ return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
+ case MESA_FORMAT_SRGBA_DXT1:
+ return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ case MESA_FORMAT_SRGBA_DXT3:
+ return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+ case MESA_FORMAT_SRGBA_DXT5:
+ return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+#endif
+#endif
+ default:
+ _mesa_problem(ctx, "Unexpected mesa texture format in"
+ " _mesa_compressed_format_to_glenum()");
+ return 0;
+ }
+}
+
+
diff --git a/mesalib/src/mesa/main/texcompress.h b/mesalib/src/mesa/main/texcompress.h
index 44f333822..0f1a38f88 100644
--- a/mesalib/src/mesa/main/texcompress.h
+++ b/mesalib/src/mesa/main/texcompress.h
@@ -52,6 +52,10 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
GLsizei width, const GLubyte *image);
+extern GLenum
+_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat);
+
+
extern void
_mesa_init_texture_s3tc( GLcontext *ctx );
diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c
index c70900478..9d5534e39 100644
--- a/mesalib/src/mesa/main/texformat.c
+++ b/mesalib/src/mesa/main/texformat.c
@@ -1590,25 +1590,25 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
case GL_COMPRESSED_INTENSITY_ARB:
return &_mesa_texformat_intensity;
case GL_COMPRESSED_RGB_ARB:
-#if FEATURE_texture_fxt1
- if (ctx->Extensions.TDFX_texture_compression_FXT1)
- return &_mesa_texformat_rgb_fxt1;
-#endif
#if FEATURE_texture_s3tc
if (ctx->Extensions.EXT_texture_compression_s3tc ||
ctx->Extensions.S3_s3tc)
return &_mesa_texformat_rgb_dxt1;
#endif
- return &_mesa_texformat_rgb;
- case GL_COMPRESSED_RGBA_ARB:
#if FEATURE_texture_fxt1
if (ctx->Extensions.TDFX_texture_compression_FXT1)
- return &_mesa_texformat_rgba_fxt1;
+ return &_mesa_texformat_rgb_fxt1;
#endif
+ return &_mesa_texformat_rgb;
+ case GL_COMPRESSED_RGBA_ARB:
#if FEATURE_texture_s3tc
if (ctx->Extensions.EXT_texture_compression_s3tc ||
ctx->Extensions.S3_s3tc)
- return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */
+ return &_mesa_texformat_rgba_dxt5; /* Not rgba_dxt1, see spec */
+#endif
+#if FEATURE_texture_fxt1
+ if (ctx->Extensions.TDFX_texture_compression_FXT1)
+ return &_mesa_texformat_rgba_fxt1;
#endif
return &_mesa_texformat_rgba;
default:
diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c
index d09c43925..da55ac869 100644
--- a/mesalib/src/mesa/main/texobj.c
+++ b/mesalib/src/mesa/main/texobj.c
@@ -863,7 +863,7 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
if (texObj == unit->CurrentTex[tex]) {
_mesa_reference_texobj(&unit->CurrentTex[tex],
- ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]);
+ ctx->Shared->DefaultTex[tex]);
ASSERT(unit->CurrentTex[tex]);
break;
}
diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c
index b2fbe2205..9d1fdd056 100644
--- a/mesalib/src/mesa/main/texparam.c
+++ b/mesalib/src/mesa/main/texparam.c
@@ -776,7 +776,15 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = img->Depth;
break;
case GL_TEXTURE_INTERNAL_FORMAT:
- *params = img->InternalFormat;
+ if (img->IsCompressed) {
+ /* need to return the actual compressed format */
+ *params = _mesa_compressed_format_to_glenum(ctx,
+ img->TexFormat->MesaFormat);
+ }
+ else {
+ /* return the user's requested internal format */
+ *params = img->InternalFormat;
+ }
break;
case GL_TEXTURE_BORDER:
*params = img->Border;
diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c
index 861c5f37c..8292d43eb 100644
--- a/mesalib/src/mesa/main/texstate.c
+++ b/mesalib/src/mesa/main/texstate.c
@@ -99,16 +99,22 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget;
COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix);
+ /*
+ * XXX strictly speaking, we should compare texture names/ids and
+ * bind textures in the dest context according to id. For now, only
+ * copy bindings if the contexts share the same pool of textures to
+ * avoid refcounting bugs.
+ */
+ if (dst->Shared == src->Shared) {
+ /* copy texture object bindings, not contents of texture objects */
+ _mesa_lock_context_textures(dst);
- /* copy texture object bindings, not contents of texture objects */
- _mesa_lock_context_textures(dst);
-
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
- src->Texture.Unit[u].CurrentTex[tex]);
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
+ src->Texture.Unit[u].CurrentTex[tex]);
+ }
+ _mesa_unlock_context_textures(dst);
}
-
- _mesa_unlock_context_textures(dst);
}
}
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index a22db628d..d3237959e 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -589,8 +589,12 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
/* unpack and transfer the source image */
tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth
* components * sizeof(GLchan));
- if (!tempImage)
+ if (!tempImage) {
+ if (freeSrcImage) {
+ _mesa_free((void *) srcAddr);
+ }
return NULL;
+ }
dst = tempImage;
for (img = 0; img < srcDepth; img++) {
diff --git a/mesalib/src/mesa/main/version.h b/mesalib/src/mesa/main/version.h
index 0ccdbf94a..3e9143979 100644
--- a/mesalib/src/mesa/main/version.h
+++ b/mesalib/src/mesa/main/version.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 7.6
+ * Version: 7.6.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
* Copyright (C) 2009 VMware, Inc. All Rights Reserved.
@@ -31,8 +31,8 @@
/* Mesa version */
#define MESA_MAJOR 7
#define MESA_MINOR 6
-#define MESA_PATCH 0
-#define MESA_VERSION_STRING "7.6"
+#define MESA_PATCH 1
+#define MESA_VERSION_STRING "7.6.1-rc1"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))