2020-09-11 21:44:09 +08:00
|
|
|
/*
|
2023-01-04 17:45:07 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-09-11 21:44:09 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-09-14 18:50:58 +08:00
|
|
|
#include "shared/source/memory_manager/allocation_properties.h"
|
2020-09-11 21:44:09 +08:00
|
|
|
#include "shared/source/memory_manager/compression_selector.h"
|
2022-09-14 18:50:58 +08:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2023-03-10 20:28:11 +08:00
|
|
|
#include "shared/source/os_interface/product_helper.h"
|
2020-09-11 21:44:09 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
2023-01-04 17:45:07 +08:00
|
|
|
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
|
2021-08-03 01:20:25 +08:00
|
|
|
switch (properties.allocationType) {
|
2022-02-04 21:59:01 +08:00
|
|
|
case AllocationType::GLOBAL_SURFACE:
|
|
|
|
case AllocationType::CONSTANT_SURFACE:
|
|
|
|
case AllocationType::SVM_GPU:
|
|
|
|
case AllocationType::PRINTF_SURFACE: {
|
2023-01-04 17:45:07 +08:00
|
|
|
return CompressionSelector::allowStatelessCompression();
|
2021-08-03 01:20:25 +08:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
2020-09-11 21:44:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace NEO
|