mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Pass root device index to MemObj::getGraphicsAllocation method
leave parameterless method in Buffer and Image classes add method to remove graphics allocation from MultiGraphicsAllocation Related-To: NEO-4672 Change-Id: I3020eecfabe9a16af7f36d68a74b32d3f4fc2276 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
@@ -83,3 +83,21 @@ TEST(MultiGraphicsAllocationTest, WhenCreatingMultiGraphicsAllocationWithoutGrap
|
||||
MockMultiGraphicsAllocation multiGraphicsAllocation(1);
|
||||
EXPECT_EQ(nullptr, multiGraphicsAllocation.getDefaultGraphicsAllocation());
|
||||
}
|
||||
|
||||
TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationwhenRemovingGraphicsAllocationThenTheAllocationIsNoLongerAvailable) {
|
||||
uint32_t rootDeviceIndex = 1u;
|
||||
GraphicsAllocation graphicsAllocation(rootDeviceIndex,
|
||||
GraphicsAllocation::AllocationType::BUFFER,
|
||||
nullptr, 0, 0, MemoryPool::System4KBPages);
|
||||
|
||||
MockMultiGraphicsAllocation multiGraphicsAllocation(rootDeviceIndex);
|
||||
EXPECT_EQ(2u, multiGraphicsAllocation.graphicsAllocations.size());
|
||||
|
||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation);
|
||||
|
||||
EXPECT_EQ(&graphicsAllocation, multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex));
|
||||
|
||||
multiGraphicsAllocation.removeAllocation(rootDeviceIndex);
|
||||
|
||||
EXPECT_EQ(nullptr, multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex));
|
||||
}
|
||||
Reference in New Issue
Block a user