| From 02a1f95386b43bf46cd1c8297d0955242f554fa2 Mon Sep 17 00:00:00 2001 |
| From: Nataraj Deshpande <nataraj.deshpande@intel.com> |
| Date: Wed, 13 May 2020 14:32:13 -0700 |
| Subject: [PATCH] dri_util: Update internal_format to GL_RGB8 for |
| MESA_FORMAT_R8G8B8X8_UNORM |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| The commit helps to resolve GL_INVALID_OPERATION error returned |
| during CTS test when Android format RGBX8888 fallback to RGBA8888 |
| and then set color with glTexSubImage2D(format=GL_RGB). |
| |
| Fixes android.hardware.nativehardware.cts.AHardwareBufferNativeTests: |
| #SingleLayer_ColorTest_GpuSampledImageCanBeSampled_R8G8B8X8_UNORM |
| |
| Cc: <mesa-stable@lists.freedesktop.org> |
| Fixes: bf576772ab4d ("dri_util: add driImageFormatToSizedInternalGLFormat function") |
| Signed-off-by: Nataraj Deshpande <nataraj.deshpande@intel.com> |
| Reviewed-by: Marek Olšák <marek.olsak@amd.com> |
| Reviewed-by: Tapani Pälli <tapani.palli@intel.com> |
| Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5034> |
| --- |
| src/mesa/drivers/dri/common/dri_util.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c |
| index bfa3d35fd81..e90179c7f2e 100644 |
| --- a/src/mesa/drivers/dri/common/dri_util.c |
| +++ b/src/mesa/drivers/dri/common/dri_util.c |
| @@ -935,7 +935,7 @@ static const struct { |
| { |
| .image_format = __DRI_IMAGE_FORMAT_XBGR8888, |
| .mesa_format = MESA_FORMAT_R8G8B8X8_UNORM, |
| - .internal_format = GL_RGBA8, |
| + .internal_format = GL_RGB8, |
| }, |
| { |
| .image_format = __DRI_IMAGE_FORMAT_R8, |
| -- |
| 2.29.1.341.ge80a0c044ae-goog |
| |