Add hwhelper function allowRenderCompressionForContext

Rename and unify compression related functions.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-11-10 12:53:38 +01:00
committed by Compute-Runtime-Automation
parent e096e5b0f8
commit ed04053007
9 changed files with 21 additions and 13 deletions

View File

@@ -477,7 +477,7 @@ TEST_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenProperPe
Buffer::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()),
0, 0, size, static_cast<void *>(NULL), retVal));
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get());
auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(hwInfo, size) &&
auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size) &&
HwHelper::renderCompressedBuffersSupported(hwInfo);
if (compressionSupported) {
EXPECT_TRUE(containsHint(expectedHint, userData));
@@ -506,7 +506,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo
isCompressed = MemObjHelper::isSuitableForRenderCompression(
HwHelper::renderCompressedBuffersSupported(hwInfo),
memoryProperties, *context,
HwHelper::get(hwInfo.platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(hwInfo, size)) &&
HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size)) &&
!is32bit && !context->isSharedContext &&
(!memoryProperties.flags.useHostPtr || context->getMemoryManager()->isLocalMemorySupported(device->getRootDeviceIndex())) &&
!memoryProperties.flags.forceHostMemory;