mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Fixes incorrect slice pitch calculation in clCopyImage 1Darray (#1258)
The slice pitch/padding calculation assumed that the 'height' variable contained the pixel height of the image, which it doesn't for IMAGE1D_ARRAY. Fixes #1257
This commit is contained in:
@@ -228,6 +228,11 @@ cl_mem create_image( cl_context context, cl_command_queue queue, BufferOwningPtr
|
||||
}
|
||||
size_t mappedSlicePad = mappedSlice - (mappedRow * height);
|
||||
|
||||
// For 1Darray, the height variable actually contains the arraysize,
|
||||
// so it can't be used for calculating the slice padding.
|
||||
if (imageInfo->type == CL_MEM_OBJECT_IMAGE1D_ARRAY)
|
||||
mappedSlicePad = mappedSlice - (mappedRow * 1);
|
||||
|
||||
// Copy the image.
|
||||
size_t scanlineSize = row_pitch_lod;
|
||||
size_t sliceSize = slice_pitch_lod - scanlineSize * height;
|
||||
|
||||
Reference in New Issue
Block a user