Force linear storage for images

Related-To: NEO-3114

Change-Id: I20dd6c7fdf4a223d45f1c3587d8a1327268742d8
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-04-29 07:58:14 +02:00
parent ddcd3fbbed
commit e871852601
5 changed files with 56 additions and 1 deletions

View File

@@ -180,7 +180,7 @@ Image *Image::create(Context *context,
auto hostPtrRowPitch = imageDesc->image_row_pitch ? imageDesc->image_row_pitch : imageWidth * surfaceFormat->ImageElementSizeInBytes;
auto hostPtrSlicePitch = imageDesc->image_slice_pitch ? imageDesc->image_slice_pitch : hostPtrRowPitch * imageHeight;
auto isTilingAllowed = context->isSharedContext ? false : GmmHelper::allowTiling(*imageDesc);
auto isTilingAllowed = context->isSharedContext ? false : GmmHelper::allowTiling(*imageDesc) && !MemObjHelper::isLinearStorageForced(flags);
imgInfo.preferRenderCompression = MemObjHelper::isSuitableForRenderCompression(isTilingAllowed, flags,
context->peekContextType(), true);

View File

@@ -127,6 +127,11 @@ class MemObjHelper {
return svmProperties;
}
static bool isLinearStorageForced(const MemoryProperties &memoryProperties) {
return isValueSet(memoryProperties.flags, CL_MEM_FORCE_LINEAR_STORAGE_INTEL) ||
isValueSet(memoryProperties.flags_intel, CL_MEM_FORCE_LINEAR_STORAGE_INTEL);
}
static bool isSuitableForRenderCompression(bool renderCompressed, const MemoryProperties &properties, ContextType contextType, bool preferCompression);
protected: