<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 2:29 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"><div class="">On 07/29/2014 05:02 PM, Jason Ekstrand wrote:<br>
><br>
><br>
><br>
> On Fri, Jun 6, 2014 at 4:57 PM, Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a><br>
</div><div class="">> <mailto:<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>>> wrote:<br>
><br>
> Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats<br>
><br>
> Cc: <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
</div>> <mailto:<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>>><br>
> Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a><br>
> <mailto:<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>>><br>
<div><div class="h5">> ---<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,<br>
> 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<br>
> format,<br>
> + * CompressedTexImage3D will generate an INVALID_OPERATION<br>
> 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,<br>
> 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>
><br>
><br>
> It seems to me as if the mesa_target_can_be_compressed function<br>
> completely disallows 3D texture formats, but the spec implies that they<br>
> are allowed in some cases. What's going on here?<br>
<br>
</div></div>It is possible to have a compressed format that supports 3D, but, of the<br>
formats that Mesa supports, none do. I believe<br>
NV_texture_compression_vtc and KHR_texture_compression_astc_hdr are the<br>
only ones.<br></blockquote><div><br></div><div>In that case,<br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
> --Jason Ekstrand<br>
><br>
> +<br>
> /* levels check */<br>
> if (levels < 1) {<br>
> _mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)",<br>
> --<br>
> 1.8.3.1<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
</div>> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">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>
<div class="HOEnZb"><div class="h5">><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">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>
<br>
</div></div></blockquote></div><br></div></div>