mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 07:00:17 +08:00
29 lines
937 B
C++
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
|