aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/bufferobj.c1
-rw-r--r--mesalib/src/mesa/main/compiler.h9
-rw-r--r--mesalib/src/mesa/main/enums.h2
-rw-r--r--mesalib/src/mesa/main/mtypes.h2
-rw-r--r--mesalib/src/mesa/main/teximage.c33
5 files changed, 29 insertions, 18 deletions
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index b22340ff3..312ffb788 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -440,7 +440,6 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
* Note that all GL error checking will have been done already.
*
* \param ctx GL context.
- * \param target Buffer object target on which to operate.
* \param offset Offset of the first byte to be modified.
* \param size Size, in bytes, of the data range.
* \param data Pointer to the data to store in the buffer object.
diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h
index fb7baf84e..0f27d5a66 100644
--- a/mesalib/src/mesa/main/compiler.h
+++ b/mesalib/src/mesa/main/compiler.h
@@ -270,6 +270,15 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
#define NULL 0
#endif
+/* Used to optionally mark structures with misaligned elements or size as
+ * packed, to trade off performance for space.
+ */
+#if (__GNUC__ >= 3)
+#define PACKED __attribute__((__packed__))
+#else
+#define PACKED
+#endif
+
/**
* LONGSTRING macro
diff --git a/mesalib/src/mesa/main/enums.h b/mesalib/src/mesa/main/enums.h
index 556c1db99..36c053d4b 100644
--- a/mesalib/src/mesa/main/enums.h
+++ b/mesalib/src/mesa/main/enums.h
@@ -44,6 +44,4 @@ extern const char *_mesa_lookup_enum_by_nr( int nr );
*/
const char *_mesa_lookup_prim_by_nr( unsigned nr );
-extern int _mesa_lookup_enum_by_name( const char *symbol );
-
#endif
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index c88c1c67b..448946c03 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -3498,8 +3498,6 @@ struct gl_uniform_buffer_binding
* OpenGL state is contained in this structure.
* Think of this as a base class from which device drivers will derive
* sub classes.
- *
- * The struct gl_context typedef names this structure.
*/
struct gl_context
{
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index b719fc856..c1261138d 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -661,22 +661,29 @@ _mesa_delete_texture_image(struct gl_context *ctx,
GLboolean
_mesa_is_proxy_texture(GLenum target)
{
+ unsigned i;
+ static const GLenum targets[] = {
+ GL_PROXY_TEXTURE_1D,
+ GL_PROXY_TEXTURE_2D,
+ GL_PROXY_TEXTURE_3D,
+ GL_PROXY_TEXTURE_CUBE_MAP,
+ GL_PROXY_TEXTURE_RECTANGLE,
+ GL_PROXY_TEXTURE_1D_ARRAY,
+ GL_PROXY_TEXTURE_2D_ARRAY,
+ GL_PROXY_TEXTURE_CUBE_MAP_ARRAY,
+ GL_PROXY_TEXTURE_2D_MULTISAMPLE,
+ GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY
+ };
/*
- * NUM_TEXTURE_TARGETS should match number of terms below, except there's no
+ * NUM_TEXTURE_TARGETS should match number of terms above, except there's no
* proxy for GL_TEXTURE_BUFFER and GL_TEXTURE_EXTERNAL_OES.
*/
- assert(NUM_TEXTURE_TARGETS == 10 + 2);
-
- return (target == GL_PROXY_TEXTURE_1D ||
- target == GL_PROXY_TEXTURE_2D ||
- target == GL_PROXY_TEXTURE_3D ||
- target == GL_PROXY_TEXTURE_CUBE_MAP_ARB ||
- target == GL_PROXY_TEXTURE_RECTANGLE_NV ||
- target == GL_PROXY_TEXTURE_1D_ARRAY_EXT ||
- target == GL_PROXY_TEXTURE_2D_ARRAY_EXT ||
- target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY ||
- target == GL_PROXY_TEXTURE_2D_MULTISAMPLE ||
- target == GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY);
+ STATIC_ASSERT(NUM_TEXTURE_TARGETS == Elements(targets) + 2);
+
+ for (i = 0; i < Elements(targets); ++i)
+ if (target == targets[i])
+ return GL_TRUE;
+ return GL_FALSE;
}