From 269477ec7e0d63ef49bb145b0e237fe46c1ffb91 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Thu, 17 Dec 2020 16:32:38 +0100 Subject: [PATCH] Add Image2d_array to supported Gl sharing formats query (#1041) * Add Image2d_array to supported Gl sharing formats query Signed-off-by: Mateusz Hoppe * Update opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp Co-authored-by: Mateusz Jablonski Co-authored-by: Mateusz Jablonski --- opencl/source/sharings/gl/gl_sharing.cpp | 2 +- .../test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opencl/source/sharings/gl/gl_sharing.cpp b/opencl/source/sharings/gl/gl_sharing.cpp index db318109d6..c994e95974 100644 --- a/opencl/source/sharings/gl/gl_sharing.cpp +++ b/opencl/source/sharings/gl/gl_sharing.cpp @@ -76,7 +76,7 @@ cl_int GLSharingFunctions::getSupportedFormats(cl_mem_flags flags, if (imageType != CL_MEM_OBJECT_IMAGE1D && imageType != CL_MEM_OBJECT_IMAGE2D && imageType != CL_MEM_OBJECT_IMAGE3D && imageType != CL_MEM_OBJECT_IMAGE1D_ARRAY && - imageType != CL_MEM_OBJECT_IMAGE1D_BUFFER) { + imageType != CL_MEM_OBJECT_IMAGE1D_BUFFER && imageType != CL_MEM_OBJECT_IMAGE2D_ARRAY) { return CL_INVALID_VALUE; } diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp index da87c07180..d0540922fc 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp @@ -804,7 +804,7 @@ TEST(glSharingBasicTest, givenCorrectFlagsWhenGettingSupportedFormatsThenCorrect TEST(glSharingBasicTest, givenSupportedImageTypesWhenGettingSupportedFormatsThenCorrectListIsReturned) { MockGLSharingFunctions glSharingFunctions; cl_mem_flags flags = CL_MEM_READ_WRITE; - cl_mem_object_type image_types[] = {CL_MEM_OBJECT_IMAGE1D, CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE3D, CL_MEM_OBJECT_IMAGE1D_ARRAY, CL_MEM_OBJECT_IMAGE1D_BUFFER}; + cl_mem_object_type image_types[] = {CL_MEM_OBJECT_IMAGE1D, CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE3D, CL_MEM_OBJECT_IMAGE1D_ARRAY, CL_MEM_OBJECT_IMAGE1D_BUFFER, CL_MEM_OBJECT_IMAGE2D_ARRAY}; cl_GLenum glFormats[3] = {}; cl_uint numImageFormats = 0; @@ -846,7 +846,7 @@ TEST(glSharingBasicTest, givenNullNumImageFormatsWhenGettingSupportedFormatsThen TEST(glSharingBasicTest, givenInvalidImageTypeWhenGettingSupportedFormatsThenIvalidValueErrorIsReturned) { MockGLSharingFunctions glSharingFunctions; cl_mem_flags flags = CL_MEM_READ_WRITE; - cl_mem_object_type image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY; + cl_mem_object_type image_type = CL_MEM_OBJECT_PIPE; cl_GLenum glFormats[3] = {}; cl_uint numImageFormats = 0; @@ -1371,4 +1371,4 @@ TEST(GlSharingAdapterLuid, whenInitializingGlSharingThenProperAdapterLuidIsObtai EXPECT_EQ(0u, luid.LowPart); } dllParam.resetParam("glGetLuidFuncAvailable"); -} \ No newline at end of file +}