st/mesa: Fix EGLImageTargetTexture2D for GL_TEXTURE_2D
authorWoody Chow <woodychow@google.com>
Wed, 19 Aug 2020 05:19:12 +0000 (14:19 +0900)
committerMarge Bot <eric+marge@anholt.net>
Tue, 25 Aug 2020 02:10:15 +0000 (02:10 +0000)
commit5e4d69ec786e56794a995be869b5a9b80d050f2d
tree4a4c28635ff03b875232b5f8677610b63cc867e6
parent855afe01449690e1ed21f9085718551e5ea09bbd
st/mesa: Fix EGLImageTargetTexture2D for GL_TEXTURE_2D

Before this change, internalFormat was defaulted to GL_RGBA (
unsized internal format). Therefore, subsequent glTexSubImage2D
call with type != GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_4_4_4_4 or
GL_UNSIGNED_SHORT_5_5_5_1 would give GL_INVALID_OPERATION.

This fixes

android.graphics.cts.BitmapColorSpaceTest#test16bitHardware
android.graphics.cts.ImageDecoderTest#testDecodeBitmap*
android.graphics.cts.BitmapTest#testNdkFormatsHardware

in CtsGraphicsTestCases

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6382>
src/mesa/state_tracker/st_cb_eglimage.c