summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-09-20 19:40:52 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-09-20 19:40:52 +0000
commitd2fba8a63339abd1a810df53bd90bb20b30c6cb2 (patch)
treee50c71955fef1c1cafc77c6314e93932a5c680e7
parent8d7ed801a5aab0e8922363873e4e5b1f3be1eacc (diff)
sync with DRI R200 branch (GL_APPLE_client_storage extension)
-rw-r--r--include/GL/gl.h14
-rw-r--r--src/mesa/main/extensions.c5
-rw-r--r--src/mesa/main/image.c17
-rw-r--r--src/mesa/main/mtypes.h5
-rw-r--r--src/mesa/main/pixel.c11
-rw-r--r--src/mesa/main/texformat.c8
-rw-r--r--src/mesa/main/teximage.c10
7 files changed, 47 insertions, 23 deletions
diff --git a/include/GL/gl.h b/include/GL/gl.h
index 04e8449f35..720302edfa 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -1,4 +1,4 @@
-/* $Id: gl.h,v 1.59.2.9 2002/09/19 16:29:48 brianp Exp $ */
+/* $Id: gl.h,v 1.59.2.10 2002/09/20 19:41:32 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -2527,10 +2527,22 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
#define GL_MESA_ycbcr_texture 1
#define GL_YCBCR_MESA 0x8757
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple */
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple */
#endif /* GL_MESA_texture_ycbcr */
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+
+#endif /* GL_APPLE_client_storage */
+
+
+
#ifndef GL_APPLE_ycbcr_422
#define GL_APPLE_ycbcr_422 1
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 4951eb63dd..e3bd1540c9 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -1,4 +1,4 @@
-/* $Id: extensions.c,v 1.65.2.4 2002/09/13 19:34:38 brianp Exp $ */
+/* $Id: extensions.c,v 1.65.2.5 2002/09/20 19:40:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -120,7 +120,8 @@ static struct {
{ OFF, "GL_SGIX_pixel_texture", F(SGIX_pixel_texture) },
{ OFF, "GL_SGIX_shadow", F(SGIX_shadow) },
{ OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) },
- { OFF, "GL_3DFX_texture_compression_FXT1", F(_3DFX_texture_compression_FXT1) }
+ { OFF, "GL_3DFX_texture_compression_FXT1", F(_3DFX_texture_compression_FXT1) },
+ { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) },
};
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 10bf04bde0..9fc4c7babb 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.63.2.3 2002/09/14 16:49:42 brianp Exp $ */
+/* $Id: image.c,v 1.63.2.4 2002/09/20 19:40:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -57,7 +57,8 @@ const struct gl_pixelstore_attrib _mesa_native_packing = {
0, /* ImageHeight */
0, /* SkipImages */
GL_FALSE, /* SwapBytes */
- GL_FALSE /* LsbFirst */
+ GL_FALSE, /* LsbFirst */
+ GL_FALSE /* ClientStorage */
};
@@ -203,8 +204,8 @@ GLint _mesa_sizeof_packed_type( GLenum type )
return sizeof(GLuint);
case GL_UNSIGNED_INT_2_10_10_10_REV:
return sizeof(GLuint);
- case GL_UNSIGNED_SHORT_8_8_APPLE:
- case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
+ case GL_UNSIGNED_SHORT_8_8_MESA:
+ case GL_UNSIGNED_SHORT_8_8_REV_MESA:
return sizeof(GLushort);
default:
return -1;
@@ -308,8 +309,8 @@ GLint _mesa_bytes_per_pixel( GLenum format, GLenum type )
return sizeof(GLuint);
else
return -1;
- case GL_UNSIGNED_SHORT_8_8_APPLE:
- case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
+ case GL_UNSIGNED_SHORT_8_8_MESA:
+ case GL_UNSIGNED_SHORT_8_8_REV_MESA:
if (format == GL_YCBCR_MESA)
return sizeof(GLushort);
else
@@ -405,8 +406,8 @@ _mesa_is_legal_format_and_type( GLenum format, GLenum type )
return GL_FALSE;
}
case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_SHORT_8_8_REV_APPLE)
+ if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
+ type == GL_UNSIGNED_SHORT_8_8_REV_MESA)
return GL_TRUE;
else
return GL_FALSE;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 46fea70f0c..6442f60298 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.51.2.10 2002/09/15 17:35:05 brianp Exp $ */
+/* $Id: mtypes.h,v 1.51.2.11 2002/09/20 19:40:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -809,6 +809,7 @@ struct gl_texture_image {
GLuint DepthLog2; /* = log2(Depth2) */
GLuint MaxLog2; /* = MAX(WidthLog2, HeightLog2) */
GLvoid *Data; /* Image data, accessed via FetchTexel() */
+ GLboolean IsClientData; /* Data owned by client? */
const struct gl_texture_format *TexFormat;
@@ -991,6 +992,7 @@ struct gl_pixelstore_attrib {
GLint SkipImages; /* for GL_EXT_texture3D */
GLboolean SwapBytes;
GLboolean LsbFirst;
+ GLboolean ClientStorage; /* GL_APPLE_client_storage */
};
@@ -1257,6 +1259,7 @@ struct gl_extensions {
GLboolean SGIX_shadow;
GLboolean SGIX_shadow_ambient;
GLboolean _3DFX_texture_compression_FXT1;
+ GLboolean APPLE_client_storage;
};
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 1c34fbbfd4..175cfe7db4 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1,8 +1,8 @@
-/* $Id: pixel.c,v 1.31.2.2 2002/04/24 20:41:51 brianp Exp $ */
+/* $Id: pixel.c,v 1.31.2.3 2002/09/20 19:40:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.0.4
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -223,6 +223,13 @@ _mesa_PixelStorei( GLenum pname, GLint param )
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Unpack.Alignment = param;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ if (param == (GLint)ctx->Unpack.ClientStorage)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
+ ctx->Unpack.ClientStorage = param ? GL_TRUE : GL_FALSE;
+ break;
+
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" );
return;
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 5f14913905..f5229ae4a1 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -1,4 +1,4 @@
-/* $Id: texformat.c,v 1.11.2.1 2002/09/13 19:34:40 brianp Exp $ */
+/* $Id: texformat.c,v 1.11.2.2 2002/09/20 19:40:54 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -442,7 +442,7 @@ const struct gl_texture_format _mesa_texformat_ci8 = {
const struct gl_texture_format _mesa_texformat_ycbcr = {
MESA_FORMAT_YCBCR, /* MesaFormat */
GL_YCBCR_MESA, /* BaseFormat */
- GL_UNSIGNED_SHORT_8_8_APPLE, /* Type */
+ GL_UNSIGNED_SHORT_8_8_MESA, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -461,7 +461,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr = {
const struct gl_texture_format _mesa_texformat_ycbcr_rev = {
MESA_FORMAT_YCBCR_REV, /* MesaFormat */
GL_YCBCR_MESA, /* BaseFormat */
- GL_UNSIGNED_SHORT_8_8_REV_APPLE, /* Type */
+ GL_UNSIGNED_SHORT_8_8_REV_MESA, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -631,7 +631,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
return &_mesa_texformat_rgba;
case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE)
+ if (type == GL_UNSIGNED_SHORT_8_8_MESA)
return &_mesa_texformat_ycbcr;
else
return &_mesa_texformat_ycbcr_rev;
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index e735648a17..8ec070478f 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.104.2.10 2002/09/15 17:35:05 brianp Exp $ */
+/* $Id: teximage.c,v 1.104.2.11 2002/09/20 19:40:54 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -904,8 +904,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
ASSERT(ctx->Extensions.MESA_ycbcr_texture);
if (format != GL_YCBCR_MESA ||
iformat != GL_YCBCR_MESA ||
- (type != GL_UNSIGNED_SHORT_8_8_APPLE &&
- type != GL_UNSIGNED_SHORT_8_8_REV_APPLE)) {
+ (type != GL_UNSIGNED_SHORT_8_8_MESA &&
+ type != GL_UNSIGNED_SHORT_8_8_REV_MESA)) {
char message[100];
sprintf(message,
"glTexImage%d(format/type/internalFormat YCBCR mismatch",
@@ -1437,9 +1437,9 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
width * sizeof(GLushort));
/* check for byte swapping */
if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR
- && type == GL_UNSIGNED_SHORT_8_8_REV_APPLE) ||
+ && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) ||
(texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV
- && type == GL_UNSIGNED_SHORT_8_8_APPLE)) {
+ && type == GL_UNSIGNED_SHORT_8_8_MESA)) {
if (!ctx->Pack.SwapBytes)
_mesa_swap2((GLushort *) dest, width);
}