fix: track shifted contextIds in bitset in bindlessHeapsHelper

- bitset is 64 bit in size, context ids may go beyond that limit
when multiple devices are available
- this change subtracts contextId of first context for a given root
device - tracked state dirty contexts ids are now zero-based

Resolves: GSD-10025

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2024-10-08 17:51:14 +00:00
committed by Compute-Runtime-Automation
parent 46a63d3e0e
commit 5ae2552b4b
4 changed files with 81 additions and 2 deletions

View File

@@ -75,13 +75,19 @@ GraphicsAllocation *BindlessHeapsHelper::getHeapAllocation(size_t heapSize, size
void BindlessHeapsHelper::clearStateDirtyForContext(uint32_t osContextId) {
std::lock_guard<std::mutex> autolock(this->mtx);
stateCacheDirtyForContext.reset(osContextId);
uint32_t contextIdShifted = osContextId - memManager->getFirstContextIdForRootDevice(rootDeviceIndex);
DEBUG_BREAK_IF(contextIdShifted >= stateCacheDirtyForContext.size());
stateCacheDirtyForContext.reset(contextIdShifted);
}
bool BindlessHeapsHelper::getStateDirtyForContext(uint32_t osContextId) {
std::lock_guard<std::mutex> autolock(this->mtx);
return stateCacheDirtyForContext.test(osContextId);
uint32_t contextIdShifted = osContextId - memManager->getFirstContextIdForRootDevice(rootDeviceIndex);
DEBUG_BREAK_IF(contextIdShifted >= stateCacheDirtyForContext.size());
return stateCacheDirtyForContext.test(contextIdShifted);
}
SurfaceStateInHeapInfo BindlessHeapsHelper::allocateSSInHeap(size_t ssSize, GraphicsAllocation *surfaceAllocation, BindlesHeapType heapType) {