OSDN Git Service

mesa/main: fix error checking logic on CopyImageSubData
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 30 Jun 2016 12:41:01 +0000 (14:41 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 2 Jul 2016 09:54:40 +0000 (11:54 +0200)
commitda7efadf040dafe5d925962c88a7189dcf058b25
tree4818c5900a13e0d312016272ead5904b372d61e3
parent27d456cc87a01998c6fe1dbf45937e2ca6128495
mesa/main: fix error checking logic on CopyImageSubData

For the case (both src or dst) where we had a texobject, but the
texobject target was not the same that the method target, this spec
paragraph was appplied:

 /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
  * Profile spec says:
  *
  *     "An INVALID_VALUE error is generated if either name does not
  *     correspond to a valid renderbuffer or texture object according
  *     to the corresponding target parameter."
  */

But for that case, the correct spec paragraph should be:
 /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
  * Profile spec says:
  *
  *     "An INVALID_ENUM error is generated if either target is
  *      not RENDERBUFFER or a valid non-proxy texture target;
  *      is TEXTURE_BUFFER or one of the cubemap face selectors
  *      described in table 8.18; or if the target does not
  *      match the type of the object."
  */

specifically the last sentence: "or if the target does not match the
type of the object".

This patch fixes the error returned (s/INVALID/ENUM) for that case,
and moves up the INVALID_VALUE spec paragraph, as that case (invalid
texture object) was handled before.

Fixes:
GL44-CTS.copy_image.target_miss_match

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/copyimage.c