<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 26, 2015 at 4:30 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<span class=""><br>
On 10/21/2015 03:06 PM, Nanley Chery wrote:<br>
> From: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
><br>
> In OpenGL ES, the COMPRESSED_TEXTURE_FORMATS query returns the set of<br>
> supported specific compressed formats. Since ASTC formats fit within<br>
> that category, include them in the set and update the<br>
> NUM_COMPRESSED_TEXTURE_FORMATS query as well.<br>
><br>
> This enables GLES2-based ASTC dEQP tests to run. See the Bugzilla for<br>
> more info.<br>
><br>
> Cc: "11.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
<br>
</span>I think we were mistaken about this... ASTC isn't actually in 11.0, is it?<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>You're right. It is not in 11.0.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=92193" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=92193</a><br>
> Reported-by: Tapani Pälli <<a href="mailto:tapani.palli@intel.com">tapani.palli@intel.com</a>><br>
> Suggested-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
> Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
> ---<br>
>  src/mesa/main/texcompress.c | 85 +++++++++++++++++++++++++++++++++------------<br>
>  1 file changed, 63 insertions(+), 22 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c<br>
> index 84973d3..9d22586 100644<br>
> --- a/src/mesa/main/texcompress.c<br>
> +++ b/src/mesa/main/texcompress.c<br>
> @@ -243,28 +243,6 @@ _mesa_gl_compressed_format_base_format(GLenum format)<br>
>   *        what GL_NUM_COMPRESSED_TEXTURE_FORMATS and<br>
>   *        GL_COMPRESSED_TEXTURE_FORMATS return."<br>
>   *<br>
> - * The KHR_texture_compression_astc_hdr spec says:<br>
> - *<br>
> - *    "Interactions with OpenGL 4.2<br>
> - *<br>
> - *        OpenGL 4.2 supports the feature that compressed textures can be<br>
> - *        compressed online, by passing the compressed texture format enum as<br>
> - *        the internal format when uploading a texture using TexImage1D,<br>
> - *        TexImage2D or TexImage3D (see Section 3.9.3, Texture Image<br>
> - *        Specification, subsection Encoding of Special Internal Formats).<br>
> - *<br>
> - *        Due to the complexity of the ASTC compression algorithm, it is not<br>
> - *        usually suitable for online use, and therefore ASTC support will be<br>
> - *        limited to pre-compressed textures only. Where on-device compression<br>
> - *        is required, a domain-specific limited compressor will typically<br>
> - *        be used, and this is therefore not suitable for implementation in<br>
> - *        the driver.<br>
> - *<br>
> - *        In particular, the ASTC format specifiers will not be added to<br>
> - *        Table 3.14, and thus will not be accepted by the TexImage*D<br>
> - *        functions, and will not be returned by the (already deprecated)<br>
> - *        COMPRESSED_TEXTURE_FORMATS query."<br>
> - *<br>
>   * There is no formal spec for GL_ATI_texture_compression_3dc.  Since the<br>
>   * formats added by this extension are luminance-alpha formats, it is<br>
>   * reasonable to expect them to follow the same rules as<br>
> @@ -396,6 +374,69 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)<br>
>           n += 10;<br>
>        }<br>
>     }<br>
> +<br>
> +   /* The KHR_texture_compression_astc_hdr spec says:<br>
> +    *<br>
> +    *    "Interactions with OpenGL 4.2<br>
> +    *<br>
> +    *        OpenGL 4.2 supports the feature that compressed textures can be<br>
> +    *        compressed online, by passing the compressed texture format enum as<br>
> +    *        the internal format when uploading a texture using TexImage1D,<br>
> +    *        TexImage2D or TexImage3D (see Section 3.9.3, Texture Image<br>
> +    *        Specification, subsection Encoding of Special Internal Formats).<br>
> +    *<br>
> +    *        Due to the complexity of the ASTC compression algorithm, it is not<br>
> +    *        usually suitable for online use, and therefore ASTC support will be<br>
> +    *        limited to pre-compressed textures only. Where on-device compression<br>
> +    *        is required, a domain-specific limited compressor will typically<br>
> +    *        be used, and this is therefore not suitable for implementation in<br>
> +    *        the driver.<br>
> +    *<br>
> +    *        In particular, the ASTC format specifiers will not be added to<br>
> +    *        Table 3.14, and thus will not be accepted by the TexImage*D<br>
> +    *        functions, and will not be returned by the (already deprecated)<br>
> +    *        COMPRESSED_TEXTURE_FORMATS query."<br>
> +    *<br>
> +    * The ES and the desktop specs diverge here. In OpenGL ES, the COMPRESSED_TEXTURE_FORMATS<br>
> +    * query returns the set of supported specific compressed formats.<br>
> +    */<br>
> +   if (ctx->API == API_OPENGLES2 &&<br>
> +       ctx->Extensions.KHR_texture_compression_astc_ldr) {<br>
> +      if (formats) {<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_4x4_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x4_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x6_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_8x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_8x6_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_8x8_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_10x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_10x6_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_10x8_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_10x10_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_12x10_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_RGBA_ASTC_12x12_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;<br>
> +         formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;<br>
> +      }<br>
> +      else {<br>
> +         n += 28;<br>
> +      }<br>
> +   }<br>
> +<br>
>     return n;<br>
>  }<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>