[Mesa-dev] [PATCH] mesa/main: Fix GetTextureImage error reporting

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Sep 5 12:50:50 UTC 2017



On 09/05/2017 02:07 PM, Iago Toral Quiroga wrote:
> GetTex*Image should return INVALID_ENUM if target is not valid, however,
> GetTextureImage does not receive a target, and instead should return
> INVALID_OPERATION if the effective target is not valid. From the
> OpenGL 4.5 core profile spec, section 8.11 Texture Queries:

You might want to replace 4.5 by 4.6. :)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

> 
> "An INVALID_OPERATION error is generated by GetTextureImage if the effective
>   target is not one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY,
>   TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_RECTANGLE, or
>   TEXTURE_CUBE_MAP (for GetTextureImage only)."
> 
> Fixes:
> KHR-GL45.direct_state_access.textures_image_query_errors
> ---
>   src/mesa/main/texgetimage.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index 715bc249be..26cf3e5644 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -1430,7 +1430,7 @@ _mesa_GetTextureImage(GLuint texture, GLint level, GLenum format, GLenum type,
>      }
>   
>      if (!legal_getteximage_target(ctx, texObj->Target, true)) {
> -      _mesa_error(ctx, GL_INVALID_ENUM, "%s", caller);
> +      _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
>         return;
>      }
>   
> 


More information about the mesa-dev mailing list