summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authormichal <michal@michal-laptop.(none)>2007-07-27 10:05:40 +0200
committermichal <michal@michal-laptop.(none)>2007-07-27 10:05:40 +0200
commite0a26b046764ae80748b347395ab1b27de83651e (patch)
treeea702756a3e9cedc3b3c41241cbff0956ddc82bc /src/mesa/main
parent0360b49afbcd839f99ba0745d01cf9dc5be4d122 (diff)
parente3cef5887540016a6d198598cb50bebe09e3f4cf (diff)
Merge branch 'master' of git+ssh://michal@git.freedesktop.org/git/mesa/mesa into softpipe_0_1_branch
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/attrib.c4
-rw-r--r--src/mesa/main/buffers.c65
-rw-r--r--src/mesa/main/buffers.h3
-rw-r--r--src/mesa/main/context.c7
-rw-r--r--src/mesa/main/dd.h2
-rw-r--r--src/mesa/main/fbobject.c27
-rw-r--r--src/mesa/main/framebuffer.c37
-rw-r--r--src/mesa/main/glheader.h2
-rw-r--r--src/mesa/main/imports.c4
-rw-r--r--src/mesa/main/imports.h4
-rw-r--r--src/mesa/main/lines.c8
-rw-r--r--src/mesa/main/mtypes.h39
-rw-r--r--src/mesa/main/points.c5
-rw-r--r--src/mesa/main/shaders.c8
-rw-r--r--src/mesa/main/state.c4
-rw-r--r--src/mesa/main/texcompress_fxt1.c5
16 files changed, 142 insertions, 82 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 1aa0a02fc7..b422198f92 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -98,9 +98,13 @@ _mesa_PushAttrib(GLbitfield mask)
}
if (mask & GL_COLOR_BUFFER_BIT) {
+ GLuint i;
struct gl_colorbuffer_attrib *attr;
attr = MALLOC_STRUCT( gl_colorbuffer_attrib );
MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) );
+ /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++)
+ attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i];
newnode = new_attrib_node( GL_COLOR_BUFFER_BIT );
newnode->data = attr;
newnode->next = head;
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index c280f89e1d..0e6ca8ea1c 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -370,6 +370,14 @@ _mesa_DrawBuffer(GLenum buffer)
/* if we get here, there's no error so set new state */
_mesa_drawbuffers(ctx, 1, &buffer, &destMask);
+
+ /*
+ * Call device driver function.
+ */
+ if (ctx->Driver.DrawBuffers)
+ ctx->Driver.DrawBuffers(ctx, 1, &buffer);
+ else if (ctx->Driver.DrawBuffer)
+ ctx->Driver.DrawBuffer(ctx, buffer);
}
@@ -435,6 +443,14 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
/* OK, if we get here, there were no errors so set the new state */
_mesa_drawbuffers(ctx, n, buffers, destMask);
+
+ /*
+ * Call device driver function.
+ */
+ if (ctx->Driver.DrawBuffers)
+ ctx->Driver.DrawBuffers(ctx, n, buffers);
+ else if (ctx->Driver.DrawBuffer)
+ ctx->Driver.DrawBuffer(ctx, buffers[0]);
}
@@ -463,14 +479,15 @@ set_color_output(GLcontext *ctx, GLuint output, GLenum buffer,
/* not really needed, will be set later */
fb->_NumColorDrawBuffers[output] = 0;
+ if (fb->Name == 0)
/* Set traditional state var */
- ctx->Color.DrawBuffer[output] = buffer;
+ ctx->Color.DrawBuffer[output] = buffer;
}
/**
* Helper routine used by _mesa_DrawBuffer, _mesa_DrawBuffersARB and
- * _mesa_PopAttrib to set drawbuffer state.
+ * other places (window fbo fixup) to set fbo (and the old ctx) fields.
* All error checking will have been done prior to calling this function
* so nothing should go wrong at this point.
* \param ctx current context
@@ -509,30 +526,15 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
}
ctx->NewState |= _NEW_COLOR;
-
- /*
- * Call device driver function.
- */
- if (ctx->Driver.DrawBuffers)
- ctx->Driver.DrawBuffers(ctx, n, buffers);
- else if (ctx->Driver.DrawBuffer)
- ctx->Driver.DrawBuffer(ctx, buffers[0]);
}
-
-/**
- * Called by glReadBuffer to set the source renderbuffer for reading pixels.
- * \param mode color buffer such as GL_FRONT, GL_BACK, etc.
- */
-void GLAPIENTRY
-_mesa_ReadBuffer(GLenum buffer)
+GLboolean
+_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer)
{
struct gl_framebuffer *fb;
GLbitfield supportedMask;
GLint srcBuffer;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
fb = ctx->ReadBuffer;
@@ -548,12 +550,12 @@ _mesa_ReadBuffer(GLenum buffer)
srcBuffer = read_buffer_enum_to_index(buffer);
if (srcBuffer == -1) {
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer=0x%x)", buffer);
- return;
+ return GL_FALSE;
}
supportedMask = supported_buffer_bitmask(ctx, fb);
if (((1 << srcBuffer) & supportedMask) == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer=0x%x)", buffer);
- return;
+ return GL_FALSE;
}
}
@@ -563,6 +565,27 @@ _mesa_ReadBuffer(GLenum buffer)
fb->ColorReadBuffer = buffer;
fb->_ColorReadBufferIndex = srcBuffer;
+ return GL_TRUE;
+}
+
+
+
+/**
+ * Called by glReadBuffer to set the source renderbuffer for reading pixels.
+ * \param mode color buffer such as GL_FRONT, GL_BACK, etc.
+ */
+void GLAPIENTRY
+_mesa_ReadBuffer(GLenum buffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
+
+ if (!_mesa_readbuffer_update_fields(ctx, buffer))
+ return;
+
ctx->NewState |= _NEW_PIXEL;
/*
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index fcc2152342..208e7af2b9 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -56,6 +56,9 @@ extern void
_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
const GLbitfield *destMask);
+extern GLboolean
+_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer);
+
extern void GLAPIENTRY
_mesa_ReadBuffer( GLenum mode );
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 2ad1badac7..00e4c8328e 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1496,9 +1496,8 @@ _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!?! */
+ if the DRIdrawable changes, and everything relies on them.
+ This is a bit messy (same as needed in _mesa_BindFramebufferEXT) */
int i;
GLenum buffers[MAX_DRAW_BUFFERS];
for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
@@ -1508,7 +1507,7 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
}
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
- _mesa_ReadBuffer(newCtx->Pixel.ReadBuffer);
+ _mesa_readbuffer_update_fields(newCtx, newCtx->Pixel.ReadBuffer);
}
newCtx->NewState |= _NEW_BUFFERS;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 88f33943b3..caa50dd682 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -782,7 +782,7 @@ struct dd_function_table {
struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name);
struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name);
void (*BindFramebuffer)(GLcontext *ctx, GLenum target,
- struct gl_framebuffer *fb);
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread);
void (*FramebufferRenderbuffer)(GLcontext *ctx,
struct gl_framebuffer *fb,
GLenum attachment,
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index e3bada5ae8..6f7effcce7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -29,6 +29,7 @@
*/
+#include "buffers.h"
#include "context.h"
#include "fbobject.h"
#include "framebuffer.h"
@@ -924,7 +925,7 @@ check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb)
void GLAPIENTRY
_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
{
- struct gl_framebuffer *newFb;
+ struct gl_framebuffer *newFb, *newFbread;
GLboolean bindReadBuf, bindDrawBuf;
GET_CURRENT_CONTEXT(ctx);
@@ -984,12 +985,14 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
}
_mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb);
}
+ newFbread = newFb;
}
else {
/* Binding the window system framebuffer (which was originally set
* with MakeCurrent).
*/
newFb = ctx->WinSysDrawBuffer;
+ newFbread = ctx->WinSysReadBuffer;
}
ASSERT(newFb);
@@ -999,8 +1002,16 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
* XXX check if re-binding same buffer and skip some of this code.
*/
+ /* for window-framebuffers, re-initialize the fbo values, as they
+ could be wrong (makecurrent with a new drawable while still a fbo
+ was bound will lead to default init fbo values).
+ note that therefore the context ReadBuffer/DrawBuffer values are not
+ valid while fbo's are bound!!! */
if (bindReadBuf) {
- _mesa_reference_framebuffer(&ctx->ReadBuffer, newFb);
+ _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread);
+ if (!newFbread->Name) {
+ _mesa_readbuffer_update_fields(ctx, ctx->Pixel.ReadBuffer);
+ }
}
if (bindDrawBuf) {
@@ -1008,14 +1019,22 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
check_end_texture_render(ctx, ctx->DrawBuffer);
/* check if time to delete this framebuffer */
_mesa_reference_framebuffer(&ctx->DrawBuffer, newFb);
- if (newFb->Name != 0) {
+ if (!newFb->Name) {
+ GLuint i;
+ GLenum buffers[MAX_DRAW_BUFFERS];
+ for(i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ buffers[i] = ctx->Color.DrawBuffer[i];
+ }
+ _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL);
+ }
+ else {
/* check if newly bound framebuffer has any texture attachments */
check_begin_texture_render(ctx, newFb);
}
}
if (ctx->Driver.BindFramebuffer) {
- ctx->Driver.BindFramebuffer(ctx, target, newFb);
+ ctx->Driver.BindFramebuffer(ctx, target, newFb, newFbread);
}
}
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index dc10d9ffbc..c9b30d3252 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -654,6 +654,27 @@ update_color_read_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
}
+static void
+update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
+{
+ /* Completeness only matters for user-created framebuffers */
+ if (fb->Name != 0) {
+ /* XXX: EXT_framebuffer_blit:
+ framebuffer must still be complete wrt read/draw? */
+ _mesa_test_framebuffer_completeness(ctx, fb);
+ _mesa_update_framebuffer_visual(fb);
+ }
+
+ /* update_color_draw/read_buffers not needed for
+ read/draw only fb, but shouldn't hurt ??? */
+ update_color_draw_buffers(ctx, fb);
+ update_color_read_buffer(ctx, fb);
+ _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
+ _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
+
+ compute_depth_max(fb);
+}
+
/**
* Update state related to the current draw/read framebuffers.
* Specifically, update these framebuffer fields:
@@ -671,19 +692,11 @@ void
_mesa_update_framebuffer(GLcontext *ctx)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_framebuffer *fbread = ctx->ReadBuffer;
- /* Completeness only matters for user-created framebuffers */
- if (fb->Name != 0) {
- _mesa_test_framebuffer_completeness(ctx, fb);
- _mesa_update_framebuffer_visual(fb);
- }
-
- update_color_draw_buffers(ctx, fb);
- update_color_read_buffer(ctx, fb);
- _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
- _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
-
- compute_depth_max(fb);
+ update_framebuffer(ctx, fb);
+ if (fbread != fb)
+ update_framebuffer(ctx, fbread);
}
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 63dd002a41..fd4127558a 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -92,7 +92,7 @@
#endif
#ifdef WGLAPI
-#undef WGLAPI
+# undef WGLAPI
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 8a5dfdb4b8..3ae56c8b0b 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -575,7 +575,11 @@ _mesa_ffs(int i)
* if no bits set.
*/
int
+#ifdef __MINGW32__
+_mesa_ffsll(long val)
+#else
_mesa_ffsll(long long val)
+#endif
{
#ifdef ffsll
return ffsll(val);
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 9be8014a13..ebdfc452a7 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -700,7 +700,11 @@ extern int
_mesa_ffs(int i);
extern int
+#ifdef __MINGW32__
+_mesa_ffsll(long i);
+#else
_mesa_ffsll(long long i);
+#endif
extern unsigned int
_mesa_bitcount(unsigned int n);
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index dc7195d4eb..0c2dbf915a 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -55,9 +55,6 @@ _mesa_LineWidth( GLfloat width )
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.Width = width;
- ctx->Line._Width = CLAMP(width,
- ctx->Const.MinLineWidth,
- ctx->Const.MaxLineWidth);
if (ctx->Driver.LineWidth)
ctx->Driver.LineWidth(ctx, width);
@@ -105,13 +102,12 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
* Initializes __GLcontextRec::Line and line related constants in
* __GLcontextRec::Const.
*/
-void GLAPIENTRY _mesa_init_line( GLcontext * ctx )
+void GLAPIENTRY
+_mesa_init_line( GLcontext * ctx )
{
- /* Line group */
ctx->Line.SmoothFlag = GL_FALSE;
ctx->Line.StippleFlag = GL_FALSE;
ctx->Line.Width = 1.0;
- ctx->Line._Width = 1.0;
ctx->Line.StipplePattern = 0xffff;
ctx->Line.StippleFactor = 1;
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index c150aae4d7..52448ee04e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -918,7 +918,6 @@ struct gl_line_attrib
GLushort StipplePattern; /**< Stipple pattern */
GLint StippleFactor; /**< Stipple repeat factor */
GLfloat Width; /**< Line width */
- GLfloat _Width; /**< Clamped Line width */
};
@@ -1064,7 +1063,6 @@ struct gl_point_attrib
{
GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */
GLfloat Size; /**< User-specified point size */
- GLfloat _Size; /**< Size clamped to Const.Min/MaxPointSize */
GLfloat Params[3]; /**< GL_EXT_point_parameters */
GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */
GLfloat Threshold; /**< GL_EXT_point_parameters */
@@ -1134,13 +1132,13 @@ struct gl_stencil_attrib
* An index for each type of texture object
*/
/*@{*/
-#define TEXTURE_1D_INDEX 0
-#define TEXTURE_2D_INDEX 1
-#define TEXTURE_3D_INDEX 2
-#define TEXTURE_CUBE_INDEX 3
-#define TEXTURE_RECT_INDEX 4
-#define TEXTURE_1D_ARRAY_INDEX 5
-#define TEXTURE_2D_ARRAY_INDEX 6
+#define TEXTURE_1D_INDEX 0
+#define TEXTURE_2D_INDEX 1
+#define TEXTURE_3D_INDEX 2
+#define TEXTURE_CUBE_INDEX 3
+#define TEXTURE_RECT_INDEX 4
+#define TEXTURE_1D_ARRAY_INDEX 5
+#define TEXTURE_2D_ARRAY_INDEX 6
/*@}*/
/**
@@ -1148,13 +1146,13 @@ struct gl_stencil_attrib
* Used for Texture.Unit[]._ReallyEnabled flags.
*/
/*@{*/
-#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
-#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
-#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
-#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
-#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
-#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
-#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
+#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
+#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
+#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
+#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
+#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
+#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
+#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
/*@}*/
@@ -1328,8 +1326,6 @@ struct gl_texture_format
};
-#define MAX_3D_TEXTURE_SIZE (1 << (MAX_3D_TEXTURE_LEVELS - 1))
-
/**
* Texture image state. Describes the dimensions of a texture image,
* the texel format and pointers to Texel Fetch functions.
@@ -1394,7 +1390,7 @@ struct gl_texture_image
#define FACE_NEG_Y 3
#define FACE_POS_Z 4
#define FACE_NEG_Z 5
-#define MAX_FACES 6
+#define MAX_FACES 6
/*@}*/
@@ -2194,12 +2190,11 @@ struct gl_shared_state
* \todo Improve the granularity of locking.
*/
/*@{*/
- _glthread_Mutex TexMutex; /**< texobj thread safety */
- GLuint TextureStateStamp; /**< state notification for shared tex */
+ _glthread_Mutex TexMutex; /**< texobj thread safety */
+ GLuint TextureStateStamp; /**< state notification for shared tex */
/*@}*/
-
/**
* \name Vertex/fragment programs
*/
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 0f562420b0..e83db5de78 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -57,10 +57,6 @@ _mesa_PointSize( GLfloat size )
FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.Size = size;
- /* XXX correct clamp limits? */
- ctx->Point._Size = CLAMP(ctx->Point.Size,
- ctx->Point.MinSize,
- ctx->Point.MaxSize);
if (ctx->Driver.PointSize)
ctx->Driver.PointSize(ctx, size);
@@ -253,7 +249,6 @@ _mesa_init_point(GLcontext *ctx)
ctx->Point.SmoothFlag = GL_FALSE;
ctx->Point.Size = 1.0;
- ctx->Point._Size = 1.0;
ctx->Point.Params[0] = 1.0;
ctx->Point.Params[1] = 0.0;
ctx->Point.Params[2] = 0.0;
diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c
index 58be1f46e5..7bf8808767 100644
--- a/src/mesa/main/shaders.c
+++ b/src/mesa/main/shaders.c
@@ -83,7 +83,7 @@ _mesa_CreateShader(GLenum type)
}
-GLhandleARB APIENTRY
+GLhandleARB GLAPIENTRY
_mesa_CreateShaderObjectARB(GLenum type)
{
GET_CURRENT_CONTEXT(ctx);
@@ -99,7 +99,7 @@ _mesa_CreateProgram(void)
}
-GLhandleARB APIENTRY
+GLhandleARB GLAPIENTRY
_mesa_CreateProgramObjectARB(void)
{
GET_CURRENT_CONTEXT(ctx);
@@ -319,7 +319,7 @@ _mesa_GetUniformivARB(GLhandleARB program, GLint location, GLint * params)
#if 0
-GLint APIENTRY
+GLint GLAPIENTRY
_mesa_GetUniformLocation(GLuint program, const GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
@@ -336,7 +336,7 @@ _mesa_GetHandleARB(GLenum pname)
}
-GLint APIENTRY
+GLint GLAPIENTRY
_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 66f8ac6408..444f227760 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1068,7 +1068,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
if (1/*new_state & _NEW_POINT*/) {
if (ctx->Point.SmoothFlag)
ctx->_TriangleCaps |= DD_POINT_SMOOTH;
- if (ctx->Point._Size != 1.0F)
+ if (ctx->Point.Size != 1.0F)
ctx->_TriangleCaps |= DD_POINT_SIZE;
if (ctx->Point._Attenuated)
ctx->_TriangleCaps |= DD_POINT_ATTEN;
@@ -1082,7 +1082,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
ctx->_TriangleCaps |= DD_LINE_SMOOTH;
if (ctx->Line.StippleFlag)
ctx->_TriangleCaps |= DD_LINE_STIPPLE;
- if (ctx->Line._Width != 1.0)
+ if (ctx->Line.Width != 1.0)
ctx->_TriangleCaps |= DD_LINE_WIDTH;
}
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 411d51cfcc..b6991f45ed 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -302,7 +302,12 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = {
#define FX64_NATIVE 1
+#ifdef __MINGW32__
+typedef unsigned long Fx64;
+#else
typedef unsigned long long Fx64;
+#endif
+
#define FX64_MOV32(a, b) a = b
#define FX64_OR32(a, b) a |= b