Commit 908f8179 authored by Marek Olšák's avatar Marek Olšák

mesa: expose EXT_texture_compression_bptc in GLES

tested by piglit.

v2: rebase

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (v1)
Reviewed-by: Erik Faye-Lund 's avatarErik Faye-Lund <erik.faye-lund@collabora.com>
parent 34f07dde
...@@ -40,6 +40,7 @@ TBD. ...@@ -40,6 +40,7 @@ TBD.
<ul> <ul>
<li>GL_EXT_shader_implicit_conversions on all drivers (ES extension).</li> <li>GL_EXT_shader_implicit_conversions on all drivers (ES extension).</li>
<li>GL_EXT_texture_compression_bptc on all GL 4.0 drivers (ES extension).</li>
<li>GL_EXT_texture_compression_rgtc on all GL 3.0 drivers (ES extension).</li> <li>GL_EXT_texture_compression_rgtc on all GL 3.0 drivers (ES extension).</li>
<li>GL_EXT_texture_view on drivers supporting texture views (ES extension).</li> <li>GL_EXT_texture_view on drivers supporting texture views (ES extension).</li>
<li>GL_OES_texture_view on drivers supporting texture views (ES extension).</li> <li>GL_OES_texture_view on drivers supporting texture views (ES extension).</li>
......
...@@ -276,6 +276,7 @@ EXT(EXT_texture3D , dummy_true ...@@ -276,6 +276,7 @@ EXT(EXT_texture3D , dummy_true
EXT(EXT_texture_array , EXT_texture_array , GLL, GLC, x , x , 2006) EXT(EXT_texture_array , EXT_texture_array , GLL, GLC, x , x , 2006)
EXT(EXT_texture_border_clamp , ARB_texture_border_clamp , x , x , x , ES2, 2014) EXT(EXT_texture_border_clamp , ARB_texture_border_clamp , x , x , x , ES2, 2014)
EXT(EXT_texture_buffer , OES_texture_buffer , x , x , x , 31, 2014) EXT(EXT_texture_buffer , OES_texture_buffer , x , x , x , 31, 2014)
EXT(EXT_texture_compression_bptc , ARB_texture_compression_bptc , x , x , x , 30, 2017)
EXT(EXT_texture_compression_dxt1 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2004) EXT(EXT_texture_compression_dxt1 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2004)
EXT(EXT_texture_compression_latc , EXT_texture_compression_latc , GLL, x , x , x , 2006) EXT(EXT_texture_compression_latc , EXT_texture_compression_latc , GLL, x , x , x , 2006)
EXT(EXT_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , 30, 2004) EXT(EXT_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , 30, 2004)
......
...@@ -1388,7 +1388,8 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format) ...@@ -1388,7 +1388,8 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
case MESA_FORMAT_LAYOUT_ETC2: case MESA_FORMAT_LAYOUT_ETC2:
return _mesa_is_gles3(ctx) || _mesa_has_ARB_ES3_compatibility(ctx); return _mesa_is_gles3(ctx) || _mesa_has_ARB_ES3_compatibility(ctx);
case MESA_FORMAT_LAYOUT_BPTC: case MESA_FORMAT_LAYOUT_BPTC:
return _mesa_has_ARB_texture_compression_bptc(ctx); return _mesa_has_ARB_texture_compression_bptc(ctx) ||
_mesa_has_EXT_texture_compression_bptc(ctx);
case MESA_FORMAT_LAYOUT_ASTC: case MESA_FORMAT_LAYOUT_ASTC:
return _mesa_has_KHR_texture_compression_astc_ldr(ctx); return _mesa_has_KHR_texture_compression_astc_ldr(ctx);
default: default:
...@@ -2846,6 +2847,11 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, ...@@ -2846,6 +2847,11 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
if (ctx->Version <= 20) if (ctx->Version <= 20)
return GL_INVALID_OPERATION; return GL_INVALID_OPERATION;
break; break;
case GL_COMPRESSED_RGBA_BPTC_UNORM:
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:
if (!_mesa_has_EXT_texture_compression_bptc(ctx))
return GL_INVALID_OPERATION;
break;
default: default:
return GL_INVALID_OPERATION; return GL_INVALID_OPERATION;
} }
...@@ -3050,6 +3056,11 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, ...@@ -3050,6 +3056,11 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
case GL_RGB: case GL_RGB:
if (_mesa_has_OES_texture_float(ctx) && internalFormat == format) if (_mesa_has_OES_texture_float(ctx) && internalFormat == format)
break; break;
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:
if (!_mesa_has_EXT_texture_compression_bptc(ctx))
return GL_INVALID_OPERATION;
break;
default: default:
return GL_INVALID_OPERATION; return GL_INVALID_OPERATION;
} }
......
...@@ -327,6 +327,14 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats) ...@@ -327,6 +327,14 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
formats[n++] = GL_ETC1_RGB8_OES; formats[n++] = GL_ETC1_RGB8_OES;
} }
/* Required by EXT_texture_compression_bptc in GLES. */
if (_mesa_has_EXT_texture_compression_bptc(ctx)) {
formats[n++] = GL_COMPRESSED_RGBA_BPTC_UNORM;
formats[n++] = GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM;
formats[n++] = GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT;
formats[n++] = GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT;
}
/* Required by EXT_texture_compression_rgtc in GLES. */ /* Required by EXT_texture_compression_rgtc in GLES. */
if (_mesa_is_gles3(ctx) && if (_mesa_is_gles3(ctx) &&
_mesa_has_EXT_texture_compression_rgtc(ctx)) { _mesa_has_EXT_texture_compression_rgtc(ctx)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment