mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
refactor: reorganize command encode classes 2/n
- add new inl files for selected platform families - split image compression methods into correct inl files - remove dedicated compression inl files Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
34e22f0eee
commit
eb435acb22
@@ -35,6 +35,12 @@ if(SUPPORT_XEHP_AND_LATER)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(SUPPORT_XE_HPG OR SUPPORT_XE_HPC)
|
||||
list(APPEND NEO_CORE_COMMAND_CONTAINER
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_xe_hpg_core_and_xe_hpc.inl
|
||||
)
|
||||
endif()
|
||||
|
||||
if(SUPPORT_DG2_AND_LATER)
|
||||
list(APPEND NEO_CORE_COMMAND_CONTAINER
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_xe_hpg_core_and_later.inl
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
template <typename Family>
|
||||
size_t EncodeDispatchKernel<Family>::getDefaultIOHAlignment() {
|
||||
@@ -27,4 +30,36 @@ void EncodeSurfaceState<Family>::disableCompressionFlags(R_SURFACE_STATE *surfac
|
||||
surfaceState->setMemoryCompressionEnable(false);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setAuxParamsForMCSCCS(R_SURFACE_STATE *surfaceState, const ReleaseHelper *releaseHelper) {
|
||||
if (releaseHelper && releaseHelper->isAuxSurfaceModeOverrideRequired())
|
||||
surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
else
|
||||
surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS_LCE);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setClearColorParams(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
if (gmm->gmmResourceInfo->getResourceFlags()->Gpu.IndirectClearColor) {
|
||||
surfaceState->setClearValueAddressEnable(true);
|
||||
|
||||
auto gmmHelper = gmm->getGmmHelper();
|
||||
uint64_t clearColorAddress = gmmHelper->decanonize(surfaceState->getSurfaceBaseAddress() +
|
||||
gmm->gmmResourceInfo->getUnifiedAuxSurfaceOffset(GMM_UNIFIED_AUX_TYPE::GMM_AUX_CC));
|
||||
|
||||
surfaceState->setClearColorAddress(static_cast<uint32_t>(clearColorAddress & 0xFFFFFFFFULL));
|
||||
surfaceState->setClearColorAddressHigh(static_cast<uint32_t>(clearColorAddress >> 32));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
if (gmm->gmmResourceInfo->getResourceFlags()->Info.MediaCompressed) {
|
||||
surfaceState->setAuxiliarySurfaceMode(Family::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
surfaceState->setMemoryCompressionEnable(true);
|
||||
} else {
|
||||
surfaceState->setMemoryCompressionEnable(false);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
template <typename Family>
|
||||
size_t EncodeDispatchKernel<Family>::getDefaultIOHAlignment() {
|
||||
@@ -40,4 +43,28 @@ template <typename Family>
|
||||
void EncodeSurfaceState<Family>::disableCompressionFlags(R_SURFACE_STATE *surfaceState) {
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::appendImageCompressionParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation,
|
||||
GmmHelper *gmmHelper, bool imageFromBuffer, GMM_YUV_PLANE_ENUM plane) {
|
||||
if (!allocation->isCompressionEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
using COMPRESSION_FORMAT = typename R_SURFACE_STATE::COMPRESSION_FORMAT;
|
||||
|
||||
auto gmmResourceInfo = allocation->getDefaultGmm()->gmmResourceInfo.get();
|
||||
|
||||
auto compressionFormat = gmmHelper->getClientContext()->getSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
|
||||
|
||||
surfaceState->setCompressionFormat(static_cast<COMPRESSION_FORMAT>(compressionFormat));
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setClearColorParams(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
inline void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
|
||||
namespace NEO {
|
||||
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(NEO_CORE_COMMAND_CONTAINER_IMAGE_SURFACE_STATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compression_params_bdw_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compression_params_tgllp_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compression_params_xehp_and_later.inl
|
||||
)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY NEO_CORE_COMMAND_CONTAINER ${NEO_CORE_COMMAND_CONTAINER_IMAGE_SURFACE_STATE})
|
||||
|
||||
add_subdirectories()
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace NEO {
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::appendImageCompressionParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation,
|
||||
GmmHelper *gmmHelper, bool imageFromBuffer, GMM_YUV_PLANE_ENUM plane) {
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace NEO {
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setAuxParamsForMCSCCS(R_SURFACE_STATE *surfaceState, const ReleaseHelper *releaseHelper) {
|
||||
if (releaseHelper && releaseHelper->isAuxSurfaceModeOverrideRequired())
|
||||
surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
else
|
||||
surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS_LCE);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setClearColorParams(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
if (gmm->gmmResourceInfo->getResourceFlags()->Gpu.IndirectClearColor) {
|
||||
surfaceState->setClearValueAddressEnable(true);
|
||||
|
||||
auto gmmHelper = gmm->getGmmHelper();
|
||||
uint64_t clearColorAddress = gmmHelper->decanonize(surfaceState->getSurfaceBaseAddress() +
|
||||
gmm->gmmResourceInfo->getUnifiedAuxSurfaceOffset(GMM_UNIFIED_AUX_TYPE::GMM_AUX_CC));
|
||||
|
||||
surfaceState->setClearColorAddress(static_cast<uint32_t>(clearColorAddress & 0xFFFFFFFFULL));
|
||||
surfaceState->setClearColorAddressHigh(static_cast<uint32_t>(clearColorAddress >> 32));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
if (gmm->gmmResourceInfo->getResourceFlags()->Info.MediaCompressed) {
|
||||
surfaceState->setAuxiliarySurfaceMode(Family::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
surfaceState->setMemoryCompressionEnable(true);
|
||||
} else {
|
||||
surfaceState->setMemoryCompressionEnable(false);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -23,8 +23,6 @@
|
||||
using Family = NEO::Gen12LpFamily;
|
||||
|
||||
#include "shared/source/command_container/command_encoder_heap_addressing.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_bdw_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_tgllp_and_later.inl"
|
||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||
|
||||
namespace NEO {
|
||||
@@ -113,6 +111,11 @@ void EncodeComputeMode<Family>::adjustPipelineSelect(CommandContainer &container
|
||||
container.getDevice()->getRootDeviceEnvironment());
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::appendImageCompressionParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation,
|
||||
GmmHelper *gmmHelper, bool imageFromBuffer, GMM_YUV_PLANE_ENUM plane) {
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
#include "shared/source/command_container/command_encoder_enablers.inl"
|
||||
|
||||
@@ -23,7 +23,6 @@ using Family = NEO::Xe2HpgCoreFamily;
|
||||
|
||||
#include "shared/source/command_container/command_encoder_xe_hpc_core_and_later.inl"
|
||||
#include "shared/source/command_container/command_encoder_xe_hpg_core_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -195,36 +194,12 @@ bool EncodeSurfaceState<Family>::isAuxModeEnabled(R_SURFACE_STATE *surfaceState,
|
||||
return gmm && gmm->isCompressionEnabled();
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::appendImageCompressionParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation,
|
||||
GmmHelper *gmmHelper, bool imageFromBuffer, GMM_YUV_PLANE_ENUM plane) {
|
||||
if (!allocation->isCompressionEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
using COMPRESSION_FORMAT = typename R_SURFACE_STATE::COMPRESSION_FORMAT;
|
||||
|
||||
auto gmmResourceInfo = allocation->getDefaultGmm()->gmmResourceInfo.get();
|
||||
|
||||
auto compressionFormat = gmmHelper->getClientContext()->getSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
|
||||
|
||||
surfaceState->setCompressionFormat(static_cast<COMPRESSION_FORMAT>(compressionFormat));
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::setAuxParamsForMCSCCS(R_SURFACE_STATE *surfaceState, const ReleaseHelper *releaseHelper) {
|
||||
if (releaseHelper && releaseHelper->isAuxSurfaceModeOverrideRequired())
|
||||
surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS);
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::setClearColorParams(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
}
|
||||
|
||||
template <>
|
||||
template <typename InterfaceDescriptorType>
|
||||
void EncodeDispatchKernel<Family>::setGrfInfo(InterfaceDescriptorType *pInterfaceDescriptor, uint32_t grfCount,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/command_container/command_encoder_from_gen12lp_to_xe2_hpg.inl"
|
||||
#include "shared/source/command_container/command_encoder_pre_xe2_hpg_core.inl"
|
||||
#include "shared/source/command_container/command_encoder_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/command_encoder_xe_hpg_core_and_xe_hpc.inl"
|
||||
#include "shared/source/command_container/command_encoder_xehp_and_later.inl"
|
||||
#include "shared/source/command_stream/stream_properties.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
@@ -23,8 +24,6 @@ using Family = NEO::XeHpcCoreFamily;
|
||||
#include "shared/source/command_container/command_encoder_heap_addressing.inl"
|
||||
#include "shared/source/command_container/command_encoder_xe_hpc_core_and_later.inl"
|
||||
#include "shared/source/command_container/command_encoder_xe_hpg_core_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/command_container/command_encoder_from_gen12lp_to_xe2_hpg.inl"
|
||||
#include "shared/source/command_container/command_encoder_pre_xe2_hpg_core.inl"
|
||||
#include "shared/source/command_container/command_encoder_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/command_encoder_xe_hpg_core_and_xe_hpc.inl"
|
||||
#include "shared/source/command_container/command_encoder_xehp_and_later.inl"
|
||||
#include "shared/source/command_stream/stream_properties.h"
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
@@ -22,8 +23,6 @@ using Family = NEO::XeHpgCoreFamily;
|
||||
|
||||
#include "shared/source/command_container/command_encoder_heap_addressing.inl"
|
||||
#include "shared/source/command_container/command_encoder_xe_hpg_core_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user