mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
fix: make dispatch globals array allocation lockable
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e0d3db3d91
commit
8ada5db581
@@ -886,7 +886,7 @@ void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) {
|
||||
GraphicsAllocation *dispatchGlobalsArrayAllocation = nullptr;
|
||||
|
||||
AllocationProperties arrayAllocProps(getRootDeviceIndex(), true, dispatchGlobalsSize,
|
||||
AllocationType::BUFFER, true, getDeviceBitfield());
|
||||
AllocationType::GLOBAL_SURFACE, true, getDeviceBitfield());
|
||||
arrayAllocProps.flags.resource48Bit = productHelper.is48bResourceNeededForRayTracing();
|
||||
arrayAllocProps.flags.isUSMDeviceAllocation = true;
|
||||
dispatchGlobalsArrayAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(arrayAllocProps);
|
||||
|
||||
@@ -126,6 +126,20 @@ TEST_F(DeviceTest, whenGetRTDispatchGlobalsIsCalledWithUnsupportedBVHLevelsThenN
|
||||
EXPECT_EQ(nullptr, pDevice->getRTDispatchGlobals(100));
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, whenInitializeRayTracingIsCalledWithMockAllocatorThenDispatchGlobalsArrayAllocationIsLockable) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(0);
|
||||
auto maxBvhLevel = 3;
|
||||
pDevice->initializeRayTracing(maxBvhLevel);
|
||||
for (auto i = 0; i < maxBvhLevel; i++) {
|
||||
auto rtDispatchGlobals = pDevice->getRTDispatchGlobals(i);
|
||||
EXPECT_NE(nullptr, rtDispatchGlobals);
|
||||
auto dispatchGlobalsArray = rtDispatchGlobals->rtDispatchGlobalsArray;
|
||||
EXPECT_NE(nullptr, dispatchGlobalsArray);
|
||||
EXPECT_FALSE(dispatchGlobalsArray->getDefaultGmm()->resourceParams.Flags.Info.NotLockable);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, whenInitializeRayTracingIsCalledWithMockAllocatorThenRTDispatchGlobalsIsAllocated) {
|
||||
pDevice->initializeRayTracing(5);
|
||||
EXPECT_NE(nullptr, pDevice->getRTDispatchGlobals(3));
|
||||
|
||||
Reference in New Issue
Block a user