Compression selector to check for stateless compression

Related-To: NEO-5107

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-08-02 17:20:25 +00:00
committed by Compute-Runtime-Automation
parent 8cc5decd60
commit 15f0642d60
2 changed files with 15 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
set(RUNTIME_SRCS_MEMORY_MANAGER
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/compression_selector_ocl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/compression_selector_ocl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpu_page_fault_manager_memory_sync.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_surface.h
${CMAKE_CURRENT_SOURCE_DIR}/migration_controller.cpp

View File

@@ -5,11 +5,24 @@
*
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/memory_manager/compression_selector.h"
namespace NEO {
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
return GraphicsAllocation::AllocationType::BUFFER_COMPRESSED == properties.allocationType;
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;
}
}
} // namespace NEO