<div dir="ltr">Adding mesa-dev in CC.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 11, 2014 at 10:39 AM, Courtney Goeltzenleuchter <span dir="ltr"><<a href="mailto:courtney@lunarg.com" target="_blank">courtney@lunarg.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">
<div><div>On Fri, Jun 6, 2014 at 5: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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style: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" 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>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com" target="_blank">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>
- 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></blockquote><div><br></div></div></div><div>Should this helper function include gles in it's name since it's only checking for valid GLES internal formats?</div>
</div></div></div></blockquote><div>Validity of internal format for gles and desktop is anyway checked separately. So, I think we can safely use _mesa_is_enum_format_unsized() as a common function for both gles and desktop.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>
+ 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>
</div></div><span><font color="#888888"><span><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
mesa-stable mailing list<br>
<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-stable" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-stable</a><br>
</font></span></font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Courtney Goeltzenleuchter<br><div>LunarG</div><div><img src="http://media.lunarg.com/wp-content/themes/LunarG/images/logo.png" width="96" height="65"><br>
</div></div>
</font></span></div></div>
</blockquote></div><br></div></div>