2020-09-11 21:44:09 +08:00
|
|
|
/*
|
2021-08-02 18:44:48 +08:00
|
|
|
* Copyright (C) 2020-2021 Intel Corporation
|
2020-09-11 21:44:09 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-08-03 01:20:25 +08:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2020-09-11 21:44:09 +08:00
|
|
|
#include "shared/source/memory_manager/compression_selector.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
2021-08-02 18:44:48 +08:00
|
|
|
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
2021-08-03 01:20:25 +08:00
|
|
|
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: {
|
|
|
|
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
|
|
return hwHelper.allowStatelessCompression(hwInfo);
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
2020-09-11 21:44:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace NEO
|