From a92b9e60aba8cd1fc5d935abc9fd8f37cae89168 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 13 Nov 2013 14:10:34 -0800 Subject: [PATCH] mesa: GL_EXT_packed_depth_stencil is not optional Every driver supports it. All current and future Gallium drivers always support it, and all existing classic drivers support it. Signed-off-by: Ian Romanick Reviewed-by: Brian Paul --- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - .../drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 1 - src/mesa/main/extensions.c | 7 +++---- src/mesa/main/fbobject.c | 19 ++++++------------- src/mesa/main/glformats.c | 6 +----- src/mesa/main/mtypes.h | 1 - src/mesa/main/teximage.c | 2 -- src/mesa/main/texparam.c | 3 --- src/mesa/state_tracker/st_extensions.c | 8 +------- 12 files changed, 11 insertions(+), 40 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index 1e48231ba6e..a5cff703aea 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -65,7 +65,6 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.EXT_blend_minmax = true; ctx->Extensions.EXT_framebuffer_blit = true; ctx->Extensions.EXT_gpu_program_parameters = true; - ctx->Extensions.EXT_packed_depth_stencil = true; ctx->Extensions.EXT_pixel_buffer_object = true; ctx->Extensions.EXT_point_parameters = true; ctx->Extensions.EXT_provoking_vertex = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 1ad3f49fbfc..de07b7fdab8 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -209,7 +209,6 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.EXT_framebuffer_blit = true; ctx->Extensions.EXT_framebuffer_sRGB = true; ctx->Extensions.EXT_gpu_program_parameters = true; - ctx->Extensions.EXT_packed_depth_stencil = true; ctx->Extensions.EXT_packed_float = true; ctx->Extensions.EXT_pixel_buffer_object = true; ctx->Extensions.EXT_point_parameters = true; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 18c6e776f2b..181c9d0f2e4 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -185,7 +185,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, ctx->Extensions.EXT_blend_color = true; ctx->Extensions.EXT_blend_minmax = true; ctx->Extensions.EXT_framebuffer_blit = true; - ctx->Extensions.EXT_packed_depth_stencil = true; ctx->Extensions.EXT_texture_filter_anisotropic = true; ctx->Extensions.NV_texture_env_combine4 = true; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 331214b76e5..5c53720d1b1 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -383,7 +383,6 @@ GLboolean r200CreateContext( gl_api api, ctx->Extensions.EXT_blend_func_separate = true; ctx->Extensions.EXT_blend_minmax = true; ctx->Extensions.EXT_gpu_program_parameters = true; - ctx->Extensions.EXT_packed_depth_stencil = true; ctx->Extensions.EXT_point_parameters = true; ctx->Extensions.EXT_texture_env_dot3 = true; ctx->Extensions.EXT_texture_filter_anisotropic = true; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index cc1e62f54cd..02dbe064421 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -336,7 +336,6 @@ r100CreateContext( gl_api api, ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true; ctx->Extensions.ATI_texture_env_combine3 = true; ctx->Extensions.ATI_texture_mirror_once = true; - ctx->Extensions.EXT_packed_depth_stencil = true; ctx->Extensions.EXT_texture_env_dot3 = true; ctx->Extensions.EXT_texture_filter_anisotropic = true; ctx->Extensions.EXT_texture_mirror_clamp = true; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 16962d63c09..f0e1858e420 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -201,7 +201,7 @@ static const struct extension extension_table[] = { { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 }, { "GL_EXT_map_buffer_range", o(ARB_map_buffer_range), ES1 | ES2, 2012 }, { "GL_EXT_multi_draw_arrays", o(dummy_true), GLL | ES1 | ES2, 1999 }, - { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 }, + { "GL_EXT_packed_depth_stencil", o(dummy_true), GL, 2005 }, { "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 }, { "GL_EXT_packed_pixels", o(dummy_true), GLL, 1997 }, { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 }, @@ -274,7 +274,7 @@ static const struct extension extension_table[] = { { "GL_OES_framebuffer_object", o(dummy_true), ES1, 2005 }, { "GL_OES_get_program_binary", o(dummy_true), ES2, 2008 }, { "GL_OES_mapbuffer", o(dummy_true), ES1 | ES2, 2005 }, - { "GL_OES_packed_depth_stencil", o(EXT_packed_depth_stencil), ES1 | ES2, 2007 }, + { "GL_OES_packed_depth_stencil", o(dummy_true), ES1 | ES2, 2007 }, { "GL_OES_point_size_array", o(dummy_true), ES1, 2004 }, { "GL_OES_point_sprite", o(ARB_point_sprite), ES1, 2004 }, { "GL_OES_query_matrix", o(dummy_true), ES1, 2003 }, @@ -334,7 +334,7 @@ static const struct extension extension_table[] = { { "GL_NV_fog_distance", o(NV_fog_distance), GLL, 2001 }, { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GLL, 2005 }, { "GL_NV_light_max_exponent", o(dummy_true), GLL, 1999 }, - { "GL_NV_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2000 }, + { "GL_NV_packed_depth_stencil", o(dummy_true), GL, 2000 }, { "GL_NV_point_sprite", o(NV_point_sprite), GL, 2001 }, { "GL_NV_primitive_restart", o(NV_primitive_restart), GLL, 2002 }, { "GL_NV_read_buffer", o(dummy_true), ES2, 2011 }, @@ -437,7 +437,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; - ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; ctx->Extensions.EXT_point_parameters = GL_TRUE; ctx->Extensions.EXT_provoking_vertex = GL_TRUE; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 861885dd3f7..1a633556f59 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -781,8 +781,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } - else if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && + else if (ctx->Extensions.ARB_depth_texture && baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } @@ -794,8 +793,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } else { ASSERT(format == GL_STENCIL); - if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && + if (ctx->Extensions.ARB_depth_texture && baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } @@ -830,8 +828,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } - else if (ctx->Extensions.EXT_packed_depth_stencil && - baseFormat == GL_DEPTH_STENCIL_EXT) { + else if (baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -845,8 +842,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (baseFormat == GL_STENCIL_INDEX) { /* OK */ } - else if (ctx->Extensions.EXT_packed_depth_stencil && - baseFormat == GL_DEPTH_STENCIL_EXT) { + else if (baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -1458,12 +1454,9 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_DEPTH_COMPONENT24: return GL_DEPTH_COMPONENT; case GL_DEPTH_STENCIL_EXT: - return _mesa_is_desktop_gl(ctx) - && ctx->Extensions.EXT_packed_depth_stencil - ? GL_DEPTH_STENCIL_EXT : 0; + return _mesa_is_desktop_gl(ctx) ? GL_DEPTH_STENCIL_EXT : 0; case GL_DEPTH24_STENCIL8_EXT: - return ctx->Extensions.EXT_packed_depth_stencil - ? GL_DEPTH_STENCIL_EXT : 0; + return GL_DEPTH_STENCIL_EXT; case GL_DEPTH_COMPONENT32F: return ctx->Version >= 30 || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 1ab8b239a87..8eed89bec3e 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -1301,9 +1301,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; case GL_UNSIGNED_INT_24_8: - if (!ctx->Extensions.EXT_packed_depth_stencil) { - return GL_INVALID_ENUM; - } if (format != GL_DEPTH_STENCIL) { return GL_INVALID_OPERATION; } @@ -1485,8 +1482,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; case GL_DEPTH_STENCIL_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil && - type == GL_UNSIGNED_INT_24_8) + if (type == GL_UNSIGNED_INT_24_8) return GL_NO_ERROR; else if (ctx->Extensions.ARB_depth_buffer_float && type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 534c3bc50f7..f93bb56410d 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3408,7 +3408,6 @@ struct gl_extensions GLboolean EXT_framebuffer_sRGB; GLboolean EXT_gpu_program_parameters; GLboolean EXT_gpu_shader4; - GLboolean EXT_packed_depth_stencil; GLboolean EXT_packed_float; GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 211fc798701..4e981aa8c90 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -301,7 +301,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } - if (ctx->Extensions.EXT_packed_depth_stencil) { switch (internalFormat) { case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: @@ -309,7 +308,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) default: ; /* fallthrough */ } - } if (ctx->Extensions.EXT_texture_sRGB) { switch (internalFormat) { diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 60499aa94ec..c02408c624b 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1163,9 +1163,6 @@ get_tex_level_parameter_image(struct gl_context *ctx, *params = _mesa_get_format_bits(texFormat, pname); break; case GL_TEXTURE_STENCIL_SIZE_EXT: - if (!ctx->Extensions.EXT_packed_depth_stencil && - !ctx->Extensions.ARB_framebuffer_object) - goto invalid_pname; *params = _mesa_get_format_bits(texFormat, pname); break; case GL_TEXTURE_SHARED_SIZE: diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index c2f3b94b532..5e4a3b39864 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -443,11 +443,6 @@ void st_init_extensions(struct st_context *st) { { o(ARB_depth_buffer_float) }, { PIPE_FORMAT_Z32_FLOAT, PIPE_FORMAT_Z32_FLOAT_S8X24_UINT } }, - - { { o(EXT_packed_depth_stencil) }, - { PIPE_FORMAT_S8_UINT_Z24_UNORM, - PIPE_FORMAT_Z24_UNORM_S8_UINT }, - GL_TRUE }, /* at least one format must be supported */ }; /* Required: sampler support */ @@ -764,8 +759,7 @@ void st_init_extensions(struct st_context *st) PIPE_BUFFER, PIPE_BIND_SAMPLER_VIEW); } - if (screen->get_param(screen, PIPE_CAP_MIXED_FRAMEBUFFER_SIZES) && - ctx->Extensions.EXT_packed_depth_stencil) { + if (screen->get_param(screen, PIPE_CAP_MIXED_FRAMEBUFFER_SIZES)) { ctx->Extensions.ARB_framebuffer_object = GL_TRUE; } -- 2.30.2