From: Ian Romanick Date: Wed, 15 Dec 2021 01:32:30 +0000 (-0800) Subject: mesa: OpenGL 1.4 feature GL_ARB_depth_texture is not optional X-Git-Tag: upstream/22.3.5~13641 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f80d45c515c579bfa7c5db97e6466a9f443c2e88;p=platform%2Fupstream%2Fmesa.git mesa: OpenGL 1.4 feature GL_ARB_depth_texture is not optional Cheatsheet: _mesa_has_ARB_depth_texture() becomes (true && ctx->Extensions.Version >= _mesa_extension_table[...].version[ctx->API]). The last value is 0 when ctx->API is API_OPENGL_COMPAT and ~0 otherwise. The whole function effectively becomes (ctx->API == API_OPENGL_COMPAT). _mesa_has_OES_depth_texture() becomes (true && ctx->Extensions.Version >= _mesa_extension_table[...].version[ctx->API]). The last value is 0 when ctx->API is API_OPENGLES2 and ~0 otherwise. The whole function effectively becomes (ctx->API == API_OPENGLES2). Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/mesa/main/consts_exts.h b/src/mesa/main/consts_exts.h index 86e97b4..2b73c5c 100644 --- a/src/mesa/main/consts_exts.h +++ b/src/mesa/main/consts_exts.h @@ -68,7 +68,6 @@ struct gl_extensions GLboolean EXT_color_buffer_half_float; GLboolean ARB_depth_buffer_float; GLboolean ARB_depth_clamp; - GLboolean ARB_depth_texture; GLboolean ARB_derivative_control; GLboolean ARB_draw_buffers_blend; GLboolean ARB_draw_elements_base_vertex; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 75e2d52..ba3a53e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -266,7 +266,6 @@ _mesa_init_extensions(struct gl_extensions *extensions) extensions->MESA_window_pos = GL_TRUE; extensions->ARB_ES2_compatibility = GL_TRUE; - extensions->ARB_depth_texture = GL_TRUE; extensions->ARB_draw_elements_base_vertex = GL_TRUE; extensions->ARB_explicit_attrib_location = GL_TRUE; extensions->ARB_explicit_uniform_location = GL_TRUE; diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index d705031..46d8165 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -60,7 +60,7 @@ EXT(ARB_cull_distance , ARB_cull_distance EXT(ARB_debug_output , dummy_true , GLL, GLC, x , x , 2009) EXT(ARB_depth_buffer_float , ARB_depth_buffer_float , GLL, GLC, x , x , 2008) EXT(ARB_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2003) -EXT(ARB_depth_texture , ARB_depth_texture , GLL, x , x , x , 2001) +EXT(ARB_depth_texture , dummy_true , GLL, x , x , x , 2001) EXT(ARB_derivative_control , ARB_derivative_control , GLL, GLC, x , x , 2014) EXT(ARB_direct_state_access , dummy_true , 31, GLC, x , x , 2014) EXT(ARB_draw_buffers , dummy_true , GLL, GLC, x , x , 2002) @@ -431,7 +431,7 @@ EXT(OES_compressed_ETC1_RGB8_texture , OES_compressed_ETC1_RGB8_texture EXT(OES_compressed_paletted_texture , dummy_true , x , x , ES1, x , 2003) EXT(OES_copy_image , OES_copy_image , x , x , x , 30, 2014) EXT(OES_depth24 , dummy_true , x , x , ES1, ES2, 2005) -EXT(OES_depth_texture , ARB_depth_texture , x , x , x , ES2, 2006) +EXT(OES_depth_texture , dummy_true , x , x , x , ES2, 2006) EXT(OES_depth_texture_cube_map , OES_depth_texture_cube_map , x , x , x , ES2, 2012) EXT(OES_draw_buffers_indexed , ARB_draw_buffers_blend , x , x , x , 30, 2014) EXT(OES_draw_elements_base_vertex , ARB_draw_elements_base_vertex , x , x , x , ES2, 2014) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 5b5283c..c09c0ca 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -999,14 +999,8 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } } else if (format == GL_DEPTH) { - if (baseFormat == GL_DEPTH_COMPONENT) { - /* OK */ - } - else if (ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL) { - /* OK */ - } - else { + if (baseFormat != GL_DEPTH_COMPONENT && + baseFormat != GL_DEPTH_STENCIL) { att->Complete = GL_FALSE; att_incomplete("bad depth format"); return; @@ -1014,8 +1008,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } else { assert(format == GL_STENCIL); - if (ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL) { + if (baseFormat == GL_DEPTH_STENCIL) { /* OK */ } else if (ctx->Extensions.ARB_texture_stencil8 && baseFormat == GL_STENCIL_INDEX) { diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 3f5e0c3..2c2e434 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -1017,8 +1017,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, switch (pname) { case GL_INTERNALFORMAT_DEPTH_SIZE: - if (ctx->API != API_OPENGL_CORE && - !_mesa_has_ARB_depth_texture(ctx) && + if (!_mesa_is_desktop_gl(ctx) && target != GL_RENDERBUFFER && target != GL_TEXTURE_BUFFER) goto end; diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 3e9b5c5..9ef771d 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -2345,8 +2345,7 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat) } } - if (_mesa_has_ARB_depth_texture(ctx) || _mesa_has_OES_depth_texture(ctx) || - ctx->API == API_OPENGL_CORE) { + if (ctx->API != API_OPENGLES) { switch (internalFormat) { case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 884dd51..c2936cb 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -518,7 +518,7 @@ set_tex_parameteri(struct gl_context *ctx, /* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has never * existed in OpenGL ES. */ - if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_texture) { + if (ctx->API == API_OPENGL_COMPAT) { if (texObj->Attrib.DepthMode == params[0]) return GL_FALSE; if (params[0] == GL_LUMINANCE || @@ -1812,8 +1812,6 @@ get_tex_level_parameter_image(struct gl_context *ctx, } break; case GL_TEXTURE_DEPTH_SIZE_ARB: - if (!ctx->Extensions.ARB_depth_texture) - goto invalid_pname; *params = _mesa_get_format_bits(texFormat, pname); break; case GL_TEXTURE_STENCIL_SIZE: @@ -2380,7 +2378,7 @@ get_tex_parameterfv(struct gl_context *ctx, /* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has * never existed in OpenGL ES. */ - if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_depth_texture) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLfloat) obj->Attrib.DepthMode; break; @@ -2667,7 +2665,7 @@ get_tex_parameteriv(struct gl_context *ctx, *params = (GLint) obj->Sampler.Attrib.CompareFunc; break; case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_depth_texture) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLint) obj->Attrib.DepthMode; break; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 0f488b3..52ce56f 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -251,8 +251,7 @@ compute_version(const struct gl_extensions *extensions, { GLuint major, minor, version; - const bool ver_1_4 = (extensions->ARB_depth_texture && - extensions->ARB_shadow && + const bool ver_1_4 = (extensions->ARB_shadow && extensions->ARB_texture_env_crossbar && extensions->EXT_blend_color && extensions->EXT_blend_func_separate &&