mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
- allocate SSH in cmdContainer when scratch allocation used with private heaps - scratch SurfaceStates are addressed relative to SurfaceStateBaseAddress and have to be placed on SSH - remove not used SCRATCH_SSH heap type from bindelssHeapHelper Related-To: NEO-7063 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
48 lines
1.7 KiB
C++
48 lines
1.7 KiB
C++
/*
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "shared/source/helpers/bindless_heaps_helper.h"
|
|
|
|
using namespace NEO;
|
|
|
|
class MockBindlesHeapsHelper : public BindlessHeapsHelper {
|
|
public:
|
|
using BaseClass = BindlessHeapsHelper;
|
|
MockBindlesHeapsHelper(MemoryManager *memManager, bool isMultiOsContextCapable, const uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) : BaseClass(memManager, isMultiOsContextCapable, rootDeviceIndex, deviceBitfield) {
|
|
globalSsh = surfaceStateHeaps[BindlesHeapType::GLOBAL_SSH].get();
|
|
specialSsh = surfaceStateHeaps[BindlesHeapType::SPECIAL_SSH].get();
|
|
scratchSsh = surfaceStateHeaps[BindlesHeapType::SPECIAL_SSH].get();
|
|
globalDsh = surfaceStateHeaps[BindlesHeapType::SPECIAL_SSH].get();
|
|
}
|
|
|
|
SurfaceStateInHeapInfo allocateSSInHeap(size_t ssSize, GraphicsAllocation *surfaceAllocation, BindlesHeapType heapType) override {
|
|
if (failAllocateSS) {
|
|
return SurfaceStateInHeapInfo{};
|
|
}
|
|
return BaseClass::allocateSSInHeap(ssSize, surfaceAllocation, heapType);
|
|
}
|
|
|
|
using BindlesHeapType = BindlessHeapsHelper::BindlesHeapType;
|
|
using BaseClass::borderColorStates;
|
|
using BaseClass::globalBindlessDsh;
|
|
using BaseClass::growHeap;
|
|
using BaseClass::isMultiOsContextCapable;
|
|
using BaseClass::memManager;
|
|
using BaseClass::rootDeviceIndex;
|
|
using BaseClass::ssHeapsAllocations;
|
|
using BaseClass::surfaceStateHeaps;
|
|
using BaseClass::surfaceStateInHeapVectorReuse;
|
|
|
|
IndirectHeap *specialSsh;
|
|
IndirectHeap *globalSsh;
|
|
IndirectHeap *scratchSsh;
|
|
IndirectHeap *globalDsh;
|
|
bool failAllocateSS = false;
|
|
};
|