mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
fix: set correct bindless offsets for L0 bindless images extension with heaples
Related-To: NEO-14710 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
762dc5ef8e
commit
83e92017c5
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
@@ -77,6 +78,9 @@ BindlessHeapsHelper::BindlessHeapsHelper(Device *rootDevice, bool isMultiOsConte
|
||||
memcpy_s(borderColorStates->getUnderlyingBuffer(), sizeof(borderColorDefault), borderColorDefault, sizeof(borderColorDefault));
|
||||
float borderColorAlpha[4] = {0, 0, 0, 1.0};
|
||||
memcpy_s(ptrOffset(borderColorStates->getUnderlyingBuffer(), borderColorAlphaOffset), sizeof(borderColorAlpha), borderColorAlpha, sizeof(borderColorDefault));
|
||||
|
||||
auto &hwInfo = *rootDevice->getRootDeviceEnvironment().getHardwareInfo();
|
||||
this->heaplessEnabled = rootDevice->getRootDeviceEnvironment().getHelper<CompilerProductHelper>().isHeaplessModeEnabled(hwInfo);
|
||||
}
|
||||
|
||||
std::optional<AddressRange> BindlessHeapsHelper::reserveMemoryRange(size_t size, size_t alignment, HeapIndex heapIndex) {
|
||||
@@ -235,6 +239,10 @@ SurfaceStateInHeapInfo BindlessHeapsHelper::allocateSSInHeap(size_t ssSize, Grap
|
||||
memset(ptrInHeap, 0, ssSize);
|
||||
auto bindlessOffset = heap->getGraphicsAllocation()->getGpuAddress() - heap->getGraphicsAllocation()->getGpuBaseAddress() + heap->getUsed() - ssSize;
|
||||
|
||||
if (this->heaplessEnabled) {
|
||||
bindlessOffset += heap->getGraphicsAllocation()->getGpuBaseAddress();
|
||||
}
|
||||
|
||||
bindlesInfo = SurfaceStateInHeapInfo{heap->getGraphicsAllocation(), bindlessOffset, ptrInHeap, ssSize};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user