mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
Make command buffers resident at cmd container init
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eff7439eca
commit
79075a3e92
@@ -95,11 +95,10 @@ CommandContainer::ErrorCode CommandContainer::initialize(Device *device, Allocat
|
|||||||
alignedSize - cmdBufferReservedSize, this, gfxCoreHelper.getBatchBufferEndSize());
|
alignedSize - cmdBufferReservedSize, this, gfxCoreHelper.getBatchBufferEndSize());
|
||||||
secondaryCommandStreamForImmediateCmdList->replaceGraphicsAllocation(cmdBufferAllocationHost);
|
secondaryCommandStreamForImmediateCmdList->replaceGraphicsAllocation(cmdBufferAllocationHost);
|
||||||
cmdBufferAllocations.push_back(cmdBufferAllocationHost);
|
cmdBufferAllocations.push_back(cmdBufferAllocationHost);
|
||||||
|
addToResidencyContainer(cmdBufferAllocationHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getFlushTaskUsedForImmediate()) {
|
|
||||||
addToResidencyContainer(cmdBufferAllocation);
|
addToResidencyContainer(cmdBufferAllocation);
|
||||||
}
|
|
||||||
if (requireHeaps) {
|
if (requireHeaps) {
|
||||||
size_t heapSize = 65536u;
|
size_t heapSize = 65536u;
|
||||||
if (DebugManager.flags.ForceDefaultHeapSize.get() != -1) {
|
if (DebugManager.flags.ForceDefaultHeapSize.get() != -1) {
|
||||||
|
|||||||
@@ -372,6 +372,14 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddNullPtrToResidenc
|
|||||||
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), size);
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenCmdBuffersAreAddedToResidencyContainer) {
|
||||||
|
CommandContainer cmdContainer;
|
||||||
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 0u);
|
||||||
|
cmdContainer.initialize(pDevice, nullptr, false, true);
|
||||||
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 2u);
|
||||||
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), cmdContainer.getCmdBufferAllocations().size());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAllocationAndDuplicatesRemovedThenExpectedSizeIsReturned) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAllocationAndDuplicatesRemovedThenExpectedSizeIsReturned) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, true, false);
|
cmdContainer.initialize(pDevice, nullptr, true, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user