Revert "Destroy resource handle when created"
This reverts commit 5a6a90aa0e
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
parent
cf55a92b79
commit
00ff0dc337
|
@ -811,24 +811,6 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandl
|
|||
EXPECT_EQ(lastDestroyed, expectedDestroyHandle);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromHostPtrIsCalledThenDestroyResourceHandle) {
|
||||
auto size = 13u;
|
||||
auto hostPtr = reinterpret_cast<const void *>(0x10001);
|
||||
|
||||
AllocationData allocationData;
|
||||
allocationData.size = size;
|
||||
allocationData.hostPtr = hostPtr;
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryForNonSvmHostPtr(allocationData));
|
||||
|
||||
auto expectedDestroyHandle = allocation->resourceHandle;
|
||||
EXPECT_NE(0u, expectedDestroyHandle);
|
||||
auto lastDestroyed = getMockLastDestroyedResHandleFcn();
|
||||
EXPECT_EQ(0u, lastDestroyed);
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
lastDestroyed = getMockLastDestroyedResHandleFcn();
|
||||
EXPECT_EQ(lastDestroyed, expectedDestroyHandle);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromSharedHandleIsCalledThenUpdateSize) {
|
||||
auto osHandle = 1u;
|
||||
auto size = 4096u;
|
||||
|
|
|
@ -565,7 +565,7 @@ void WddmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation
|
|||
input->fragmentsStorage.fragmentCount > 0) {
|
||||
cleanGraphicsMemoryCreatedFromHostPtr(gfxAllocation);
|
||||
} else {
|
||||
if (input->resourceHandle != 0) {
|
||||
if (input->peekSharedHandle() || input->peekInternalHandle(nullptr) != 0) {
|
||||
[[maybe_unused]] auto status = tryDeferDeletions(nullptr, 0, input->resourceHandle, gfxAllocation->getRootDeviceIndex());
|
||||
DEBUG_BREAK_IF(!status);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue