SWDEV-462404 - Fix num_mip_levels for 1D Buffer
Updating field num_mip_levels to better align with OpenCL specification that mip-mapped images can not be created for CL_MEM_OBJECT_IMAGE1D_BUFFER images. Added check for miplevels value used for ClCreateImage call. Change-Id: I82a25b83ef0637a877409572b7976d9e4413dfac
Этот коммит содержится в:
коммит произвёл
Chris Adolphe
родитель
e43176bde9
Коммит
21a1c9075a
@@ -4109,9 +4109,17 @@ RUNTIME_ENTRY_RET(cl_mem, clCreateImage,
|
||||
return (cl_mem)0;
|
||||
}
|
||||
|
||||
// Mip-mapped images can not be created for IMAGE1D_BUFFER
|
||||
if (image_desc->num_mip_levels != 0) {
|
||||
*not_null(errcode_ret) = CL_INVALID_MIP_LEVEL;
|
||||
LogWarning("Invalid mip level");
|
||||
return (cl_mem)0;
|
||||
}
|
||||
|
||||
image = new (amdContext) amd::Image(
|
||||
buffer, CL_MEM_OBJECT_IMAGE1D_BUFFER, (flags != 0) ? flags : buffer.getMemFlags(),
|
||||
imageFormat, image_desc->image_width, 1, 1, imageRowPitch, imageSlicePitch);
|
||||
imageFormat, image_desc->image_width, 1, 1, imageRowPitch, imageSlicePitch,
|
||||
image_desc->num_mip_levels);
|
||||
} break;
|
||||
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
|
||||
image =
|
||||
|
||||
Ссылка в новой задаче
Block a user