<p dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></p>
<div class="gmail_quote">On Jul 2, 2016 2:48 AM, "Nicolai Hähnle" <<a href="mailto:nhaehnle@gmail.com">nhaehnle@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reviewed-by: Nicolai Hähnle <<a href="mailto:nicolai.haehnle@amd.com" target="_blank">nicolai.haehnle@amd.com</a>><br>
<br>
On 01.07.2016 19:03, Alejandro Piñeiro wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For the case (both src or dst) where we had a texobject, but the<br>
texobject target was not the same that the method target, this spec<br>
paragraph was appplied:<br>
<br>
/* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core<br>
* Profile spec says:<br>
*<br>
* "An INVALID_VALUE error is generated if either name does not<br>
* correspond to a valid renderbuffer or texture object according<br>
* to the corresponding target parameter."<br>
*/<br>
<br>
But for that case, the correct spec paragraph should be:<br>
/* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core<br>
* Profile spec says:<br>
*<br>
* "An INVALID_ENUM error is generated if either target is<br>
* not RENDERBUFFER or a valid non-proxy texture target;<br>
* is TEXTURE_BUFFER or one of the cubemap face selectors<br>
* described in table 8.18; or if the target does not<br>
* match the type of the object."<br>
*/<br>
<br>
specifically the last sentence: "or if the target does not match the<br>
type of the object".<br>
<br>
This patch fixes the error returned (s/INVALID/ENUM) for that case,<br>
and moves up the INVALID_VALUE spec paragraph, as that case (invalid<br>
texture object) was handled before.<br>
<br>
Fixes:<br>
GL44-CTS.copy_image.target_miss_match<br>
---<br>
<br>
Note to Mark Janes: this patch causes the piglit test<br>
arb_copy_image-api_errors to start failing. I will send a patch to<br>
piglit in short.<br>
<br>
src/mesa/main/copyimage.c | 15 ++++++++++-----<br>
1 file changed, 10 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c<br>
index 67a795f..4d18bed 100644<br>
--- a/src/mesa/main/copyimage.c<br>
+++ b/src/mesa/main/copyimage.c<br>
@@ -139,6 +139,12 @@ prepare_target(struct gl_context *ctx, GLuint name, GLenum target,<br>
struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, name);<br>
<br>
if (!texObj) {<br>
+ /*<br>
+ * From GL_ARB_copy_image specification:<br>
+ * "INVALID_VALUE is generated if either <srcName> or <dstName> does<br>
+ * not correspond to a valid renderbuffer or texture object according<br>
+ * to the corresponding target parameter."<br>
+ */<br>
_mesa_error(ctx, GL_INVALID_VALUE,<br>
"glCopyImageSubData(%sName = %u)", dbg_prefix, name);<br>
return false;<br>
@@ -155,12 +161,11 @@ prepare_target(struct gl_context *ctx, GLuint name, GLenum target,<br>
/* Note that target will not be a cube face name */<br>
if (texObj->Target != target) {<br>
/*<br>
- * From GL_ARB_copy_image specification:<br>
- * "INVALID_VALUE is generated if either <srcName> or <dstName> does<br>
- * not correspond to a valid renderbuffer or texture object according<br>
- * to the corresponding target parameter."<br>
+ * From GL_ARB_copy_image_specification:<br>
+ * "INVALID_ENUM is generated if the target does not match the type<br>
+ * of the object."<br>
*/<br>
- _mesa_error(ctx, GL_INVALID_VALUE,<br>
+ _mesa_error(ctx, GL_INVALID_ENUM,<br>
"glCopyImageSubData(%sTarget = %s)", dbg_prefix,<br>
_mesa_enum_to_string(target));<br>
return false;<br>
<br>
</blockquote>
_______________________________________________<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="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>