mesa/src
Juan A. Suarez Romero b37b35a5d2 getteximage: assume texture image is empty for non defined levels
Current code is returning an INVALID_OPERATION when trying to use
getTextureImage() on a level that has not been explicitly defined.

That is, we define a mipmapped Texture2D with 3 levels, and try to use
GetTextureImage() for the 4th levels, and INVALID_OPERATION is returned.

Nevertheless, such case is not listed as an error in OpenGL 4.6 spec,
section 8.11.4 ("Texture Image Queries"), where all the case errors for
this function are defined. So it seems this is a valid operation.

On the other hand, in section 8.22 ("Texture State and Proxy State") it
states:

  "Each initial texture image is null. It has zero width, height, and
   depth, internal format RGBA, or R8 for buffer textures, component
   sizes set to zero and component types set to NONE, the compressed
   flag set to FALSE, a zero compressed size, and the bound buffer
   object name is zero."

We can assume that we are reading this initialized empty image when
calling GetTextureImage() with a non defined level.

With this assumption, we will reach one of the other error cases defined
for the functions. In the end this means that we would end up returning
INVALID_VALUE to the caller.

This fixes arb_get_texture_sub_image piglit tests.

v2: just return INVALID_VALUE if there is no defined level (Iago)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2018-04-13 17:47:37 +02:00
..
amd mesa: include mtypes.h less 2018-04-12 19:31:30 -04:00
broadcom util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero 2018-03-29 14:09:23 -07:00
compiler Fix make check 2018-04-12 20:03:13 -04:00
egl x11: Only report supported DRI3/Present versions 2018-03-30 16:53:51 +01:00
gallium Fix scons build 2018-04-12 19:55:01 -04:00
gbm gbm: remove never-implemented function 2018-03-28 16:25:52 +01:00
getopt
glx meson: fix warnings about comparing unlike types 2018-04-06 15:29:53 -07:00
gtest autotools: include meson build files in tarball 2018-01-19 16:30:51 -08:00
hgl meson: Add Haiku platform support v4 2018-02-16 16:56:34 -06:00
intel mesa: include mtypes.h less 2018-04-12 19:31:30 -04:00
loader dri3: Don't fail on version mismatch 2018-03-20 08:52:59 +00:00
mapi glapi: define GL_API to be KEYWORD1 in glapi_dispatch.c (v2) 2018-03-30 14:33:33 -06:00
mesa getteximage: assume texture image is empty for non defined levels 2018-04-13 17:47:37 +02:00
util mesa: include mtypes.h less 2018-04-12 19:31:30 -04:00
vulkan vulkan: Drop vk_android_native_buffer.xml 2018-04-10 19:29:49 -07:00
git_sha1.h.in meson: Build i965 and dri stack 2017-10-09 13:42:44 -07:00
Makefile.am vulkan: Drop vk_android_native_buffer.xml 2018-04-10 19:29:49 -07:00
meson.build meson: fix building without GL 2018-02-26 09:32:14 -08:00
SConscript buildsys: move file regeneration logic to the script itself 2017-10-27 13:38:37 +01:00