diff options
author | Luc Verhaegen <libv@skynet.be> | 2010-03-13 04:50:08 +0100 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2010-03-13 04:50:08 +0100 |
commit | 40ae246ea1c1715876fe0e164e2041a4478246fd (patch) | |
tree | 172ae8c581c5a7c7b35d68ed5dbc4085e28c2033 /mesa/main | |
parent | ed0beba0b514a7d4971345db2ff716aedd2892bb (diff) |
DRI SDK headers from mesa 7.6.0.
Diffstat (limited to 'mesa/main')
-rw-r--r-- | mesa/main/api_noop.h | 4 | ||||
-rw-r--r-- | mesa/main/api_validate.h | 6 | ||||
-rw-r--r-- | mesa/main/arrayobj.h | 14 | ||||
-rw-r--r-- | mesa/main/bufferobj.h | 107 | ||||
-rw-r--r-- | mesa/main/config.h | 57 | ||||
-rw-r--r-- | mesa/main/context.h | 6 | ||||
-rw-r--r-- | mesa/main/dd.h | 36 | ||||
-rw-r--r-- | mesa/main/image.h | 28 | ||||
-rw-r--r-- | mesa/main/imports.h | 4 | ||||
-rw-r--r-- | mesa/main/light.h | 14 | ||||
-rw-r--r-- | mesa/main/macros.h | 3 | ||||
-rw-r--r-- | mesa/main/mfeatures.h | 2 | ||||
-rw-r--r-- | mesa/main/mtypes.h | 115 | ||||
-rw-r--r-- | mesa/main/polygon.h | 66 | ||||
-rw-r--r-- | mesa/main/simple_list.h | 5 | ||||
-rw-r--r-- | mesa/main/texgetimage.h | 9 | ||||
-rw-r--r-- | mesa/main/teximage.h | 16 | ||||
-rw-r--r-- | mesa/main/texobj.h | 8 | ||||
-rw-r--r-- | mesa/main/texstate.h | 18 | ||||
-rw-r--r-- | mesa/main/varray.h | 27 |
20 files changed, 346 insertions, 199 deletions
diff --git a/mesa/main/api_noop.h b/mesa/main/api_noop.h index 8bf4660..a7956d0 100644 --- a/mesa/main/api_noop.h +++ b/mesa/main/api_noop.h @@ -40,6 +40,10 @@ _mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); extern void GLAPIENTRY _mesa_noop_Materialfv(GLenum face, GLenum pname, const GLfloat *param); +extern void GLAPIENTRY +_mesa_noop_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount); + extern void _mesa_noop_vtxfmt_init(GLvertexformat *vfmt); diff --git a/mesa/main/api_validate.h b/mesa/main/api_validate.h index 10f0c34..ff82a29 100644 --- a/mesa/main/api_validate.h +++ b/mesa/main/api_validate.h @@ -30,6 +30,12 @@ #include "mtypes.h" + +extern GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf); + extern GLboolean _mesa_validate_DrawArrays(GLcontext *ctx, GLenum mode, GLint start, GLsizei count); diff --git a/mesa/main/arrayobj.h b/mesa/main/arrayobj.h index 9c4036a..8999edc 100644 --- a/mesa/main/arrayobj.h +++ b/mesa/main/arrayobj.h @@ -1,9 +1,10 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.6 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2006 + * 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"), @@ -56,22 +57,25 @@ extern void _mesa_initialize_array_object( GLcontext *ctx, struct gl_array_object *obj, GLuint name ); -extern void -_mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj ); extern void -_mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj ); - +_mesa_update_array_object_max_element(GLcontext *ctx, + struct gl_array_object *arrayObj); /* * API functions */ + +void GLAPIENTRY _mesa_BindVertexArray( GLuint id ); + void GLAPIENTRY _mesa_BindVertexArrayAPPLE( GLuint id ); void GLAPIENTRY _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids); +void GLAPIENTRY _mesa_GenVertexArrays(GLsizei n, GLuint *arrays); + void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer); GLboolean GLAPIENTRY _mesa_IsVertexArrayAPPLE( GLuint id ); diff --git a/mesa/main/bufferobj.h b/mesa/main/bufferobj.h index 3c08f00..9f732ec 100644 --- a/mesa/main/bufferobj.h +++ b/mesa/main/bufferobj.h @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.2 + * Version: 7.6 * * 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"), @@ -35,17 +36,32 @@ * Internal functions */ + +/** Is the given buffer object currently mapped? */ +static INLINE GLboolean +_mesa_bufferobj_mapped(const struct gl_buffer_object *obj) +{ + return obj->Pointer != NULL; +} + +/** + * Is the given buffer object a user-created buffer object? + * Mesa uses default buffer objects in several places. Default buffers + * always have Name==0. User created buffers have Name!=0. + */ +static INLINE GLboolean +_mesa_is_bufferobj(const struct gl_buffer_object *obj) +{ + return obj->Name != 0; +} + + extern void _mesa_init_buffer_objects( GLcontext *ctx ); extern void _mesa_update_default_objects_buffer_objects(GLcontext *ctx); -extern struct gl_buffer_object * -_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ); - -extern void -_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ); extern struct gl_buffer_object * _mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer); @@ -59,63 +75,50 @@ _mesa_reference_buffer_object(GLcontext *ctx, struct gl_buffer_object **ptr, struct gl_buffer_object *bufObj); -extern void -_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid * data, GLenum usage, - struct gl_buffer_object * bufObj ); - -extern void -_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid * data, - struct gl_buffer_object * bufObj ); - -extern void -_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, GLvoid * data, - struct gl_buffer_object * bufObj ); - -extern void * -_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, - struct gl_buffer_object * bufObj ); - -extern GLboolean -_mesa_buffer_unmap( GLcontext *ctx, GLenum target, - struct gl_buffer_object * bufObj ); - extern GLboolean _mesa_validate_pbo_access(GLuint dimensions, const struct gl_pixelstore_attrib *pack, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *ptr); -extern const GLubyte * -_mesa_map_bitmap_pbo(GLcontext *ctx, +extern const GLvoid * +_mesa_map_pbo_source(GLcontext *ctx, const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap); - -extern void -_mesa_unmap_bitmap_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); + const GLvoid *src); extern const GLvoid * -_mesa_map_drawpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels); +_mesa_map_validate_pbo_source(GLcontext *ctx, + GLuint dimensions, + const struct gl_pixelstore_attrib *unpack, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, const GLvoid *ptr, + const char *where); extern void -_mesa_unmap_drawpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); +_mesa_unmap_pbo_source(GLcontext *ctx, + const struct gl_pixelstore_attrib *unpack); extern void * -_mesa_map_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest); +_mesa_map_pbo_dest(GLcontext *ctx, + const struct gl_pixelstore_attrib *pack, + GLvoid *dest); + +extern GLvoid * +_mesa_map_validate_pbo_dest(GLcontext *ctx, + GLuint dimensions, + const struct gl_pixelstore_attrib *unpack, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, GLvoid *ptr, + const char *where); extern void -_mesa_unmap_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack); +_mesa_unmap_pbo_dest(GLcontext *ctx, + const struct gl_pixelstore_attrib *pack); +extern void +_mesa_init_buffer_object_functions(struct dd_function_table *driver); + /* * API functions @@ -154,4 +157,16 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params); +extern void GLAPIENTRY +_mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, + GLintptr readOffset, GLintptr writeOffset, + GLsizeiptr size); + +extern void * GLAPIENTRY +_mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, + GLbitfield access); + +extern void GLAPIENTRY +_mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length); + #endif diff --git a/mesa/main/config.h b/mesa/main/config.h index 1141190..8a09efd 100644 --- a/mesa/main/config.h +++ b/mesa/main/config.h @@ -170,10 +170,48 @@ /** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */ #define MAX_TEXTURE_LOD_BIAS 12.0 +/** For any program target/extension */ +/*@{*/ +#define MAX_PROGRAM_INSTRUCTIONS (16 * 1024) + +/** + * Per-program constants (power of two) + * + * \c MAX_PROGRAM_LOCAL_PARAMS and \c MAX_UNIFORMS are just the assmebly shader + * and GLSL shader names for the same thing. They should \b always have the + * same value. Each refers to the number of vec4 values supplied as + * per-program parameters. + */ +/*@{*/ +#define MAX_PROGRAM_LOCAL_PARAMS 1024 +#define MAX_UNIFORMS 1024 +/*@}*/ + +/** + * Per-context constants (power of two) + * + * \note + * This value should always be less than or equal to \c MAX_PROGRAM_LOCAL_PARAMS + * and \c MAX_VERTEX_PROGRAM_PARAMS. Otherwise some applications will make + * incorrect assumptions. + */ +#define MAX_PROGRAM_ENV_PARAMS 256 + +#define MAX_PROGRAM_MATRICES 8 +#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 +#define MAX_PROGRAM_CALL_DEPTH 8 +#define MAX_PROGRAM_TEMPS 256 +#define MAX_PROGRAM_ADDRESS_REGS 2 +#define MAX_VARYING 16 /**< number of float[4] vectors */ +#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS +#define MAX_PROGRAM_INPUTS 32 +#define MAX_PROGRAM_OUTPUTS 32 +/*@}*/ + /** For GL_ARB_vertex_program */ /*@{*/ #define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1 -#define MAX_VERTEX_PROGRAM_ATTRIBS 16 +#define MAX_VERTEX_PROGRAM_PARAMS MAX_UNIFORMS /*@}*/ /** For GL_ARB_fragment_program */ @@ -181,23 +219,6 @@ #define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0 /*@}*/ -/** For any program target/extension */ -/*@{*/ -#define MAX_PROGRAM_INSTRUCTIONS (16 * 1024) -#define MAX_PROGRAM_LOCAL_PARAMS 256 /**< per-program constants (power of two) */ -#define MAX_PROGRAM_ENV_PARAMS 256 /**< per-context constants (power of two) */ -#define MAX_PROGRAM_MATRICES 8 -#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 -#define MAX_PROGRAM_CALL_DEPTH 8 -#define MAX_PROGRAM_TEMPS 256 -#define MAX_PROGRAM_ADDRESS_REGS 2 -#define MAX_UNIFORMS 1024 /**< number of vec4 uniforms */ -#define MAX_VARYING 16 /**< number of float[4] vectors */ -#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS -#define MAX_PROGRAM_INPUTS 32 -#define MAX_PROGRAM_OUTPUTS 32 -/*@}*/ - /** For GL_NV_vertex_program */ /*@{*/ #define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128 diff --git a/mesa/main/context.h b/mesa/main/context.h index 0531ae8..5587695 100644 --- a/mesa/main/context.h +++ b/mesa/main/context.h @@ -159,6 +159,11 @@ _mesa_set_mvp_with_dp4( GLcontext *ctx, GLboolean flag ); +extern GLboolean +_mesa_valid_to_render(GLcontext *ctx, const char *where); + + + /** \name Miscellaneous */ /*@{*/ @@ -174,7 +179,6 @@ _mesa_Flush( void ); /*@}*/ - /** * \name Macros for flushing buffered rendering commands before state changes, * checking if inside glBegin/glEnd, etc. diff --git a/mesa/main/dd.h b/mesa/main/dd.h index 32b1d4e..4a700b5 100644 --- a/mesa/main/dd.h +++ b/mesa/main/dd.h @@ -766,6 +766,8 @@ struct dd_function_table { /** Return the value or values of a selected parameter */ GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result); /** Return the value or values of a selected parameter */ + GLboolean (*GetInteger64v)(GLcontext *ctx, GLenum pname, GLint64 *result); + /** Return the value or values of a selected parameter */ GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result); /*@}*/ @@ -783,9 +785,9 @@ struct dd_function_table { void (*DeleteBuffer)( GLcontext *ctx, struct gl_buffer_object *obj ); - void (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid *data, GLenum usage, - struct gl_buffer_object *obj ); + GLboolean (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size, + const GLvoid *data, GLenum usage, + struct gl_buffer_object *obj ); void (*BufferSubData)( GLcontext *ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data, @@ -798,6 +800,12 @@ struct dd_function_table { void * (*MapBuffer)( GLcontext *ctx, GLenum target, GLenum access, struct gl_buffer_object *obj ); + void (*CopyBufferSubData)( GLcontext *ctx, + struct gl_buffer_object *src, + struct gl_buffer_object *dst, + GLintptr readOffset, GLintptr writeOffset, + GLsizeiptr size ); + /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access: */ void * (*MapBufferRange)( GLcontext *ctx, GLenum target, @@ -1036,6 +1044,22 @@ struct dd_function_table { */ void (*EndCallList)( GLcontext *ctx ); + +#if FEATURE_ARB_sync + /** + * \name GL_ARB_sync interfaces + */ + /*@{*/ + struct gl_sync_object * (*NewSyncObject)(GLcontext *, GLenum); + void (*FenceSync)(GLcontext *, struct gl_sync_object *, GLenum, GLbitfield); + void (*DeleteSyncObject)(GLcontext *, struct gl_sync_object *); + void (*CheckSync)(GLcontext *, struct gl_sync_object *); + void (*ClientWaitSync)(GLcontext *, struct gl_sync_object *, + GLbitfield, GLuint64); + void (*ServerWaitSync)(GLcontext *, struct gl_sync_object *, + GLbitfield, GLuint64); + /*@}*/ +#endif }; @@ -1144,7 +1168,11 @@ typedef struct { void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); - /*@}*/ + void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount); + /*@}*/ /** * \name Eval diff --git a/mesa/main/image.h b/mesa/main/image.h index ee17acc..72717d6 100644 --- a/mesa/main/image.h +++ b/mesa/main/image.h @@ -54,6 +54,27 @@ _mesa_bytes_per_pixel( GLenum format, GLenum type ); extern GLboolean _mesa_is_legal_format_and_type( GLcontext *ctx, GLenum format, GLenum type ); +extern GLboolean +_mesa_is_color_format(GLenum format); + +extern GLboolean +_mesa_is_index_format(GLenum format); + +extern GLboolean +_mesa_is_depth_format(GLenum format); + +extern GLboolean +_mesa_is_stencil_format(GLenum format); + +extern GLboolean +_mesa_is_ycbcr_format(GLenum format); + +extern GLboolean +_mesa_is_depthstencil_format(GLenum format); + +extern GLboolean +_mesa_is_dudv_format(GLenum format); + extern GLvoid * _mesa_image_address( GLuint dimensions, @@ -113,6 +134,13 @@ extern void _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, GLubyte *dest, const struct gl_pixelstore_attrib *packing ); +extern void +_mesa_expand_bitmap(GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap, + GLubyte *destBuffer, GLint destStride, + GLubyte onValue); + /** \name Pixel processing functions */ /*@{*/ diff --git a/mesa/main/imports.h b/mesa/main/imports.h index 7b61e22..7d4012a 100644 --- a/mesa/main/imports.h +++ b/mesa/main/imports.h @@ -291,6 +291,7 @@ long iround(float f); #define IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F))) #endif +#define IROUND64(f) ((GLint64) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F))) /*** *** IROUND_POS: return (as an integer) positive float rounded to nearest int @@ -586,6 +587,9 @@ _mesa_atoi( const char *s ); extern double _mesa_strtod( const char *s, char **end ); +extern unsigned int +_mesa_str_checksum(const char *str); + extern int _mesa_sprintf( char *str, const char *fmt, ... ); diff --git a/mesa/main/light.h b/mesa/main/light.h index b97e17b..9c1a5ee 100644 --- a/mesa/main/light.h +++ b/mesa/main/light.h @@ -1,13 +1,9 @@ -/** - * \file light.h - * Lighting. - */ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 7.5 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * 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"), @@ -37,6 +33,10 @@ 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 ); diff --git a/mesa/main/macros.h b/mesa/main/macros.h index 4ca7957..3d9a1ab 100644 --- a/mesa/main/macros.h +++ b/mesa/main/macros.h @@ -99,6 +99,9 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; /* a close approximation: */ #define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) ) +/** Convert GLfloat in [-1.0,1.0] to GLint64 in [-(1<<63),(1 << 63) -1] */ +#define FLOAT_TO_INT64(X) ( (GLint64) (9223372036854775807.0 * (double)(X)) ) + /** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0], texture/fb data */ #define INT_TO_FLOAT_TEX(I) ((I) == -2147483648 ? -1.0F : (I) * (1.0F/2147483647.0)) diff --git a/mesa/main/mfeatures.h b/mesa/main/mfeatures.h index 62c3ead..e23cdb1 100644 --- a/mesa/main/mfeatures.h +++ b/mesa/main/mfeatures.h @@ -61,6 +61,7 @@ #define FEATURE_ARB_occlusion_query _HAVE_FULL_GL #define FEATURE_ARB_fragment_program _HAVE_FULL_GL #define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL +#define FEATURE_ARB_map_buffer_range _HAVE_FULL_GL #define FEATURE_ARB_pixel_buffer_object _HAVE_FULL_GL #define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL #define FEATURE_ARB_vertex_program _HAVE_FULL_GL @@ -69,6 +70,7 @@ #define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) #define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects #define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects +#define FEATURE_ARB_sync _HAVE_FULL_GL #define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL #define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL diff --git a/mesa/main/mtypes.h b/mesa/main/mtypes.h index 3b0ebcb..f8e4e41 100644 --- a/mesa/main/mtypes.h +++ b/mesa/main/mtypes.h @@ -40,6 +40,7 @@ #include "main/mfeatures.h" #include "glapi/glapi.h" #include "math/m_matrix.h" /* GLmatrix */ +#include "main/simple_list.h" /* struct simple_node */ /** @@ -83,6 +84,7 @@ /*@{*/ struct _mesa_HashTable; struct gl_attrib_node; +struct gl_meta_state; struct gl_pixelstore_attrib; struct gl_program_cache; struct gl_texture_format; @@ -227,7 +229,9 @@ typedef enum FRAG_ATTRIB_TEX5 = 9, FRAG_ATTRIB_TEX6 = 10, FRAG_ATTRIB_TEX7 = 11, - FRAG_ATTRIB_VAR0 = 12, /**< shader varying */ + FRAG_ATTRIB_FACE = 12, /**< front/back face */ + FRAG_ATTRIB_PNTC = 13, /**< sprite/point coord */ + FRAG_ATTRIB_VAR0 = 14, /**< shader varying */ FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING) } gl_frag_attrib; @@ -239,6 +243,8 @@ typedef enum #define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0) #define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1) #define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC) +#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE) +#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC) #define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0) #define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1) #define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2) @@ -770,6 +776,7 @@ struct gl_light_attrib GLboolean Enabled; /**< Lighting enabled flag */ GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */ + GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */ GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */ GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */ GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */ @@ -1028,7 +1035,7 @@ struct gl_stencil_attrib /** * An index for each type of texture object. These correspond to the GL - * target target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. + * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. * Note: the order is from highest priority to lowest priority. */ typedef enum @@ -1439,6 +1446,9 @@ struct gl_texture_attrib struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS]; + /** GL_ARB_seamless_cubemap */ + GLboolean CubeMapSeamless; + /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; struct gl_color_table Palette; @@ -1498,14 +1508,17 @@ struct gl_buffer_object { GLint RefCount; GLuint Name; - GLenum Usage; - GLenum Access; - GLvoid *Pointer; /**< Only valid while buffer is mapped */ - GLintptr Offset; /**< mapped offset */ - GLsizeiptr Length; /**< mapped length */ - GLsizeiptrARB Size; /**< Size of storage in bytes */ - GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ - GLboolean OnCard; /**< Is buffer in VRAM? (hardware drivers) */ + GLenum Usage; /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */ + GLsizeiptrARB Size; /**< Size of buffer storage in bytes */ + GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ + /** Fields describing a mapped buffer */ + /*@{*/ + GLbitfield AccessFlags; /**< Mask of GL_MAP_x_BIT flags */ + GLvoid *Pointer; /**< User-space address of mapping */ + GLintptr Offset; /**< Mapped offset */ + GLsizeiptr Length; /**< Mapped length */ + /*@}*/ + GLboolean Written; /**< Ever written to? (for debugging) */ }; @@ -1541,10 +1554,10 @@ struct gl_client_array const GLubyte *Ptr; /**< Points to array data */ GLboolean Enabled; /**< Enabled flag is a boolean */ GLboolean Normalized; /**< GL_ARB_vertex_program */ + GLuint _ElementSize; /**< size of each element in bytes */ - /**< GL_ARB_vertex_buffer_object */ - struct gl_buffer_object *BufferObj; - GLuint _MaxElement; + struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */ + GLuint _MaxElement; /**< max element index into array buffer + 1 */ }; @@ -1559,10 +1572,12 @@ struct gl_array_object GLint RefCount; _glthread_Mutex Mutex; + GLboolean VBOonly; /**< require all arrays to live in VBOs? */ /** Conventional vertex arrays */ /*@{*/ struct gl_client_array Vertex; + struct gl_client_array Weight; struct gl_client_array Normal; struct gl_client_array Color; struct gl_client_array SecondaryColor; @@ -1573,11 +1588,22 @@ struct gl_array_object struct gl_client_array PointSize; /*@}*/ - /** Generic arrays for vertex programs/shaders */ - struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; + /** + * Generic arrays for vertex programs/shaders. + * For NV vertex programs, these attributes alias and take priority + * over the conventional attribs above. For ARB vertex programs and + * GLSL vertex shaders, these attributes are separate. + */ + struct gl_client_array VertexAttrib[MAX_VERTEX_GENERIC_ATTRIBS]; /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */ GLbitfield _Enabled; + + /** + * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs + * we can determine the max legal (in bounds) glDrawElements array index. + */ + GLuint _MaxElement; }; @@ -1586,9 +1612,15 @@ struct gl_array_object */ struct gl_array_attrib { + /** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */ struct gl_array_object *ArrayObj; + + /** The default vertex array object */ struct gl_array_object *DefaultArrayObj; + /** Array objects (GL_ARB/APPLE_vertex_array_object) */ + struct _mesa_HashTable *Objects; + GLint ActiveTexture; /**< Client Active Texture */ GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ @@ -1596,11 +1628,9 @@ struct gl_array_attrib GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */ #if FEATURE_ARB_vertex_buffer_object - struct gl_buffer_object *NullBufferObj; struct gl_buffer_object *ArrayBufferObj; struct gl_buffer_object *ElementArrayBufferObj; #endif - GLuint _MaxElement; /* Min of all enabled array's maxes */ }; @@ -1770,7 +1800,7 @@ struct gl_program /** Map from sampler unit to texture unit (set by glUniform1i()) */ GLubyte SamplerUnits[MAX_SAMPLERS]; /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ - GLubyte SamplerTargets[MAX_SAMPLERS]; + gl_texture_index SamplerTargets[MAX_SAMPLERS]; /** Logical counts */ /*@{*/ @@ -1813,9 +1843,6 @@ struct gl_fragment_program struct gl_program Base; /**< base class */ GLenum FogOption; GLboolean UsesKill; /**< shader uses KIL instruction */ - GLboolean UsesPointCoord; /**< shader uses gl_PointCoord */ - GLboolean UsesFrontFacing; /**< shader used gl_FrontFacing */ - GLboolean UsesFogFragCoord; /**< shader used gl_FogFragCoord */ }; @@ -1960,6 +1987,21 @@ struct gl_query_state }; +/** Sync object state */ +struct gl_sync_object { + struct simple_node link; + GLenum Type; /**< GL_SYNC_FENCE */ + GLuint Name; /**< Fence name */ + GLint RefCount; /**< Reference count */ + GLboolean DeletePending; /**< Object was deleted while there were still + * live references (e.g., sync not yet finished) + */ + GLenum SyncCondition; + GLbitfield Flags; /**< Flags passed to glFenceSync */ + GLuint StatusFlag:1; /**< Has the sync object been signaled? */ +}; + + /** Set by #pragma directives */ struct gl_sl_pragmas { @@ -1983,6 +2025,7 @@ struct gl_shader GLboolean Main; /**< shader defines main() */ GLboolean UnresolvedRefs; const GLchar *Source; /**< Source code string */ + GLuint SourceChecksum; /**< for debug/logging purposes */ struct gl_program *Program; /**< Post-compile assembly code */ GLchar *InfoLog; struct gl_sl_pragmas Pragmas; @@ -2013,6 +2056,7 @@ struct gl_shader_program struct gl_program_parameter_list *Varying; GLboolean LinkStatus; /**< GL_LINK_STATUS */ GLboolean Validated; + GLboolean _Used; /**< Ever used for drawing? */ GLchar *InfoLog; }; @@ -2035,6 +2079,7 @@ struct gl_shader_state GLboolean EmitContReturn; /**< Emit CONT/RET opcodes? */ GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ + GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ void *MemPool; GLbitfield Flags; /**< Mask of GLSL_x flags */ struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ @@ -2068,6 +2113,8 @@ struct gl_shared_state GLuint TextureStateStamp; /**< state notification for shared tex */ /*@}*/ + /** Default buffer object for vertex arrays that aren't in VBOs */ + struct gl_buffer_object *NullBufferObj; /** * \name Vertex/fragment programs @@ -2101,8 +2148,9 @@ struct gl_shared_state struct _mesa_HashTable *FrameBuffers; #endif - /** Objects associated with the GL_APPLE_vertex_array_object extension. */ - struct _mesa_HashTable *ArrayObjects; +#if FEATURE_ARB_sync + struct simple_node SyncObjects; +#endif void *DriverData; /**< Device driver shared state */ }; @@ -2407,6 +2455,15 @@ struct gl_constants GLuint MaxVarying; /**< Number of float[4] varying parameters */ GLbitfield SupportedBumpUnits; /**> units supporting GL_ATI_envmap_bumpmap as targets */ + + /** + * Maximum amount of time, measured in nanseconds, that the server can wait. + */ + GLuint64 MaxServerWaitTimeout; + + + /**< GL_EXT_provoking_vertex */ + GLboolean QuadsFollowProvokingVertexConvention; }; @@ -2417,6 +2474,7 @@ struct gl_constants struct gl_extensions { GLboolean dummy; /* don't remove this! */ + GLboolean ARB_copy_buffer; GLboolean ARB_depth_texture; GLboolean ARB_draw_buffers; GLboolean ARB_fragment_program; @@ -2425,15 +2483,18 @@ struct gl_extensions GLboolean ARB_framebuffer_object; GLboolean ARB_half_float_pixel; GLboolean ARB_imaging; + GLboolean ARB_map_buffer_range; GLboolean ARB_multisample; GLboolean ARB_multitexture; GLboolean ARB_occlusion_query; GLboolean ARB_point_sprite; + GLboolean ARB_seamless_cube_map; GLboolean ARB_shader_objects; GLboolean ARB_shading_language_100; GLboolean ARB_shading_language_120; GLboolean ARB_shadow; GLboolean ARB_shadow_ambient; /* or GL_ARB_shadow_ambient */ + GLboolean ARB_sync; GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; GLboolean ARB_texture_cube_map; @@ -2444,6 +2505,7 @@ struct gl_extensions GLboolean ARB_texture_mirrored_repeat; GLboolean ARB_texture_non_power_of_two; GLboolean ARB_transpose_matrix; + GLboolean ARB_vertex_array_object; GLboolean ARB_vertex_buffer_object; GLboolean ARB_vertex_program; GLboolean ARB_vertex_shader; @@ -2475,6 +2537,7 @@ struct gl_extensions GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; GLboolean EXT_polygon_offset; + GLboolean EXT_provoking_vertex; GLboolean EXT_rescale_normal; GLboolean EXT_shadow_funcs; GLboolean EXT_secondary_color; @@ -2623,6 +2686,7 @@ struct gl_matrix_stack #define _NEW_PROGRAM 0x8000000 /**< __GLcontextRec::VertexProgram */ #define _NEW_CURRENT_ATTRIB 0x10000000 /**< __GLcontextRec::Current */ #define _NEW_PROGRAM_CONSTANTS 0x20000000 +#define _NEW_BUFFER_OBJECT 0x40000000 #define _NEW_ALL ~0 /*@}*/ @@ -2948,8 +3012,13 @@ struct __GLcontextRec struct gl_shader_state Shader; /**< GLSL shader object state */ struct gl_query_state Query; /**< occlusion, timer queries */ + + struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */ + struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */ /*@}*/ + struct gl_meta_state *Meta; /**< for "meta" operations */ + #if FEATURE_EXT_framebuffer_object struct gl_renderbuffer *CurrentRenderbuffer; #endif diff --git a/mesa/main/polygon.h b/mesa/main/polygon.h deleted file mode 100644 index 78e8394..0000000 --- a/mesa/main/polygon.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * \file polygon.h - * Polygon operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 POLYGON_H -#define POLYGON_H - - -#include "mtypes.h" - - -extern void -_mesa_polygon_stipple(GLcontext *ctx, const GLubyte *pattern); - - -extern void GLAPIENTRY -_mesa_CullFace( GLenum mode ); - -extern void GLAPIENTRY -_mesa_FrontFace( GLenum mode ); - -extern void GLAPIENTRY -_mesa_PolygonMode( GLenum face, GLenum mode ); - -extern void GLAPIENTRY -_mesa_PolygonOffset( GLfloat factor, GLfloat units ); - -extern void GLAPIENTRY -_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ); - -extern void GLAPIENTRY -_mesa_PolygonStipple( const GLubyte *mask ); - -extern void GLAPIENTRY -_mesa_GetPolygonStipple( GLubyte *mask ); - -extern void -_mesa_init_polygon( GLcontext * ctx ); - -#endif diff --git a/mesa/main/simple_list.h b/mesa/main/simple_list.h index 63475f6..ff7f888 100644 --- a/mesa/main/simple_list.h +++ b/mesa/main/simple_list.h @@ -37,6 +37,11 @@ #ifndef _SIMPLE_LIST_H #define _SIMPLE_LIST_H +struct simple_node { + struct simple_node *next; + struct simple_node *prev; +}; + /** * Remove an element from list. * diff --git a/mesa/main/texgetimage.h b/mesa/main/texgetimage.h index 01f486e..088d27c 100644 --- a/mesa/main/texgetimage.h +++ b/mesa/main/texgetimage.h @@ -43,4 +43,13 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, +extern void GLAPIENTRY +_mesa_GetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, GLvoid *pixels ); + + +extern void GLAPIENTRY +_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); + + #endif /* TEXGETIMAGE_H */ diff --git a/mesa/main/teximage.h b/mesa/main/teximage.h index eb60a1f..094177d 100644 --- a/mesa/main/teximage.h +++ b/mesa/main/teximage.h @@ -73,6 +73,10 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, extern void +_mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage); + + +extern void _mesa_set_tex_image(struct gl_texture_object *tObj, GLenum target, GLint level, struct gl_texture_image *texImage); @@ -111,10 +115,6 @@ extern GLuint _mesa_tex_target_to_face(GLenum target); -extern GLboolean -_mesa_is_color_format(GLenum format); - - /** * Lock a texture for updating. See also _mesa_lock_context_textures(). */ @@ -164,11 +164,6 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat, extern void GLAPIENTRY -_mesa_GetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels ); - - -extern void GLAPIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, @@ -260,9 +255,6 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -extern void GLAPIENTRY -_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); - /*@}*/ #endif diff --git a/mesa/main/texobj.h b/mesa/main/texobj.h index 2599c08..9bfebd4 100644 --- a/mesa/main/texobj.h +++ b/mesa/main/texobj.h @@ -58,6 +58,9 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, const struct gl_texture_object *src ); extern void +_mesa_clear_texture_object(GLcontext *ctx, struct gl_texture_object *obj); + +extern void _mesa_reference_texobj(struct gl_texture_object **ptr, struct gl_texture_object *tex); @@ -65,6 +68,10 @@ extern void _mesa_test_texobj_completeness( const GLcontext *ctx, struct gl_texture_object *obj ); +extern void +_mesa_dirty_texobj(GLcontext *ctx, struct gl_texture_object *texObj, + GLboolean invalidate_state); + extern struct gl_texture_object * _mesa_get_fallback_texture(GLcontext *ctx); @@ -76,7 +83,6 @@ _mesa_lock_context_textures( GLcontext *ctx ); /*@}*/ - /** * \name API functions */ diff --git a/mesa/main/texstate.h b/mesa/main/texstate.h index a7d7088..17ac680 100644 --- a/mesa/main/texstate.h +++ b/mesa/main/texstate.h @@ -35,6 +35,18 @@ #include "mtypes.h" +/** + * Return pointer to current texture unit. + * This the texture unit set by glActiveTexture(), not glClientActiveTexture(). + */ +static INLINE struct gl_texture_unit * +_mesa_get_current_tex_unit(GLcontext *ctx) +{ + ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->Texture.Unit)); + return &(ctx->Texture.Unit[ctx->Texture.CurrentUnit]); +} + + extern void _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ); @@ -48,16 +60,14 @@ _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ); */ /*@{*/ - -/* - * GL_ARB_multitexture - */ extern void GLAPIENTRY _mesa_ActiveTextureARB( GLenum target ); extern void GLAPIENTRY _mesa_ClientActiveTextureARB( GLenum target ); +/*@}*/ + /** * \name Initialization, state maintenance diff --git a/mesa/main/varray.h b/mesa/main/varray.h index 97d5c82..becc67c 100644 --- a/mesa/main/varray.h +++ b/mesa/main/varray.h @@ -1,18 +1,9 @@ -/** - * \file varray.h - * Vertex arrays. - * - * \if subset - * (No-op) - * - * \endif - */ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 7.6 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * 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"), @@ -169,14 +160,26 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +extern void +_mesa_copy_client_array(GLcontext *ctx, + struct gl_client_array *dst, + struct gl_client_array *src); + + +extern void +_mesa_print_arrays(GLcontext *ctx); extern void _mesa_init_varray( GLcontext * ctx ); +extern void +_mesa_free_varray_data(GLcontext *ctx); + #else /** No-op */ #define _mesa_init_varray( c ) ((void)0) +#define _mesa_free_varray_data( c ) ((void)0) #endif |