<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 many failures in gles3 Khronos CTS test: packed_pixels<br>
<br>
Khronos bug# 9807<br>
Cc: <<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>
<br>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
---<br>
src/mesa/main/teximage.c | 45 ++++++++++++++++++++++++++++-----------------<br>
1 file changed, 28 insertions(+), 17 deletions(-)<br>
<br>
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
index c926a2f..11b8439 100644<br>
--- a/src/mesa/main/teximage.c<br>
+++ b/src/mesa/main/teximage.c<br>
@@ -3647,24 +3647,35 @@ copyteximage(struct gl_context *ctx, GLuint dims,<br>
<br>
rb = _mesa_get_read_renderbuffer_for_format(ctx, internalFormat);<br>
<br>
- /* From Page 139 of OpenGL ES 3.0 spec:<br>
- * "If internalformat is sized, the internal format of the new texel<br>
- * array is internalformat, and this is also the new texel array’s<br>
- * effective internal format. If the component sizes of internalformat<br>
- * do not exactly match the corresponding component sizes of the source<br>
- * buffer’s effective internal format, described below, an<br>
- * INVALID_OPERATION error is generated. If internalformat is unsized,<br>
- * the internal format of the new texel array is the effective internal<br>
- * format of the source buffer, and this is also the new texel array’s<br>
- * effective internal format.<br>
+ /* Conversion from GL_RGB10_A2 source buffer format is not allowed in<br>
+ * OpenGL ES 3.0. Khronos bug# 9807.<br>
*/<br></blockquote><div><br></div><div>It may be good to move the comment about RGB10_A2 inside the first two if statements to keep it closer to the actual check.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- if (_mesa_is_gles3(ctx)<br>
- && !_mesa_is_enum_format_unsized(internalFormat)<br>
- && formats_differ_in_component_sizes (texFormat, rb->Format)) {<br>
- _mesa_error(ctx, GL_INVALID_OPERATION,<br>
- "glCopyTexImage%uD(componenet size changed in"<br>
- " internal format)", dims);<br>
- return;<br>
+ if (_mesa_is_gles3(ctx)) {<br>
+ if (_mesa_is_enum_format_unsized(internalFormat)) {<br>
+ if (rb->InternalFormat == GL_RGB10_A2) {<br>
+ _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+ "glCopyTexImage%uD(Reading from GL_RGB10_A2 buffer and"<br>
+ " writing to unsized internal format)", dims);<br>
+ return;<br>
+ }<br>
+ }<br>
+ /* From Page 139 of OpenGL ES 3.0 spec:<br>
+ * "If internalformat is sized, the internal format of the new texel<br>
+ * array is internalformat, and this is also the new texel array’s<br>
+ * effective internal format. If the component sizes of internalformat<br>
+ * do not exactly match the corresponding component sizes of the source<br>
+ * buffer’s effective internal format, described below, an<br>
+ * INVALID_OPERATION error is generated. If internalformat is unsized,<br>
+ * the internal format of the new texel array is the effective internal<br>
+ * format of the source buffer, and this is also the new texel array’s<br>
+ * effective internal format.<br>
+ */<br>
+ else if (formats_differ_in_component_sizes (texFormat, rb->Format)) {<br>
+ _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+ "glCopyTexImage%uD(componenet size changed in"<br>
+ " internal format)", dims);<br>
+ return;<br>
+ }<br>
}<br>
<br>
assert(texFormat != MESA_FORMAT_NONE);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<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>
</font></span></blockquote></div><br></div></div>