Browse Source

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.
tags/mesa_7_3_rc1
Ian Romanick 17 years ago
parent
commit
4741dbcbbc

+ 0
- 2
src/mesa/drivers/dri/i915/i915_context.c View 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}
};


+ 0
- 2
src/mesa/drivers/dri/intel/intel_context.c View 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 }
};


+ 1
- 1
src/mesa/drivers/dri/intel/intel_tex_copy.c View 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;

+ 0
- 1
src/mesa/drivers/dri/r300/r300_context.c View 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* */
};

+ 2
- 2
src/mesa/main/depthstencil.c View 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;

+ 1
- 2
src/mesa/main/extensions.c View 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

+ 0
- 1
src/mesa/main/mtypes.h View 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;

+ 4
- 5
src/mesa/main/texformat.c View 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 */

+ 8
- 10
src/mesa/main/teximage.c View 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;
}

+ 1
- 2
src/mesa/main/texparam.c View 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,

+ 3
- 3
src/mesa/swrast/s_texstore.c View 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;

Loading…
Cancel
Save