Correct src/dst size for 1D,2D images

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-4692
This commit is contained in:
Kamil Kopryk
2021-06-07 16:11:25 +00:00
committed by Compute-Runtime-Automation
parent e9a43f1f66
commit b81ef7a5c6
2 changed files with 33 additions and 13 deletions

View File

@ -1288,6 +1288,24 @@ HWTEST_F(BcsTests, givenBlitterDirectSubmissionEnabledWhenProgrammingBlitterThen
EXPECT_EQ(0ull, bbStart->getBatchBufferStartAddressGraphicsaddress472());
}
HWTEST_F(BcsTests, givenImage1DWhenAdjustBlitPropertiesForImageIsCalledThenValuesAreSetCorrectly) {
cl_image_desc imgDesc = Image1dDefaults::imageDesc;
imgDesc.image_width = 10u;
imgDesc.image_height = 0u;
imgDesc.image_depth = 0u;
std::unique_ptr<Image> image(Image1dHelper<>::create(context.get(), &imgDesc));
Vec3<size_t> size{0, 0, 0};
size_t bytesPerPixel = 0u;
size_t expectedBytesPerPixel = image->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes;
ClBlitProperties::adjustBlitPropertiesForImage(image.get(), size, bytesPerPixel);
EXPECT_EQ(imgDesc.image_width, size.x);
EXPECT_EQ(1u, size.y);
EXPECT_EQ(1u, size.z);
EXPECT_EQ(expectedBytesPerPixel, bytesPerPixel);
}
HWTEST_F(BcsTests, givenHostPtrToImageWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
void *hostPtr = reinterpret_cast<void *>(0x12340000);
cl_image_desc imgDesc = Image2dDefaults::imageDesc;