@@ -995,7 +995,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) {
995995 imageDesc.mem_object = this ;
996996 // get access to the Y plane (CL_R)
997997 imageDesc.image_depth = 0 ;
998- const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable (flags, &imageFormat);
998+ const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable (flags, &imageFormat, context-> getDevice ( 0 )-> getHardwareInfo (). capabilityTable . clVersionSupport );
999999
10001000 // Create NV12 UV Plane image
10011001 std::unique_ptr<Image> imageYPlane (Image::create (
@@ -1020,7 +1020,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) {
10201020 imageFormat.image_channel_order = CL_RG;
10211021
10221022 hostPtr = static_cast <const void *>(static_cast <const char *>(hostPtr) + (hostPtrRowPitch * this ->imageDesc .image_height ));
1023- surfaceFormat = Image::getSurfaceFormatFromTable (flags, &imageFormat);
1023+ surfaceFormat = Image::getSurfaceFormatFromTable (flags, &imageFormat, context-> getDevice ( 0 )-> getHardwareInfo (). capabilityTable . clVersionSupport );
10241024 // Create NV12 UV Plane image
10251025 std::unique_ptr<Image> imageUVPlane (Image::create (
10261026 context,
@@ -1037,13 +1037,13 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) {
10371037 return retVal;
10381038}
10391039
1040- const ClSurfaceFormatInfo *Image::getSurfaceFormatFromTable (cl_mem_flags flags, const cl_image_format *imageFormat) {
1040+ const ClSurfaceFormatInfo *Image::getSurfaceFormatFromTable (cl_mem_flags flags, const cl_image_format *imageFormat, unsigned int clVersionSupport ) {
10411041 if (!imageFormat) {
10421042 DEBUG_BREAK_IF (" Invalid format" );
10431043 return nullptr ;
10441044 }
10451045
1046- ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats (flags, imageFormat);
1046+ ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats (flags, imageFormat, clVersionSupport );
10471047
10481048 for (auto &format : formats) {
10491049 if (format.OCLImageFormat .image_channel_data_type == imageFormat->image_channel_data_type &&
@@ -1101,7 +1101,7 @@ Image *Image::validateAndCreateImage(Context *context,
11011101 return nullptr ;
11021102 }
11031103
1104- const auto surfaceFormat = Image::getSurfaceFormatFromTable (flags, imageFormat);
1104+ const auto surfaceFormat = Image::getSurfaceFormatFromTable (flags, imageFormat, context-> getDevice ( 0 )-> getHardwareInfo (). capabilityTable . clVersionSupport );
11051105
11061106 errcodeRet = Image::validate (context, memoryProperties, surfaceFormat, imageDesc, hostPtr);
11071107 if (errcodeRet != CL_SUCCESS) {
0 commit comments