<div dir="ltr"><div>Looks good to me.<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com" target="_blank">jason.ekstrand@intel.com</a>><br></div><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>
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>
src/mesa/main/teximage.c | 15 +++++++++++++++<br>
1 file changed, 15 insertions(+)<br>
<br>
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
index 11b8439..a09d994 100644<br>
--- a/src/mesa/main/teximage.c<br>
+++ b/src/mesa/main/teximage.c<br>
@@ -2696,6 +2696,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,<br>
if (_mesa_is_color_format(internalFormat)) {<br>
bool is_int = _mesa_is_enum_format_integer(internalFormat);<br>
bool is_rbint = _mesa_is_enum_format_integer(rb_internal_format);<br>
+ bool is_unorm = _mesa_is_enum_format_unorm(internalFormat);<br>
+ bool is_rbunorm = _mesa_is_enum_format_unorm(rb_internal_format);<br>
if (is_int || is_rbint) {<br>
if (is_int != is_rbint) {<br>
_mesa_error(ctx, GL_INVALID_OPERATION,<br>
@@ -2709,6 +2711,19 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,<br>
return GL_TRUE;<br>
}<br>
}<br>
+<br>
+ /* From page 138 of OpenGL ES 3.0 spec:<br>
+ * "The error INVALID_OPERATION is generated if floating-point RGBA<br>
+ * data is required; if signed integer RGBA data is required and the<br>
+ * format of the current color buffer is not signed integer; if<br>
+ * unsigned integer RGBA data is required and the format of the<br>
+ * current color buffer is not unsigned integer; or if fixed-point<br>
+ * RGBA data is required and the format of the current color buffer<br>
+ * is not fixed-point.<br>
+ */<br>
+ if (_mesa_is_gles(ctx) && is_unorm != is_rbunorm)<br>
+ _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+ "glCopyTexImage%dD(unorm vs non-unorm)", dimensions);<br>
}<br>
<br>
if (_mesa_is_compressed_format(ctx, internalFormat)) {<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>