mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Correct image format reporting for OCL 1.2
Change-Id: Ia2160248d1cda6c13219598f8962aa3372885b9a Signed-off-by: Koska <andrzej.koska@intel.com> Related-To: NEO-3981
This commit is contained in:
@@ -558,7 +558,7 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma
|
||||
imageDesc.image_slice_pitch = 0;
|
||||
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
@@ -617,7 +617,7 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi
|
||||
imageDesc.image_slice_pitch = 0;
|
||||
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
@@ -678,7 +678,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor
|
||||
imageDesc.image_slice_pitch = 0;
|
||||
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
|
||||
@@ -136,7 +136,7 @@ TEST_P(GetSupportedImageFormatsTest, retrieveImageFormatsSRGB) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isReadOnly) {
|
||||
if (isReadOnly && ((&castToObject<ClDevice>(devices[0])->getDevice())->getHardwareInfo().capabilityTable.clVersionSupport >= 20)) {
|
||||
EXPECT_TRUE(sRGBAFormatFound & sBGRAFormatFound);
|
||||
} else {
|
||||
EXPECT_FALSE(sRGBAFormatFound | sBGRAFormatFound);
|
||||
@@ -146,7 +146,7 @@ TEST_P(GetSupportedImageFormatsTest, retrieveImageFormatsSRGB) {
|
||||
}
|
||||
|
||||
TEST(ImageFormats, isDepthFormat) {
|
||||
for (auto &format : SurfaceFormats::readOnly()) {
|
||||
for (auto &format : SurfaceFormats::readOnly20()) {
|
||||
EXPECT_FALSE(Image::isDepthFormat(format.OCLImageFormat));
|
||||
}
|
||||
|
||||
@@ -276,7 +276,9 @@ TEST_P(NV12ExtensionSupportedImageFormatsTest, givenNV12ExtensionWhenQueriedForI
|
||||
nullptr,
|
||||
&numImageFormats);
|
||||
|
||||
size_t expectedNumReadOnlyFormats = SurfaceFormats::readOnly().size();
|
||||
unsigned int clVersionSupport = device.get()->getHardwareInfo().capabilityTable.clVersionSupport;
|
||||
size_t expectedNumReadOnlyFormats = (clVersionSupport >= 20) ? SurfaceFormats::readOnly20().size() : SurfaceFormats::readOnly12().size();
|
||||
|
||||
if (Image::isImage2dOr2dArray(imageFormats) && imageFormatsFlags == CL_MEM_READ_ONLY) {
|
||||
expectedNumReadOnlyFormats += SurfaceFormats::readOnlyDepth().size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user