refactor: add new parameter to use dedicated memory to initialize surface state

Related-To: NEO-15374

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2025-07-18 16:25:15 +00:00
committed by Compute-Runtime-Automation
parent 74f04acb88
commit 71659807c4
3 changed files with 51 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -18,6 +18,7 @@ struct EncodeSurfaceStateArgsBase {
size_t size = 0u;
void *outMemory = nullptr;
void *inTemplateMemory = nullptr;
GraphicsAllocation *allocation = nullptr;
GmmHelper *gmmHelper = nullptr;

View File

@@ -684,7 +684,11 @@ template <typename GfxFamily>
void GfxCoreHelperHw<GfxFamily>::encodeBufferSurfaceState(EncodeSurfaceStateArgs &args) const {
using RENDER_SURFACE_STATE = typename GfxFamily::RENDER_SURFACE_STATE;
auto surfaceState = reinterpret_cast<RENDER_SURFACE_STATE *>(args.outMemory);
*surfaceState = GfxFamily::cmdInitRenderSurfaceState;
if (args.inTemplateMemory != nullptr) {
*surfaceState = *reinterpret_cast<RENDER_SURFACE_STATE *>(args.inTemplateMemory);
} else {
*surfaceState = GfxFamily::cmdInitRenderSurfaceState;
}
EncodeSurfaceState<GfxFamily>::encodeBuffer(args);
}