Skip to content
Snippets Groups Projects
Commit c120dbfe authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

mesa/main: fix incorrect depth-error


If glGetTexImage or glGetnTexImage is called with a level that doesn't
exist, we get an error message on this form:

Mesa: User error: GL_INVALID_VALUE in glGetTexImage(depth = 0)

This is clearly nonsensical, because these APIs don't even have a
depth-parameter. The reason is that get_texture_image_dims() return
all-zero dimensions for non-existent texture-images, and we go on to
validate these dimensions as if they were user-input, because
glGetTextureSubImage requires checking.

So let's split this logic in two, so glGetTextureSubImage can have
stricter input-validation. All arguments that are no longer validated
are generated internally by mesa, so there's no use in validating them.

Fixes: 42891dba "gettextsubimage: verify zoffset and depth are correct"
Signed-off-by: default avatarErik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: default avatarJuan A. Suarez <jasuarez@igalia.com>
parent 38af69ad
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment