summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2008-10-01 15:51:56 -0700
committerIan Romanick <[email protected]>2008-10-01 20:38:10 -0700
commit4741dbcbbc2514de370a760f4b78a17491014555 (patch)
treeedbc0a4d5585fd42da49f7d832173ec41508ec3b /src/mesa/main
parent17fdd1ab3b48da8dff742e626c3c59bc89cafeed (diff)
Unify ARB_depth_texture and SGIX_depth_texture
The ARB extension is a superset of the older SGIX extension. Any hardware that can support the SGIX version can also support the ARB version. In Mesa, any driver that supports one also supports the other. This unification just simplifies some bits of code.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/depthstencil.c4
-rw-r--r--src/mesa/main/extensions.c3
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/texformat.c9
-rw-r--r--src/mesa/main/teximage.c18
-rw-r--r--src/mesa/main/texparam.c3
6 files changed, 16 insertions, 22 deletions
diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c
index fb54d6184d9..9d208e2997d 100644
--- a/src/mesa/main/depthstencil.c
+++ b/src/mesa/main/depthstencil.c
@@ -282,8 +282,8 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx,
z24rb->RefCount = 1;
z24rb->Width = dsrb->Width;
z24rb->Height = dsrb->Height;
- z24rb->InternalFormat = GL_DEPTH_COMPONENT24_ARB;
- z24rb->_ActualFormat = GL_DEPTH_COMPONENT24_ARB;
+ z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
+ z24rb->_ActualFormat = GL_DEPTH_COMPONENT24;
z24rb->_BaseFormat = GL_DEPTH_COMPONENT;
z24rb->DataType = GL_UNSIGNED_INT;
z24rb->DepthBits = 24;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index ddcb44f06bf..de75325f152 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -165,7 +165,7 @@ static const struct {
{ OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) },
{ ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
{ ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) },
- { OFF, "GL_SGIX_depth_texture", F(SGIX_depth_texture) },
+ { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) },
{ OFF, "GL_SGIX_shadow", F(SGIX_shadow) },
{ OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) },
{ OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) },
@@ -292,7 +292,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.SGI_texture_color_table = GL_TRUE;
ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
- ctx->Extensions.SGIX_depth_texture = GL_TRUE;
ctx->Extensions.SGIX_shadow = GL_TRUE;
ctx->Extensions.SGIX_shadow_ambient = GL_TRUE;
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 19cf6f56d1a..62bc65cc72c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2626,7 +2626,6 @@ struct gl_extensions
GLboolean SGIS_generate_mipmap;
GLboolean SGIS_texture_edge_clamp;
GLboolean SGIS_texture_lod;
- GLboolean SGIX_depth_texture;
GLboolean SGIX_shadow;
GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */
GLboolean TDFX_texture_compression_FXT1;
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index d4ccdf9fa06..4442ce39a44 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -1420,14 +1420,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
; /* fallthrough */
}
- if (ctx->Extensions.SGIX_depth_texture ||
- ctx->Extensions.ARB_depth_texture) {
+ if (ctx->Extensions.ARB_depth_texture) {
switch (internalFormat) {
case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT24_SGIX:
- case GL_DEPTH_COMPONENT32_SGIX:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
return &_mesa_texformat_z32;
- case GL_DEPTH_COMPONENT16_SGIX:
+ case GL_DEPTH_COMPONENT16:
return &_mesa_texformat_z16;
default:
; /* fallthrough */
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b0a2d6ddb3d..4a419fde261 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -241,13 +241,12 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat )
}
}
- if (ctx->Extensions.SGIX_depth_texture ||
- ctx->Extensions.ARB_depth_texture) {
+ if (ctx->Extensions.ARB_depth_texture) {
switch (internalFormat) {
case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT16_SGIX:
- case GL_DEPTH_COMPONENT24_SGIX:
- case GL_DEPTH_COMPONENT32_SGIX:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
return GL_DEPTH_COMPONENT;
default:
; /* fallthrough */
@@ -526,9 +525,9 @@ static GLboolean
is_depth_format(GLenum format)
{
switch (format) {
- case GL_DEPTH_COMPONENT16_ARB:
- case GL_DEPTH_COMPONENT24_ARB:
- case GL_DEPTH_COMPONENT32_ARB:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
case GL_DEPTH_COMPONENT:
return GL_TRUE;
default:
@@ -2297,8 +2296,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
return;
}
- if (!ctx->Extensions.SGIX_depth_texture &&
- !ctx->Extensions.ARB_depth_texture && is_depth_format(format)) {
+ if (!ctx->Extensions.ARB_depth_texture && is_depth_format(format)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
return;
}
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index acddb6663bb..a9e752a6371 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -642,8 +642,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = 0;
break;
case GL_TEXTURE_DEPTH_SIZE_ARB:
- if (ctx->Extensions.SGIX_depth_texture ||
- ctx->Extensions.ARB_depth_texture)
+ if (ctx->Extensions.ARB_depth_texture)
*params = img->TexFormat->DepthBits;
else
_mesa_error(ctx, GL_INVALID_ENUM,