Files
compute-runtime/opencl/source/memory_manager/compression_selector_ocl.cpp
Rafal Maziejuk bbfbf19a02 Move allowStatelessCompression from HwHelper to HwInfoConfig
Signed-off-by: Rafal Maziejuk <rafal.maziejuk@intel.com>
Related-To: NEO-4541
2021-09-09 11:37:47 +02:00

29 lines
937 B
C++

/*
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
switch (properties.allocationType) {
case GraphicsAllocation::AllocationType::BUFFER_COMPRESSED:
return true;
case GraphicsAllocation::AllocationType::GLOBAL_SURFACE:
case GraphicsAllocation::AllocationType::CONSTANT_SURFACE:
case GraphicsAllocation::AllocationType::SVM_GPU:
case GraphicsAllocation::AllocationType::PRINTF_SURFACE: {
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
return hwInfoConfig.allowStatelessCompression(hwInfo);
}
default:
return false;
}
}
} // namespace NEO