2020-12-04 11:28:18 +00:00
|
|
|
/*
|
2023-06-26 17:49:16 +00:00
|
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
2020-12-04 11:28:18 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-05-17 19:04:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-12-04 11:28:18 +00:00
|
|
|
#include "shared/source/helpers/bindless_heaps_helper.h"
|
|
|
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
|
|
|
|
|
class MockBindlesHeapsHelper : public BindlessHeapsHelper {
|
|
|
|
|
public:
|
|
|
|
|
using BaseClass = BindlessHeapsHelper;
|
2021-10-05 10:30:14 +00:00
|
|
|
MockBindlesHeapsHelper(MemoryManager *memManager, bool isMultiOsContextCapable, const uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) : BaseClass(memManager, isMultiOsContextCapable, rootDeviceIndex, deviceBitfield) {
|
2023-12-13 16:09:52 +00:00
|
|
|
globalSsh = surfaceStateHeaps[BindlesHeapType::globalSsh].get();
|
|
|
|
|
specialSsh = surfaceStateHeaps[BindlesHeapType::specialSsh].get();
|
|
|
|
|
scratchSsh = surfaceStateHeaps[BindlesHeapType::specialSsh].get();
|
|
|
|
|
globalDsh = surfaceStateHeaps[BindlesHeapType::specialSsh].get();
|
2020-12-04 11:28:18 +00:00
|
|
|
}
|
2023-07-31 14:33:30 +00:00
|
|
|
|
|
|
|
|
SurfaceStateInHeapInfo allocateSSInHeap(size_t ssSize, GraphicsAllocation *surfaceAllocation, BindlesHeapType heapType) override {
|
|
|
|
|
if (failAllocateSS) {
|
|
|
|
|
return SurfaceStateInHeapInfo{};
|
|
|
|
|
}
|
|
|
|
|
return BaseClass::allocateSSInHeap(ssSize, surfaceAllocation, heapType);
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 11:28:18 +00:00
|
|
|
using BindlesHeapType = BindlessHeapsHelper::BindlesHeapType;
|
2023-08-25 14:28:27 +00:00
|
|
|
using BaseClass::allocateFromReusePool;
|
|
|
|
|
using BaseClass::allocatePoolIndex;
|
2020-12-04 11:28:18 +00:00
|
|
|
using BaseClass::borderColorStates;
|
2023-06-26 17:49:16 +00:00
|
|
|
using BaseClass::globalBindlessDsh;
|
2020-12-04 11:28:18 +00:00
|
|
|
using BaseClass::growHeap;
|
|
|
|
|
using BaseClass::isMultiOsContextCapable;
|
|
|
|
|
using BaseClass::memManager;
|
2023-08-25 14:28:27 +00:00
|
|
|
using BaseClass::releasePoolIndex;
|
|
|
|
|
using BaseClass::reuseSlotCountThreshold;
|
2020-12-04 11:28:18 +00:00
|
|
|
using BaseClass::rootDeviceIndex;
|
|
|
|
|
using BaseClass::ssHeapsAllocations;
|
2023-08-25 14:28:27 +00:00
|
|
|
using BaseClass::stateCacheDirtyForContext;
|
2020-12-04 11:28:18 +00:00
|
|
|
using BaseClass::surfaceStateHeaps;
|
2021-01-27 14:31:29 +01:00
|
|
|
using BaseClass::surfaceStateInHeapVectorReuse;
|
2023-08-17 08:17:57 +00:00
|
|
|
using BaseClass::surfaceStateSize;
|
2020-12-04 11:28:18 +00:00
|
|
|
|
|
|
|
|
IndirectHeap *specialSsh;
|
|
|
|
|
IndirectHeap *globalSsh;
|
|
|
|
|
IndirectHeap *scratchSsh;
|
|
|
|
|
IndirectHeap *globalDsh;
|
2023-07-31 14:33:30 +00:00
|
|
|
bool failAllocateSS = false;
|
2020-12-04 11:28:18 +00:00
|
|
|
};
|