diff --git a/shared/source/helpers/bindless_heaps_helper.cpp b/shared/source/helpers/bindless_heaps_helper.cpp index 5f61d32ded..092c5e516d 100644 --- a/shared/source/helpers/bindless_heaps_helper.cpp +++ b/shared/source/helpers/bindless_heaps_helper.cpp @@ -49,11 +49,11 @@ constexpr size_t heapRegularSize = reservedRangeSize - heapFrontWindowSize; using BindlesHeapType = BindlessHeapsHelper::BindlesHeapType; BindlessHeapsHelper::BindlessHeapsHelper(Device *rootDevice, bool isMultiOsContextCapable) : rootDevice(rootDevice), - surfaceStateSize(rootDevice->getRootDeviceEnvironment().getHelper().getRenderSurfaceStateSize()), memManager(rootDevice->getMemoryManager()), - isMultiOsContextCapable(isMultiOsContextCapable), + deviceBitfield(rootDevice->getDeviceBitfield()), + surfaceStateSize(rootDevice->getRootDeviceEnvironment().getHelper().getRenderSurfaceStateSize()), rootDeviceIndex(rootDevice->getRootDeviceIndex()), - deviceBitfield(rootDevice->getDeviceBitfield()) { + isMultiOsContextCapable(isMultiOsContextCapable) { for (auto heapType = 0; heapType < BindlesHeapType::numHeapTypes; heapType++) { auto size = MemoryConstants::pageSize64k; diff --git a/shared/source/helpers/bindless_heaps_helper.h b/shared/source/helpers/bindless_heaps_helper.h index 99b604ec39..7f39ab1d24 100644 --- a/shared/source/helpers/bindless_heaps_helper.h +++ b/shared/source/helpers/bindless_heaps_helper.h @@ -70,41 +70,40 @@ class BindlessHeapsHelper : NEO::NonCopyableAndNonMovableClass { void clearStateDirtyForContext(uint32_t osContextId); protected: - bool tryReservingMemoryForSpecialSsh(const size_t size, size_t alignment); - std::optional reserveMemoryRange(size_t size, size_t alignment, HeapIndex heapIndex); + bool growHeap(BindlesHeapType heapType); bool initializeReservedMemory(); bool isReservedMemoryModeAvailable(); - - protected: - Device *rootDevice = nullptr; - const size_t surfaceStateSize; - bool growHeap(BindlesHeapType heapType); - MemoryManager *memManager = nullptr; - bool isMultiOsContextCapable = false; - const uint32_t rootDeviceIndex; - std::unique_ptr surfaceStateHeaps[BindlesHeapType::numHeapTypes]; - GraphicsAllocation *borderColorStates; - std::vector ssHeapsAllocations; - - size_t reuseSlotCountThreshold = 512; - uint32_t allocatePoolIndex = 0; - uint32_t releasePoolIndex = 0; - bool allocateFromReusePool = false; - std::array, 2> surfaceStateInHeapVectorReuse[2]; - std::bitset<64> stateCacheDirtyForContext; + bool tryReservingMemoryForSpecialSsh(const size_t size, size_t alignment); + std::optional reserveMemoryRange(size_t size, size_t alignment, HeapIndex heapIndex); std::mutex mtx; - DeviceBitfield deviceBitfield; - bool globalBindlessDsh = false; - bool useReservedMemory = false; - bool reservedMemoryInitialized = false; - uint64_t reservedRangeBase = 0; + Device *rootDevice = nullptr; + MemoryManager *memManager = nullptr; + GraphicsAllocation *borderColorStates = nullptr; + std::vector reservedRanges; + std::vector ssHeapsAllocations; + std::array, 2> surfaceStateInHeapVectorReuse[2]; + std::unique_ptr surfaceStateHeaps[BindlesHeapType::numHeapTypes]; std::unique_ptr heapFrontWindow; std::unique_ptr heapRegular; - std::vector reservedRanges; + size_t reuseSlotCountThreshold = 512; + uint64_t reservedRangeBase = 0; + std::bitset<64> stateCacheDirtyForContext; + DeviceBitfield deviceBitfield; + const size_t surfaceStateSize; + + const uint32_t rootDeviceIndex; + uint32_t allocatePoolIndex = 0; + uint32_t releasePoolIndex = 0; + + bool allocateFromReusePool = false; + bool globalBindlessDsh = false; + bool isMultiOsContextCapable = false; + bool reservedMemoryInitialized = false; + bool useReservedMemory = false; }; static_assert(NEO::NonCopyableAndNonMovable);