Skip to content

mesa: Fix GetTextureImage error reporting, again

Kenneth Graunke requested to merge kwg/mesa:textarget-fix into master

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.

Fixes KHR-GL45.direct_state_access.textures_image_query_errors.

Fixes: 0d8826f7 ("mesa: refactor get_texture_image to remove duplicate code")

Merge request reports