diff options
author | marha <marha@users.sourceforge.net> | 2011-12-29 00:17:36 +0100 |
---|---|---|
committer | Marc Haesen <marc@hc-consult.be> | 2011-12-29 00:17:36 +0100 |
commit | d515b895dc5151d102f33b577cafbf63473bbafa (patch) | |
tree | 98986aec1f43152c3c5f4f8f8a19d29f88b42d83 /mesalib/src/mesa/main | |
parent | ecb8be4d2a289c5308f3f23929116d2fe6aafa4b (diff) | |
parent | 9715b7fab0757c86e1bb151f3dce0b324bcff692 (diff) | |
download | vcxsrv-d515b895dc5151d102f33b577cafbf63473bbafa.tar.gz vcxsrv-d515b895dc5151d102f33b577cafbf63473bbafa.tar.bz2 vcxsrv-d515b895dc5151d102f33b577cafbf63473bbafa.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r-- | mesalib/src/mesa/main/api_exec.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/arrayobj.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/context.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dlist.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/light.c | 16 | ||||
-rw-r--r-- | mesalib/src/mesa/main/light.h | 298 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mfeatures.h | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mtypes.h | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/main/querymatrix.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/shared.c | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/main/uniform_query.cpp | 4 |
11 files changed, 156 insertions, 193 deletions
diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index 26fd37e63..605af381d 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -39,9 +39,7 @@ #include "atifragshader.h" #include "attrib.h" #include "blend.h" -#if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" -#endif #include "arrayobj.h" #if FEATURE_draw_read_buffer #include "buffers.h" @@ -580,7 +578,6 @@ _mesa_create_exec_table(void) #endif /* ARB 28. GL_ARB_vertex_buffer_object */ -#if FEATURE_ARB_vertex_buffer_object SET_BindBufferARB(exec, _mesa_BindBufferARB); SET_BufferDataARB(exec, _mesa_BufferDataARB); SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB); @@ -592,7 +589,6 @@ _mesa_create_exec_table(void) SET_IsBufferARB(exec, _mesa_IsBufferARB); SET_MapBufferARB(exec, _mesa_MapBufferARB); SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); -#endif /* ARB 29. GL_ARB_occlusion_query */ _mesa_init_queryobj_dispatch(exec); diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c index 0439063b1..4b3e07b85 100644 --- a/mesalib/src/mesa/main/arrayobj.c +++ b/mesalib/src/mesa/main/arrayobj.c @@ -45,9 +45,7 @@ #include "imports.h" #include "context.h" #include "mfeatures.h" -#if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" -#endif #include "arrayobj.h" #include "macros.h" #include "mtypes.h" @@ -195,11 +193,9 @@ init_array(struct gl_context *ctx, array->Normalized = GL_FALSE; array->Integer = GL_FALSE; array->_ElementSize = size * _mesa_sizeof_type(type); -#if FEATURE_ARB_vertex_buffer_object /* Vertex array buffers */ _mesa_reference_buffer_object(ctx, &array->BufferObj, ctx->Shared->NullBufferObj); -#endif } diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 009048170..f39cab5e4 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -1133,9 +1133,7 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL); #endif -#if FEATURE_ARB_vertex_buffer_object _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); -#endif /* free dispatch tables */ free(ctx->Exec); diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index b3edae0e6..95b8211b2 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -40,9 +40,7 @@ #endif #include "config.h" #include "mfeatures.h" -#if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" -#endif #include "arrayobj.h" #include "context.h" #include "dlist.h" @@ -10184,7 +10182,6 @@ _mesa_create_save_table(void) #endif /* ARB 28. GL_ARB_vertex_buffer_object */ -#if FEATURE_ARB_vertex_buffer_object /* None of the extension's functions get compiled */ SET_BindBufferARB(table, _mesa_BindBufferARB); SET_BufferDataARB(table, _mesa_BufferDataARB); @@ -10197,7 +10194,6 @@ _mesa_create_save_table(void) SET_IsBufferARB(table, _mesa_IsBufferARB); SET_MapBufferARB(table, _mesa_MapBufferARB); SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); -#endif #if FEATURE_queryobj _mesa_init_queryobj_dispatch(table); /* glGetQuery, etc */ diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c index 60daa89a3..bf4bee3d6 100644 --- a/mesalib/src/mesa/main/light.c +++ b/mesalib/src/mesa/main/light.c @@ -624,22 +624,6 @@ _mesa_material_bitmask( struct gl_context *ctx, GLenum face, GLenum pname, -/* Perform a straight copy between materials. - */ -void -_mesa_copy_materials( struct gl_material *dst, - const struct gl_material *src, - GLuint bitmask ) -{ - int i; - - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) - if (bitmask & (1<<i)) - COPY_4FV( dst->Attrib[i], src->Attrib[i] ); -} - - - /* Update derived values following a change in ctx->Light.Material */ void diff --git a/mesalib/src/mesa/main/light.h b/mesalib/src/mesa/main/light.h index cd8aeaeb6..9b66c7ed8 100644 --- a/mesalib/src/mesa/main/light.h +++ b/mesalib/src/mesa/main/light.h @@ -1,151 +1,147 @@ -/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. 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"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef LIGHT_H
-#define LIGHT_H
-
-
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct gl_context;
-struct gl_light;
-struct gl_material;
-
-extern void GLAPIENTRY
-_mesa_ShadeModel( GLenum mode );
-
-extern void GLAPIENTRY
-_mesa_ProvokingVertexEXT(GLenum mode);
-
-
-#if _HAVE_FULL_GL
-extern void GLAPIENTRY
-_mesa_ColorMaterial( GLenum face, GLenum mode );
-
-extern void GLAPIENTRY
-_mesa_Lightf( GLenum light, GLenum pname, GLfloat param );
-
-extern void GLAPIENTRY
-_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params );
-
-extern void GLAPIENTRY
-_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params );
-
-extern void GLAPIENTRY
-_mesa_Lighti( GLenum light, GLenum pname, GLint param );
-
-extern void GLAPIENTRY
-_mesa_LightModelf( GLenum pname, GLfloat param );
-
-extern void GLAPIENTRY
-_mesa_LightModelfv( GLenum pname, const GLfloat *params );
-
-extern void GLAPIENTRY
-_mesa_LightModeli( GLenum pname, GLint param );
-
-extern void GLAPIENTRY
-_mesa_LightModeliv( GLenum pname, const GLint *params );
-
-extern void GLAPIENTRY
-_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params );
-
-extern void GLAPIENTRY
-_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params );
-
-extern void GLAPIENTRY
-_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
-
-extern void GLAPIENTRY
-_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params );
-
-
-extern void
-_mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *params);
-
-
-/* Lerp between adjacent values in the f(x) lookup table, giving a
- * continuous function, with adequeate overall accuracy. (Though
- * still pretty good compared to a straight lookup).
- * Result should be a GLfloat.
- */
-#define GET_SHINE_TAB_ENTRY( table, dp, result ) \
-do { \
- struct gl_shine_tab *_tab = table; \
- float f = (dp * (SHINE_TABLE_SIZE-1)); \
- int k = (int) f; \
- if (k < 0 /* gcc may cast an overflow float value to negative int value*/ \
- || k > SHINE_TABLE_SIZE-2) \
- result = (GLfloat) pow( dp, _tab->shininess ); \
- else \
- result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \
-} while (0)
-
-
-extern GLuint _mesa_material_bitmask( struct gl_context *ctx,
- GLenum face, GLenum pname,
- GLuint legal,
- const char * );
-
-extern void _mesa_invalidate_spot_exp_table( struct gl_light *l );
-
-extern void _mesa_invalidate_shine_table( struct gl_context *ctx, GLuint i );
-
-extern void _mesa_validate_all_lighting_tables( struct gl_context *ctx );
-
-extern void _mesa_update_lighting( struct gl_context *ctx );
-
-extern void _mesa_update_tnl_spaces( struct gl_context *ctx, GLuint new_state );
-
-extern void _mesa_update_material( struct gl_context *ctx,
- GLuint bitmask );
-
-extern void _mesa_copy_materials( struct gl_material *dst,
- const struct gl_material *src,
- GLuint bitmask );
-
-extern void _mesa_update_color_material( struct gl_context *ctx,
- const GLfloat rgba[4] );
-
-extern void _mesa_init_lighting( struct gl_context *ctx );
-
-extern void _mesa_free_lighting_data( struct gl_context *ctx );
-
-extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag );
-
-#else
-#define _mesa_update_color_material( c, r ) ((void)0)
-#define _mesa_validate_all_lighting_tables( c ) ((void)0)
-#define _mesa_invalidate_spot_exp_table( l ) ((void)0)
-#define _mesa_material_bitmask( c, f, p, l, s ) 0
-#define _mesa_init_lighting( c ) ((void)0)
-#define _mesa_free_lighting_data( c ) ((void)0)
-#define _mesa_update_lighting( c ) ((void)0)
-#define _mesa_update_tnl_spaces( c, n ) ((void)0)
-#define GET_SHINE_TAB_ENTRY( table, dp, result ) ((result)=0)
-#endif
-
-#endif
+/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef LIGHT_H +#define LIGHT_H + + +#include "glheader.h" +#include "mfeatures.h" + +struct gl_context; +struct gl_light; +struct gl_material; + +extern void GLAPIENTRY +_mesa_ShadeModel( GLenum mode ); + +extern void GLAPIENTRY +_mesa_ProvokingVertexEXT(GLenum mode); + + +#if _HAVE_FULL_GL +extern void GLAPIENTRY +_mesa_ColorMaterial( GLenum face, GLenum mode ); + +extern void GLAPIENTRY +_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ); + +extern void GLAPIENTRY +_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ); + +extern void GLAPIENTRY +_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ); + +extern void GLAPIENTRY +_mesa_Lighti( GLenum light, GLenum pname, GLint param ); + +extern void GLAPIENTRY +_mesa_LightModelf( GLenum pname, GLfloat param ); + +extern void GLAPIENTRY +_mesa_LightModelfv( GLenum pname, const GLfloat *params ); + +extern void GLAPIENTRY +_mesa_LightModeli( GLenum pname, GLint param ); + +extern void GLAPIENTRY +_mesa_LightModeliv( GLenum pname, const GLint *params ); + +extern void GLAPIENTRY +_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ); + +extern void GLAPIENTRY +_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); + + +extern void +_mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *params); + + +/* Lerp between adjacent values in the f(x) lookup table, giving a + * continuous function, with adequeate overall accuracy. (Though + * still pretty good compared to a straight lookup). + * Result should be a GLfloat. + */ +#define GET_SHINE_TAB_ENTRY( table, dp, result ) \ +do { \ + struct gl_shine_tab *_tab = table; \ + float f = (dp * (SHINE_TABLE_SIZE-1)); \ + int k = (int) f; \ + if (k < 0 /* gcc may cast an overflow float value to negative int value*/ \ + || k > SHINE_TABLE_SIZE-2) \ + result = (GLfloat) pow( dp, _tab->shininess ); \ + else \ + result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \ +} while (0) + + +extern GLuint _mesa_material_bitmask( struct gl_context *ctx, + GLenum face, GLenum pname, + GLuint legal, + const char * ); + +extern void _mesa_invalidate_spot_exp_table( struct gl_light *l ); + +extern void _mesa_invalidate_shine_table( struct gl_context *ctx, GLuint i ); + +extern void _mesa_validate_all_lighting_tables( struct gl_context *ctx ); + +extern void _mesa_update_lighting( struct gl_context *ctx ); + +extern void _mesa_update_tnl_spaces( struct gl_context *ctx, GLuint new_state ); + +extern void _mesa_update_material( struct gl_context *ctx, + GLuint bitmask ); + +extern void _mesa_update_color_material( struct gl_context *ctx, + const GLfloat rgba[4] ); + +extern void _mesa_init_lighting( struct gl_context *ctx ); + +extern void _mesa_free_lighting_data( struct gl_context *ctx ); + +extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag ); + +#else +#define _mesa_update_color_material( c, r ) ((void)0) +#define _mesa_validate_all_lighting_tables( c ) ((void)0) +#define _mesa_invalidate_spot_exp_table( l ) ((void)0) +#define _mesa_material_bitmask( c, f, p, l, s ) 0 +#define _mesa_init_lighting( c ) ((void)0) +#define _mesa_free_lighting_data( c ) ((void)0) +#define _mesa_update_lighting( c ) ((void)0) +#define _mesa_update_tnl_spaces( c, n ) ((void)0) +#define GET_SHINE_TAB_ENTRY( table, dp, result ) ((result)=0) +#endif + +#endif diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h index 33db50814..b67f046ca 100644 --- a/mesalib/src/mesa/main/mfeatures.h +++ b/mesalib/src/mesa/main/mfeatures.h @@ -124,7 +124,6 @@ #define FEATURE_ARB_pixel_buffer_object (FEATURE_GL && FEATURE_EXT_pixel_buffer_object) #define FEATURE_ARB_sampler_objects FEATURE_GL #define FEATURE_ARB_sync FEATURE_GL -#define FEATURE_ARB_vertex_buffer_object 1 #define FEATURE_EXT_framebuffer_blit FEATURE_GL #define FEATURE_EXT_framebuffer_object 1 diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 02452aa68..107371e52 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -56,6 +56,12 @@ typedef GLuint64 GLbitfield64; /** Set a single bit */ #define BITFIELD64_BIT(b) ((GLbitfield64)1 << (b)) +/** Set all bits up to excluding bit b */ +#define BITFIELD64_MASK(b) \ + ((b) == 64 ? (~(GLbitfield64)0) : BITFIELD64_BIT(b) - 1) +/** Set count bits starting from bit b */ +#define BITFIELD64_RANGE(b, count) \ + (BITFIELD64_MASK((b) + (count)) & ~BITFIELD64_MASK(b)) /** @@ -683,8 +689,6 @@ struct gl_light GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */ GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */ GLfloat _MatSpecular[2][3]; /**< material spec * light specular */ - GLfloat _dli; /**< CI diffuse light intensity */ - GLfloat _sli; /**< CI specular light intensity */ /*@}*/ }; diff --git a/mesalib/src/mesa/main/querymatrix.c b/mesalib/src/mesa/main/querymatrix.c index eaedf7cd2..2843d5589 100644 --- a/mesalib/src/mesa/main/querymatrix.c +++ b/mesalib/src/mesa/main/querymatrix.c @@ -73,7 +73,7 @@ fpclassify(double x) #elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \ (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \ - (defined(__sun) && defined(__GNUC__)) || defined(ANDROID) + (defined(__sun) && defined(__GNUC__)) || defined(ANDROID) || defined(__HAIKU__) /* fpclassify is available. */ diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c index caa6132d4..276fac149 100644 --- a/mesalib/src/mesa/main/shared.c +++ b/mesalib/src/mesa/main/shared.c @@ -89,9 +89,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx) shared->ShaderObjects = _mesa_NewHashTable(); #endif -#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object shared->BufferObjects = _mesa_NewHashTable(); -#endif #if FEATURE_ARB_sampler_objects /* GL_ARB_sampler_objects */ @@ -342,10 +340,8 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) _mesa_delete_ati_fragment_shader(ctx, shared->DefaultFragmentShader); #endif -#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object _mesa_HashDeleteAll(shared->BufferObjects, delete_bufferobj_cb, ctx); _mesa_DeleteHashTable(shared->BufferObjects); -#endif #if FEATURE_EXT_framebuffer_object _mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx); @@ -354,9 +350,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) _mesa_DeleteHashTable(shared->RenderBuffers); #endif -#if FEATURE_ARB_vertex_buffer_object _mesa_reference_buffer_object(ctx, &shared->NullBufferObj, NULL); -#endif { struct simple_node *node; diff --git a/mesalib/src/mesa/main/uniform_query.cpp b/mesalib/src/mesa/main/uniform_query.cpp index 33ba53c2e..f3d6a16ee 100644 --- a/mesalib/src/mesa/main/uniform_query.cpp +++ b/mesalib/src/mesa/main/uniform_query.cpp @@ -648,7 +648,7 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, if (offset >= uni->array_elements) return; - count = MIN2(count, (uni->array_elements - offset)); + count = MIN2(count, (int) (uni->array_elements - offset)); } FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS); @@ -797,7 +797,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg, if (offset >= uni->array_elements) return; - count = MIN2(count, (uni->array_elements - offset)); + count = MIN2(count, (int) (uni->array_elements - offset)); } FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS); |