mesa: Fix GetTextureImage error reporting, again

Iago Toral Quiroga fixed this in commit 94f740e3,
but it recently regressed in 0d8826f7.
Quoting Iago's original commit message for the fix:

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.6 core profile spec, section 8.11 Texture Queries:

   "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)."

Note that this differs from the original ARB_direct_state_access spec.

However, the EXT_direct_state_access version does take a target
parameter, so it should continue reporting INVALID_ENUM.

Fixes KHR-GL45.direct_state_access.textures_image_query_errors.

Fixes: 0d8826f7 ("mesa: refactor get_texture_image to remove duplicate code")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 jobs for !1439 with textarget-fix in 2 minutes and 27 seconds (queued for 36 seconds)
detached
Status Job ID Name Coverage
  Containers Build
passed #448052
debian

00:00:26

 
  Build+Test
failed #448061
meson-arm64

00:00:07

failed #448060
meson-armhf

00:00:07

failed #448054
meson-clang

00:00:06

failed #448058
meson-clover

00:00:15

failed #448062
meson-i386

00:00:07

failed #448057
meson-main

00:00:07

failed #448053
meson-swr-glvnd

00:00:06

failed #448059
meson-vulkan

00:00:07

failed #448064
scons-llvm

00:00:08

failed #448063
scons-nollvm

00:01:32

failed #448055
scons-swr

00:00:13

failed #448056
scons-win64

00:00:07

 
Name Stage Failure
failed
scons-llvm Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
meson-arm64 Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
meson-i386 Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
_build/meson-logs/*.txt: found 3 matching files
WARNING: _build/*/config.log: no matching files
shader-db: found 2 matching files

Uploading artifacts to coordinator... ok
id=448062 responseStatus=201 Created token=sYVZ1fdT
ERROR: Job failed: exit code 1
failed
meson-clover Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
From https://gitlab.freedesktop.org/kwg/mesa
- [deleted] (none) -> origin/textarget-fix
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
failed
meson-armhf Build+Test
 - [deleted]                 (none)     -> origin/textarget-fix
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
meson-vulkan Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
_build/meson-logs/*.txt: found 3 matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
Uploading artifacts to coordinator... ok
id=448059 responseStatus=201 Created token=ka2Sfq_4
ERROR: Job failed: exit code 1
failed
scons-swr Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
meson-main Build+Test
Reinitialized existing Git repository in /builds/kwg/mesa/.git/
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
_build/meson-logs/*.txt: found 3 matching files
WARNING: _build/*/config.log: no matching files
shader-db: found 2 matching files

Uploading artifacts to coordinator... ok
id=448057 responseStatus=201 Created token=bXbh9dxQ
ERROR: Job failed: exit code 1
failed
scons-win64 Build+Test
 - [deleted]                 (none)     -> origin/textarget-fix
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
meson-clang Build+Test
 - [deleted]                 (none)     -> origin/textarget-fix
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
_build/meson-logs/*.txt: found 3 matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
Uploading artifacts to coordinator... ok
id=448054 responseStatus=201 Created token=K1u6ERcz
ERROR: Job failed: exit code 1
failed
meson-swr-glvnd Build+Test
 - [deleted]                 (none)     -> origin/textarget-fix
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
_build/meson-logs/*.txt: found 3 matching files
WARNING: _build/*/config.log: no matching files
shader-db: found 2 matching files

Uploading artifacts to coordinator... ok
id=448053 responseStatus=201 Created token=aMpBgMo3
ERROR: Job failed: exit code 1
failed
scons-nollvm Build+Test
 * [new tag]         vtx-0-2-24112003           -> vtx-0-2-24112003
Checking out cd02f60c as textarget-fix...
fatal: reference is not a tree: cd02f60c1e9d0ef37e4defb8e6b00433990fd90c
Uploading artifacts...
WARNING: _build/meson-logs/*.txt: no matching files
WARNING: _build/*/config.log: no matching files
WARNING: shader-db: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1