<div dir="ltr">I'm planning to send out a v6 to fix an issue w/ a not-yet-upstreamed piglit test I've developed for ASTC.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 25, 2015 at 1:00 PM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">From: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
<br>
The ASTC spec was revised as follows:<br>
<br>
Revision 2, April 28, 2015 - added CompressedTex{Sub,}Image3D to<br>
commands accepting ASTC format tokens in the New Tokens section [...].<br>
<br>
Support only exists in the HDR submode:<br>
<br>
Add a second new column "3D Tex." which is empty for all non-ASTC<br>
formats. If only the LDR profile is supported by the implementation,<br>
this column is also empty for all ASTC formats. If both the LDR and HDR<br>
profiles are supported only, this column is checked for all ASTC<br>
formats.<br>
<br>
LDR-only systems should generate an INVALID_OPERATION error when<br>
attempting to call CompressedTexImage3D with the TEXTURE_3D target.<br>
<br>
v2. return the proper error for LDR-only systems.<br>
v3. update is_astc_format().<br>
v4. use _mesa_is_astc_format().<br>
</span>v5. place logic in _mesa_target_can_be_compressed.<br>
<span class=""><br>
Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
</span> src/mesa/main/teximage.c | 54 +++++++++++++++++++++++++++++++++++++++++-------<br>
1 file changed, 47 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
index c28cd03..5602123 100644<br>
--- a/src/mesa/main/teximage.c<br>
+++ b/src/mesa/main/teximage.c<br>
@@ -1854,19 +1854,59 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,<br>
return write_error(error, GL_INVALID_OPERATION);<br>
<br>
target_can_be_compresed = ctx->Extensions.ARB_texture_cube_map_array;<br>
- break;<br>
- case GL_TEXTURE_3D:<br>
<br>
- /* See ETC2/EAC comment in switch case GL_TEXTURE_CUBE_MAP_ARRAY. */<br>
- if (layout == MESA_FORMAT_LAYOUT_ETC2 && _mesa_is_gles3(ctx))<br>
<span class="">+ /* From the KHR_texture_compression_astc_hdr spec:<br>
+ *<br>
</span>+ * Add a second new column "3D Tex." which is empty for all non-ASTC<br>
+ * formats. If only the LDR profile is supported by the implementation,<br>
+ * this column is also empty for all ASTC formats. If both the LDR and HDR<br>
+ * profiles are supported only, this column is checked for all ASTC<br>
+ * formats.<br>
+ *<br>
+ * Add a third new column "Cube Map Array Tex." which is empty for all<br>
+ * non-ASTC formats, and checked for all ASTC formats.<br>
+ *<br>
+ * and,<br>
<span class="">+ *<br>
+ * 'An INVALID_OPERATION error is generated by CompressedTexImage3D<br>
+ * if <internalformat> is TEXTURE_CUBE_MAP_ARRAY and the<br>
+ * "Cube Map Array" column of table 8.19 is *not* checked, or if<br>
+ * <internalformat> is TEXTURE_3D and the "3D Tex." column of table<br>
+ * 8.19 is *not* checked'<br>
+ *<br>
+ * The instances of <internalformat> above should say <target>.<br>
+ */<br>
+<br>
</span>+ /* Throw an INVALID_OPERATION error if the target is<br>
+ * TEXTURE_CUBE_MAP_ARRAY and the format is not ASTC.<br>
+ */<br>
+ if (target_can_be_compresed &&<br>
+ ctx->Extensions.KHR_texture_compression_astc_ldr &&<br>
+ layout != MESA_FORMAT_LAYOUT_ASTC)<br>
return write_error(error, GL_INVALID_OPERATION);<br>
<br>
- if (layout == MESA_FORMAT_LAYOUT_BPTC) {<br>
+ break;<br>
+ case GL_TEXTURE_3D:<br>
+ switch (layout) {<br>
+ case MESA_FORMAT_LAYOUT_ETC2:<br>
+ /* See ETC2/EAC comment in case GL_TEXTURE_CUBE_MAP_ARRAY. */<br>
+ if (_mesa_is_gles3(ctx))<br>
+ return write_error(error, GL_INVALID_OPERATION);<br>
+ break;<br>
+ case MESA_FORMAT_LAYOUT_BPTC:<br>
target_can_be_compresed = ctx->Extensions.ARB_texture_compression_bptc;<br>
break;<br>
+ default:<br>
+ /* Throw an INVALID_OPERATION error if the target is TEXTURE_3D and<br>
+ * (the format is not ASTC or the hdr extension is not supported).<br>
+ * See comment in switch case GL_TEXTURE_CUBE_MAP_ARRAY for more info.<br>
+ */<br>
+ if (ctx->Extensions.KHR_texture_compression_astc_ldr &&<br>
+ (layout != MESA_FORMAT_LAYOUT_ASTC ||<br>
+ !ctx->Extensions.KHR_texture_compression_astc_hdr))<br>
+ return write_error(error, GL_INVALID_OPERATION);<br>
+ break;<br>
}<br>
-<br>
- break;<br>
default:<br>
break;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.0<br>
<br>
</font></span></blockquote></div><br></div>