<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 4:57 PM, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats<br>
<br>
Cc: <<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a>><br>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>><br>
---<br>
src/mesa/main/texstorage.c | 18 ++++++++++++++++++<br>
1 file changed, 18 insertions(+)<br>
<br>
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c<br>
index 44b5374..897d589 100644<br>
--- a/src/mesa/main/texstorage.c<br>
+++ b/src/mesa/main/texstorage.c<br>
@@ -41,6 +41,7 @@<br>
#include "texstorage.h"<br>
#include "textureview.h"<br>
#include "mtypes.h"<br>
+#include "glformats.h"<br>
<br>
<br>
<br>
@@ -301,6 +302,23 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,<br>
return GL_TRUE;<br>
}<br>
<br>
+ /* From section 3.8.6, page 146 of OpenGL ES 3.0 spec:<br>
+ *<br>
+ * "The ETC2/EAC texture compression algorithm supports only<br>
+ * two-dimensional images. If internalformat is an ETC2/EAC format,<br>
+ * CompressedTexImage3D will generate an INVALID_OPERATION error if<br>
+ * target is not TEXTURE_2D_ARRAY."<br>
+ *<br>
+ * This should also be applicable for glTexStorage3D().<br>
+ */<br>
+ if (_mesa_is_compressed_format(ctx, internalformat)<br>
+ && !_mesa_target_can_be_compressed(ctx, target, internalformat)) {<br>
+ _mesa_error(ctx, _mesa_is_desktop_gl(ctx)?<br>
+ GL_INVALID_ENUM : GL_INVALID_OPERATION,<br>
+ "glTexStorage3D(internalformat = %s)",<br>
+ _mesa_lookup_enum_by_nr(internalformat));<br>
+ }<br></blockquote><div><br></div><div>It seems to me as if the mesa_target_can_be_compressed function completely disallows 3D texture formats, but the spec implies that they are allowed in some cases. What's going on here?<br>
<br></div><div>--Jason Ekstrand<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
/* levels check */<br>
if (levels < 1) {<br>
_mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)",<br>
<span><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>