Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions intercept/src/intercept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7446,6 +7446,7 @@ void CLIntercept::addImage(
size_t rowPitch = 0;
size_t slicePitch = 0;
cl_image_format format;
cl_mem_object_type imageType;

errorCode |= dispatch().clGetImageInfo(
image,
Expand Down Expand Up @@ -7495,6 +7496,12 @@ void CLIntercept::addImage(
sizeof(cl_image_format),
&format,
nullptr );
errorCode |= dispatch().clGetMemObjectInfo(
image,
CL_MEM_TYPE,
sizeof(imageType),
&imageType,
NULL );

if( errorCode == CL_SUCCESS )
{
Expand All @@ -7506,12 +7513,10 @@ void CLIntercept::addImage(
if( arraySize == 0 )
{
imageInfo.Region[1] = 1; // 1D image
imageInfo.ImageType = CL_MEM_OBJECT_IMAGE1D;
}
else
{
imageInfo.Region[1] = arraySize; // 1D image array
imageInfo.ImageType = CL_MEM_OBJECT_IMAGE1D_ARRAY;
}
}
else
Expand All @@ -7524,21 +7529,19 @@ void CLIntercept::addImage(
if( arraySize == 0 )
{
imageInfo.Region[2] = 1; // 2D image
imageInfo.ImageType = CL_MEM_OBJECT_IMAGE2D;
}
else
{
imageInfo.Region[2] = arraySize; // 2D image array
imageInfo.ImageType = CL_MEM_OBJECT_IMAGE2D_ARRAY;
}
}
else
{
CLI_ASSERT( arraySize == 0 );
imageInfo.Region[2] = depth; // 3D image
imageInfo.ImageType = CL_MEM_OBJECT_IMAGE3D;
}

imageInfo.ImageType = imageType;
imageInfo.ElementSize = elementSize;
imageInfo.Format = format;
imageInfo.RowPitch = rowPitch;
Expand Down
Loading