X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fmtypes.h;h=514170dbcf0c7a84fa7c37d7c0e0eb3891b28746;hb=09fbb3837b6aa5dfc6c94f41ab5443820177c569;hp=4fc98f4628af160b96ddb7c32aefd89be7562f52;hpb=3e45db67294faaf0a06c42bdd6dbdb96f87c8801;p=mesa.git diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4fc98f4628a..514170dbcf0 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -36,10 +36,10 @@ #include "glheader.h" -#include /* GLimports/GLexports/GLcontextModes */ +#include /* __GLcontextModes (GLvisual) */ #include "config.h" /* Hardwired parameters */ -#include "glapitable.h" -#include "glthread.h" +#include "glapi/glapitable.h" +#include "glapi/glthread.h" #include "math/m_matrix.h" /* GLmatrix */ #include "bitset.h" @@ -47,7 +47,7 @@ /** * Special, internal token */ -#define GL_SHADER_PROGRAM 0x9999 +#define GL_SHADER_PROGRAM_MESA 0x9999 /** @@ -126,6 +126,8 @@ struct gl_pixelstore_attrib; struct gl_texture_format; struct gl_texture_image; struct gl_texture_object; +struct st_context; +struct pipe_surface; typedef struct __GLcontextRec GLcontext; typedef struct __GLcontextModesRec GLvisual; typedef struct gl_framebuffer GLframebuffer; @@ -917,7 +919,6 @@ struct gl_line_attrib GLushort StipplePattern; /**< Stipple pattern */ GLint StippleFactor; /**< Stipple repeat factor */ GLfloat Width; /**< Line width */ - GLfloat _Width; /**< Clamped Line width */ }; @@ -1063,7 +1064,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 */ @@ -1127,17 +1127,19 @@ struct gl_stencil_attrib }; -#define NUM_TEXTURE_TARGETS 5 /* 1D, 2D, 3D, CUBE and RECT */ +#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */ /** * 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_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 /*@}*/ /** @@ -1145,11 +1147,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_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) /*@}*/ @@ -1286,15 +1290,22 @@ struct gl_texture_format * GL_DEPTH_COMPONENT. */ GLenum DataType; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */ - GLubyte RedBits; /**< Bits per texel component */ - GLubyte GreenBits; /**< These are just rough approximations for */ - GLubyte BlueBits; /**< compressed texture formats. */ + + /** + * Bits per texel component. These are just rough approximations + * for compressed texture formats. + */ + /*@{*/ + GLubyte RedBits; + GLubyte GreenBits; + GLubyte BlueBits; GLubyte AlphaBits; GLubyte LuminanceBits; GLubyte IntensityBits; GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; /**< GL_EXT_packed_depth_stencil */ + /*@}*/ GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ @@ -1316,8 +1327,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. @@ -1382,7 +1391,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 /*@}*/ @@ -1393,7 +1402,6 @@ struct gl_texture_image */ struct gl_texture_object { - _glthread_Mutex Mutex; /**< for thread safety */ GLint RefCount; /**< reference count */ GLuint Name; /**< the user-visible texture object ID */ GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ @@ -1416,11 +1424,15 @@ struct gl_texture_object GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ + GLenum _Function; /**< Comparison function derived from + * \c CompareOperator, \c CompareMode, and + * \c CompareFunc. + */ GLenum DepthMode; /**< GL_ARB_depth_texture */ GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ - GLboolean Complete; /**< Is texture object complete? */ + GLboolean _Complete; /**< Is texture object complete? */ /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; @@ -1487,7 +1499,7 @@ struct gl_texture_unit GLbitfield _GenBitT; GLbitfield _GenBitR; GLbitfield _GenBitQ; - GLbitfield _GenFlags; /**< bitwise or of GenBit[STRQ] */ + GLbitfield _GenFlags; /**< bitwise or of _GenBit[STRQ] */ GLfloat ObjectPlaneS[4]; GLfloat ObjectPlaneT[4]; GLfloat ObjectPlaneR[4]; @@ -1520,19 +1532,28 @@ struct gl_texture_unit struct gl_texture_object *Current3D; struct gl_texture_object *CurrentCubeMap; /**< GL_ARB_texture_cube_map */ struct gl_texture_object *CurrentRect; /**< GL_NV_texture_rectangle */ + struct gl_texture_object *Current1DArray; /**< GL_MESA_texture_array */ + struct gl_texture_object *Current2DArray; /**< GL_MESA_texture_array */ struct gl_texture_object *_Current; /**< Points to really enabled tex obj */ - struct gl_texture_object Saved1D; /**< only used by glPush/PopAttrib */ + /** These are used for glPush/PopAttrib */ + /*@{*/ + struct gl_texture_object Saved1D; struct gl_texture_object Saved2D; struct gl_texture_object Saved3D; struct gl_texture_object SavedCubeMap; struct gl_texture_object SavedRect; + struct gl_texture_object Saved1DArray; + struct gl_texture_object Saved2DArray; + /*@}*/ - /* GL_SGI_texture_color_table */ + /** GL_SGI_texture_color_table */ + /*@{*/ struct gl_color_table ColorTable; struct gl_color_table ProxyColorTable; GLboolean ColorTableEnabled; + /*@}*/ }; struct texenvprog_cache_item { @@ -1572,6 +1593,8 @@ struct gl_texture_attrib struct gl_texture_object *Proxy3D; struct gl_texture_object *ProxyCubeMap; struct gl_texture_object *ProxyRect; + struct gl_texture_object *Proxy1DArray; + struct gl_texture_object *Proxy2DArray; /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; @@ -1878,6 +1901,7 @@ struct gl_program GLbitfield InputsRead; /**< Bitmask of which input regs are read */ GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */ + GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */ /** Named parameters, constants, etc. from program text */ struct gl_program_parameter_list *Parameters; @@ -2061,10 +2085,11 @@ struct gl_ati_fragment_shader_state */ struct gl_query_object { - GLuint Id; - GLuint64EXT Result; /* the counter */ - GLboolean Active; /* inside Begin/EndQuery */ - GLboolean Ready; /* result is ready */ + GLenum Target; /**< The query target, when active */ + GLuint Id; /**< hash table ID/name */ + GLuint64EXT Result; /**< the counter */ + GLboolean Active; /**< inside Begin/EndQuery */ + GLboolean Ready; /**< result is ready? */ }; @@ -2133,6 +2158,7 @@ struct gl_shader_state GLboolean EmitHighLevelInstructions; /**< IF/ELSE/ENDIF vs. BRA, etc. */ GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ + void *MemPool; }; @@ -2155,6 +2181,8 @@ struct gl_shared_state struct gl_texture_object *Default3D; struct gl_texture_object *DefaultCubeMap; struct gl_texture_object *DefaultRect; + struct gl_texture_object *Default1DArray; + struct gl_texture_object *Default2DArray; /*@}*/ /** @@ -2164,12 +2192,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 */ @@ -2222,6 +2249,8 @@ struct gl_shared_state */ struct gl_renderbuffer { +#define RB_MAGIC 0xaabbccdd + int Magic; /** XXX TEMPORARY DEBUG INFO */ _glthread_Mutex Mutex; /**< for thread safety */ GLuint ClassID; /**< Useful for drivers */ GLuint Name; @@ -2319,17 +2348,24 @@ struct gl_renderbuffer */ struct gl_renderbuffer_attachment { - GLenum Type; /* GL_NONE or GL_TEXTURE or GL_RENDERBUFFER_EXT */ + GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */ GLboolean Complete; - /* IF Type == GL_RENDERBUFFER_EXT: */ + /** + * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the + * application supplied renderbuffer object. + */ struct gl_renderbuffer *Renderbuffer; - /* IF Type == GL_TEXTURE: */ + /** + * If \c Type is \c GL_TEXTURE, this stores a pointer to the application + * supplied texture object. + */ struct gl_texture_object *Texture; - GLuint TextureLevel; - GLuint CubeMapFace; /* 0 .. 5, for cube map textures */ - GLuint Zoffset; /* for 3D textures */ + GLuint TextureLevel; /**< Attached mipmap level. */ + GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ + GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D + * and 2D array textures */ }; @@ -2435,6 +2471,7 @@ struct gl_constants GLint MaxTextureLevels; /**< Maximum number of allowed mipmap levels. */ GLint Max3DTextureLevels; /**< Maximum number of allowed mipmap levels for 3D texture targets. */ GLint MaxCubeTextureLevels; /**< Maximum number of allowed mipmap levels for GL_ARB_texture_cube_map */ + GLint MaxArrayTextureLayers; /**< Maximum number of layers in an array texture. */ GLint MaxTextureRectSize; /* GL_NV_texture_rectangle */ GLuint MaxTextureCoordUnits; GLuint MaxTextureImageUnits; @@ -2494,6 +2531,7 @@ struct gl_extensions GLboolean ARB_depth_texture; GLboolean ARB_draw_buffers; GLboolean ARB_fragment_program; + GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; GLboolean ARB_half_float_pixel; GLboolean ARB_imaging; @@ -2583,6 +2621,7 @@ struct gl_extensions GLboolean MESA_program_debug; GLboolean MESA_resize_buffers; GLboolean MESA_ycbcr_texture; + GLboolean MESA_texture_array; GLboolean NV_blend_square; GLboolean NV_fragment_program; GLboolean NV_light_max_exponent; @@ -2882,17 +2921,6 @@ struct gl_dlist_state */ struct __GLcontextRec { - /** - * \name OS related interfaces. - * - * These \b must be the first members of this structure, because they are - * exposed to the outside world (i.e. GLX extension). - */ - /*@{*/ - __GLimports imports; - __GLexports exports; - /*@}*/ - /** State possibly shared with other contexts in the address space */ struct gl_shared_state *Shared; @@ -3077,7 +3105,7 @@ struct __GLcontextRec void *swsetup_context; void *swtnl_context; void *swtnl_im; - void *acache_context; + struct st_context *st; void *aelt_context; /*@}*/ };