Unify ARB_depth_texture and SGIX_depth_texture
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 1 Oct 2008 22:51:56 +0000 (15:51 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 2 Oct 2008 03:38:10 +0000 (20:38 -0700)
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.

src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_tex_copy.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/main/depthstencil.c
src/mesa/main/extensions.c
src/mesa/main/mtypes.h
src/mesa/main/texformat.c
src/mesa/main/teximage.c
src/mesa/main/texparam.c
src/mesa/swrast/s_texstore.c

index efcac911aa6dd86d5d0b408e33600f6d0da853f2..e0ddc7fd61314d8c6ae5c5d96a3a8dd2448f9da4 100644 (file)
@@ -56,8 +56,6 @@ static const struct dri_extension i915_extensions[] = {
    {"GL_ARB_shadow", NULL},
    {"GL_ARB_texture_non_power_of_two", NULL},
    {"GL_EXT_shadow_funcs", NULL},
-   /* ARB extn won't work if not enabled */
-   {"GL_SGIX_depth_texture", NULL},
    {NULL, NULL}
 };
 
index 1dd3ee7d0a6cd22de2b4455b7386e20e017744d8..e53972c46dd36ff778c1d72d0379fc9228b3d76a 100644 (file)
@@ -404,8 +404,6 @@ static const struct dri_extension brw_extensions[] = {
    { "GL_ARB_vertex_shader",              GL_ARB_vertex_shader_functions },
    { "GL_EXT_shadow_funcs",               NULL },
    { "GL_EXT_texture_sRGB",              NULL },
-   /* ARB extn won't work if not enabled */
-   { "GL_SGIX_depth_texture",             NULL },
    { NULL,                                NULL }
 };
 
index a7b88b39c04d28ab8f2f04a83bce52421879d5aa..f4cb4a781c6500193e4c76c31455dd2adb0645b1 100644 (file)
@@ -60,7 +60,7 @@ get_teximage_source(struct intel_context *intel, GLenum internalFormat)
 
    switch (internalFormat) {
    case GL_DEPTH_COMPONENT:
-   case GL_DEPTH_COMPONENT16_ARB:
+   case GL_DEPTH_COMPONENT16:
       irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH);
       if (irb && irb->region && irb->region->cpp == 2)
          return irb->region;
index ee4a69dce36b9b789d8a54ceee63a459885c3e99..37436275e34ea7a9a9aa1d3f4c661936cd8dbfc4 100644 (file)
@@ -138,7 +138,6 @@ const struct dri_extension card_extensions[] = {
   {"GL_NV_blend_square",               NULL},
   {"GL_NV_vertex_program",             GL_NV_vertex_program_functions},
   {"GL_SGIS_generate_mipmap",          NULL},
-  {"GL_SGIX_depth_texture",            NULL},
   {NULL,                               NULL}
   /* *INDENT-ON* */
 };
index fb54d6184d95bc451ec195aae3695603e0b7705a..9d208e2997d39ed4ec19ed442c0771880b6ae2c4 100644 (file)
@@ -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;
index ddcb44f06bf36129df7f910f3ecf64a609e026c1..de75325f1520bdb660e4bf2c6557316f9f79c8c4 100644 (file)
@@ -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
index 19cf6f56d1a91a91f032c3a697ff03f64fd906fa..62bc65cc72cc0729a58b7ad0c5066f953cbb1ed8 100644 (file)
@@ -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;
index d4ccdf9fa06dfc61ae5c98990f909b709054f0db..4442ce39a447262d62d6ffd8fcbe8fd5499876be 100644 (file)
@@ -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 */
index b0a2d6ddb3dcceee3a8162dffe2002019cb9e0f7..4a419fde261ec8f06581b4c6def1f90bbf15dd3d 100644 (file)
@@ -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;
    }
index acddb6663bb5e0c97a768d68c463ab054f543a55..a9e752a6371096cff5869de2924403843c604cc5 100644 (file)
@@ -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,
index 15d52aa587c62c95b15f2915f85120ad14a2a7a1..16b00b9fa1c637eb7dbfd44ff6b3afde95a36019 100644 (file)
@@ -216,9 +216,9 @@ is_depth_format(GLenum format)
 {
    switch (format) {
       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_TRUE;
       default:
          return GL_FALSE;