From e7c5694cf55bc9eba65a95f9c8a0a90434cd7abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Petit?= Date: Fri, 14 May 2021 09:44:38 +0100 Subject: [PATCH] Fix image pixel reference calculation for CL_{INTENSITY,LUMINANCE} formats (#1247) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per 6.15.15.7, the first three components have to be set to the luminance value and all components to the intensity value. Signed-off-by: Kévin Petit --- test_common/harness/imageHelpers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_common/harness/imageHelpers.h b/test_common/harness/imageHelpers.h index aba70508..848ec655 100644 --- a/test_common/harness/imageHelpers.h +++ b/test_common/harness/imageHelpers.h @@ -489,12 +489,14 @@ void read_image_pixel(void *imageData, image_descriptor *imageInfo, int x, } else if (format->image_channel_order == CL_INTENSITY) { + outData[0] = tempData[0]; outData[1] = tempData[0]; outData[2] = tempData[0]; outData[3] = tempData[0]; } else if (format->image_channel_order == CL_LUMINANCE) { + outData[0] = tempData[0]; outData[1] = tempData[0]; outData[2] = tempData[0]; }