diff options
author | marha <marha@users.sourceforge.net> | 2012-03-13 08:31:21 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-13 08:31:21 +0100 |
commit | fc72edebf875378459368c5383d9023730cbca54 (patch) | |
tree | b34159309efdc9a43ebe4a32108e5c3ac051a05e /mesalib/src/mesa/main | |
parent | 41bd254198b8b879a562a85f7dc868c3c0f7fbc1 (diff) | |
download | vcxsrv-fc72edebf875378459368c5383d9023730cbca54.tar.gz vcxsrv-fc72edebf875378459368c5383d9023730cbca54.tar.bz2 vcxsrv-fc72edebf875378459368c5383d9023730cbca54.zip |
fontconfig mesa git update 13 Mar 2012
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r-- | mesalib/src/mesa/main/clear.c | 46 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dd.h | 7 | ||||
-rw-r--r-- | mesalib/src/mesa/main/debug.c | 7 | ||||
-rw-r--r-- | mesalib/src/mesa/main/depth.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/enable.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/errors.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/fbobject.c | 16 | ||||
-rw-r--r-- | mesalib/src/mesa/main/light.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mtypes.h | 50 | ||||
-rw-r--r-- | mesalib/src/mesa/main/state.c | 22 | ||||
-rw-r--r-- | mesalib/src/mesa/main/stencil.c | 4 |
11 files changed, 37 insertions, 127 deletions
diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c index e4df120d6..7cc204bc5 100644 --- a/mesalib/src/mesa/main/clear.c +++ b/mesalib/src/mesa/main/clear.c @@ -88,14 +88,6 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor.f, tmp); - - if (ctx->Driver.ClearColor) { - /* it's OK to call glClearColor in CI mode but it should be a NOP */ - /* we pass the clamped color, since all drivers that need this don't - * support GL_ARB_color_buffer_float - */ - (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor); - } } @@ -119,11 +111,6 @@ _mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor.i, tmp); - - /* these should be NOP calls for drivers supporting EXT_texture_integer */ - if (ctx->Driver.ClearColor) { - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); - } } @@ -147,11 +134,6 @@ _mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor.ui, tmp); - - /* these should be NOP calls for drivers supporting EXT_texture_integer */ - if (ctx->Driver.ClearColor) { - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); - } } @@ -346,12 +328,8 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) */ const GLuint clearSave = ctx->Stencil.Clear; ctx->Stencil.Clear = *value; - if (ctx->Driver.ClearStencil) - ctx->Driver.ClearStencil(ctx, *value); ctx->Driver.Clear(ctx, BUFFER_BIT_STENCIL); ctx->Stencil.Clear = clearSave; - if (ctx->Driver.ClearStencil) - ctx->Driver.ClearStencil(ctx, clearSave); } break; case GL_COLOR: @@ -369,14 +347,10 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) clearSave = ctx->Color.ClearColor; /* set color */ COPY_4V(ctx->Color.ClearColor.i, value); - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); /* clear buffer(s) */ ctx->Driver.Clear(ctx, mask); /* restore color */ ctx->Color.ClearColor = clearSave; - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, clearSave); } } break; @@ -439,14 +413,10 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) clearSave = ctx->Color.ClearColor; /* set color */ COPY_4V(ctx->Color.ClearColor.ui, value); - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); /* clear buffer(s) */ ctx->Driver.Clear(ctx, mask); /* restore color */ ctx->Color.ClearColor = clearSave; - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, clearSave); } } break; @@ -521,12 +491,8 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) */ const GLclampd clearSave = ctx->Depth.Clear; ctx->Depth.Clear = *value; - if (ctx->Driver.ClearDepth) - ctx->Driver.ClearDepth(ctx, *value); ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH); ctx->Depth.Clear = clearSave; - if (ctx->Driver.ClearDepth) - ctx->Driver.ClearDepth(ctx, clearSave); } /* clear depth buffer to value */ break; @@ -545,14 +511,10 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) clearSave = ctx->Color.ClearColor; /* set color */ COPY_4V_CAST(ctx->Color.ClearColor.f, value, GLclampf); - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); /* clear buffer(s) */ ctx->Driver.Clear(ctx, mask); /* restore color */ ctx->Color.ClearColor = clearSave; - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, clearSave); } } break; @@ -637,10 +599,6 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer, /* set new clear values */ ctx->Depth.Clear = depth; ctx->Stencil.Clear = stencil; - if (ctx->Driver.ClearDepth) - ctx->Driver.ClearDepth(ctx, depth); - if (ctx->Driver.ClearStencil) - ctx->Driver.ClearStencil(ctx, stencil); /* clear buffers */ ctx->Driver.Clear(ctx, mask); @@ -648,9 +606,5 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer, /* restore */ ctx->Depth.Clear = clearDepthSave; ctx->Stencil.Clear = clearStencilSave; - if (ctx->Driver.ClearDepth) - ctx->Driver.ClearDepth(ctx, clearDepthSave); - if (ctx->Driver.ClearStencil) - ctx->Driver.ClearStencil(ctx, clearStencilSave); } } diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index 96311131a..582eb5d49 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -557,13 +557,6 @@ struct dd_function_table { void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA); - /** Specify clear values for the color buffers */ - void (*ClearColor)(struct gl_context *ctx, - const union gl_color_union color); - /** Specify the clear value for the depth buffer */ - void (*ClearDepth)(struct gl_context *ctx, GLclampd d); - /** Specify the clear value for the stencil buffer */ - void (*ClearStencil)(struct gl_context *ctx, GLint s); /** Specify a plane against which all geometry is clipped */ void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation ); /** Enable and disable writing of frame buffer color components */ diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c index 71d7f1ac6..f7b1f71f4 100644 --- a/mesalib/src/mesa/main/debug.c +++ b/mesalib/src/mesa/main/debug.c @@ -100,13 +100,11 @@ void _mesa_print_tri_caps( const char *name, GLuint flags ) { _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s\n", name, flags, - (flags & DD_FLATSHADE) ? "flat-shade, " : "", (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "", (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "", - (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "", (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "", (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "", (flags & DD_TRI_OFFSET) ? "tri-offset, " : "", @@ -114,8 +112,7 @@ _mesa_print_tri_caps( const char *name, GLuint flags ) (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "", (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "", (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "", - (flags & DD_POINT_ATTEN) ? "point-atten, " : "", - (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "" + (flags & DD_POINT_ATTEN) ? "point-atten, " : "" ); } diff --git a/mesalib/src/mesa/main/depth.c b/mesalib/src/mesa/main/depth.c index 52c69a6bc..bb1625440 100644 --- a/mesalib/src/mesa/main/depth.c +++ b/mesalib/src/mesa/main/depth.c @@ -54,8 +54,6 @@ _mesa_ClearDepth( GLclampd depth ) FLUSH_VERTICES(ctx, _NEW_DEPTH); ctx->Depth.Clear = depth; - if (ctx->Driver.ClearDepth) - (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear ); } diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index 2f0216b01..f6d37feae 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -822,10 +822,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Stencil.TestTwoSide = state; if (state) { ctx->Stencil._BackFace = 2; - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; } else { ctx->Stencil._BackFace = 1; - ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; } break; diff --git a/mesalib/src/mesa/main/errors.c b/mesalib/src/mesa/main/errors.c index 22561003a..fcf873f18 100644 --- a/mesalib/src/mesa/main/errors.c +++ b/mesalib/src/mesa/main/errors.c @@ -718,10 +718,10 @@ _mesa_DebugMessageControlARB(GLenum source, GLenum type, GLenum severity, } static void GLAPIENTRY -_mesa_DebugMessageCallbackARB(GLvoid *callback, GLvoid *userParam) +_mesa_DebugMessageCallbackARB(GLDEBUGPROCARB callback, GLvoid *userParam) { GET_CURRENT_CONTEXT(ctx); - ctx->Debug.Callback = (GLDEBUGPROCARB)callback; + ctx->Debug.Callback = callback; ctx->Debug.CallbackData = userParam; } diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 281b1ca2f..26ae1087c 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -1914,7 +1914,10 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb, /** - * Common code called by glFramebufferTexture1D/2D/3DEXT(). + * Common code called by glFramebufferTexture1D/2D/3DEXT() and + * glFramebufferTextureLayerEXT(). + * Note: glFramebufferTextureLayerEXT() has no textarget parameter so we'll + * get textarget=0 in that case. */ static void framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, @@ -1924,6 +1927,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; struct gl_framebuffer *fb; + GLenum maxLevelsTarget; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1950,12 +1954,17 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, texObj = _mesa_lookup_texture(ctx, texture); if (texObj != NULL) { if (textarget == 0) { - /* XXX what's the purpose of this? */ + /* If textarget == 0 it means we're being called by + * glFramebufferTextureLayer() and textarget is not used. + * The only legal texture types for that function are 3D and + * 1D/2D arrays textures. + */ err = (texObj->Target != GL_TEXTURE_3D) && (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); } else { + /* Make sure textarget is consistent with the texture's type */ err = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? !_mesa_is_cube_face(textarget) : (texObj->Target != textarget); @@ -1993,8 +2002,9 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, } } + maxLevelsTarget = textarget ? textarget : texObj->Target; if ((level < 0) || - (level >= _mesa_max_texture_levels(ctx, textarget))) { + (level >= _mesa_max_texture_levels(ctx, maxLevelsTarget))) { _mesa_error(ctx, GL_INVALID_VALUE, "glFramebufferTexture%sEXT(level)", caller); return; diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c index 962a3e689..7bc22e2fa 100644 --- a/mesalib/src/mesa/main/light.c +++ b/mesalib/src/mesa/main/light.c @@ -54,10 +54,6 @@ _mesa_ShadeModel( GLenum mode ) FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.ShadeModel = mode; - if (mode == GL_FLAT) - ctx->_TriangleCaps |= DD_FLATSHADE; - else - ctx->_TriangleCaps &= ~DD_FLATSHADE; if (ctx->Driver.ShadeModel) ctx->Driver.ShadeModel( ctx, mode ); diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 9b88f9938..f76096a49 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -3071,40 +3071,16 @@ struct gl_matrix_stack * Set in the __struct gl_contextRec::_TriangleCaps bitfield. */ /*@{*/ -#define DD_FLATSHADE 0x1 -#define DD_SEPARATE_SPECULAR 0x2 -#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */ -#define DD_TRI_LIGHT_TWOSIDE 0x8 -#define DD_TRI_UNFILLED 0x10 -#define DD_TRI_SMOOTH 0x20 -#define DD_TRI_STIPPLE 0x40 -#define DD_TRI_OFFSET 0x80 -#define DD_LINE_SMOOTH 0x100 -#define DD_LINE_STIPPLE 0x200 -#define DD_POINT_SMOOTH 0x400 -#define DD_POINT_ATTEN 0x800 -#define DD_TRI_TWOSTENCIL 0x1000 -/*@}*/ - - -/** - * \name Define the state changes under which each of these bits might change - */ -/*@{*/ -#define _DD_NEW_FLATSHADE _NEW_LIGHT -#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM) -#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON -#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT -#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON -#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON -#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON -#define _DD_NEW_TRI_OFFSET _NEW_POLYGON -#define _DD_NEW_LINE_SMOOTH _NEW_LINE -#define _DD_NEW_LINE_STIPPLE _NEW_LINE -#define _DD_NEW_LINE_WIDTH _NEW_LINE -#define _DD_NEW_POINT_SMOOTH _NEW_POINT -#define _DD_NEW_POINT_SIZE _NEW_POINT -#define _DD_NEW_POINT_ATTEN _NEW_POINT +#define DD_SEPARATE_SPECULAR (1 << 0) +#define DD_TRI_LIGHT_TWOSIDE (1 << 1) +#define DD_TRI_UNFILLED (1 << 2) +#define DD_TRI_SMOOTH (1 << 3) +#define DD_TRI_STIPPLE (1 << 4) +#define DD_TRI_OFFSET (1 << 5) +#define DD_LINE_SMOOTH (1 << 6) +#define DD_LINE_STIPPLE (1 << 7) +#define DD_POINT_SMOOTH (1 << 8) +#define DD_POINT_ATTEN (1 << 9) /*@}*/ @@ -3117,6 +3093,12 @@ struct gl_matrix_stack _NEW_POINT | \ _NEW_PROGRAM | \ _NEW_MODELVIEW) + +#define _MESA_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | \ + _NEW_FOG | \ + _NEW_PROGRAM) + + /*@}*/ diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c index 20fd17d06..b01926622 100644 --- a/mesalib/src/mesa/main/state.c +++ b/mesalib/src/mesa/main/state.c @@ -370,16 +370,13 @@ update_twoside(struct gl_context *ctx) /* - * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET + * Check polygon state and set DD_TRI_OFFSET * in ctx->_TriangleCaps if needed. */ static void update_polygon(struct gl_context *ctx) { - ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET); - - if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) - ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK; + ctx->_TriangleCaps &= ~DD_TRI_OFFSET; if ( ctx->Polygon.OffsetPoint || ctx->Polygon.OffsetLine @@ -431,9 +428,6 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state) if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) ctx->_TriangleCaps |= DD_TRI_UNFILLED; - if (ctx->Polygon.CullFlag - && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) - ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK; if (ctx->Polygon.OffsetPoint || ctx->Polygon.OffsetLine || ctx->Polygon.OffsetFill) @@ -445,16 +439,8 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state) */ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - if (ctx->Light.ShadeModel == GL_FLAT) - ctx->_TriangleCaps |= DD_FLATSHADE; if (_mesa_need_secondary_color(ctx)) ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; - - /* - * Stencil - */ - if (ctx->Stencil._TestTwoSide) - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; } #endif @@ -534,7 +520,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & _NEW_PIXEL) _mesa_update_pixel( ctx, new_state ); - if (new_state & _DD_NEW_SEPARATE_SPECULAR) + if (new_state & _MESA_NEW_SEPARATE_SPECULAR) update_separate_specular( ctx ); if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT)) @@ -551,7 +537,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) #if 0 if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT - | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR)) + | _NEW_STENCIL | _MESA_NEW_SEPARATE_SPECULAR)) update_tricaps( ctx, new_state ); #endif diff --git a/mesalib/src/mesa/main/stencil.c b/mesalib/src/mesa/main/stencil.c index b6993ff12..f47b57b8d 100644 --- a/mesalib/src/mesa/main/stencil.c +++ b/mesalib/src/mesa/main/stencil.c @@ -115,10 +115,6 @@ _mesa_ClearStencil( GLint s ) FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.Clear = (GLuint) s; - - if (ctx->Driver.ClearStencil) { - ctx->Driver.ClearStencil( ctx, s ); - } } |