mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
refactor: pass arrayIndex to Wddm::openSharedHandle function
Related-To: NEO-11498 Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
89a8623933
commit
0ac1be7669
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -46,7 +46,8 @@ class D3DBuffer : public D3DSharing<D3D> {
|
||||
AllocationType::sharedBuffer,
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), properties, true, false, true, nullptr);
|
||||
MemoryManager::OsHandleData osHandleData{sharedHandle};
|
||||
auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(osHandleData, properties, true, false, true, nullptr);
|
||||
|
||||
auto d3dBufferObj = new D3DBuffer<D3D>(context, d3dBuffer, bufferStaging, sharedResource);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -89,7 +89,8 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo
|
||||
AllocationType::sharedImage,
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
|
||||
alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(surfaceInfo->shared_handle), allocProperties,
|
||||
MemoryManager::ExtendedOsHandleData osHandleData{surfaceInfo->shared_handle};
|
||||
alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(osHandleData, allocProperties,
|
||||
false, false, true, nullptr);
|
||||
updateImgInfoAndDesc(alloc->getDefaultGmm(), imgInfo, imagePlane, 0u);
|
||||
} else {
|
||||
|
||||
@@ -90,7 +90,8 @@ Image *D3DTexture<D3D>::create2d(Context *context, D3DTexture2d *d3dTexture, cl_
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
|
||||
if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) {
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false, false, true, nullptr);
|
||||
MemoryManager::ExtendedOsHandleData osHandleData{sharedHandle, arrayIndex};
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, allocProperties, false, false, true, nullptr);
|
||||
} else {
|
||||
err.set(CL_INVALID_D3D11_RESOURCE_KHR);
|
||||
return nullptr;
|
||||
@@ -183,7 +184,8 @@ Image *D3DTexture<D3D>::create3d(Context *context, D3DTexture3d *d3dTexture, cl_
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
|
||||
if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) {
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false, false, true, nullptr);
|
||||
MemoryManager::ExtendedOsHandleData osHandleData{sharedHandle};
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, allocProperties, false, false, true, nullptr);
|
||||
} else {
|
||||
err.set(CL_INVALID_D3D11_RESOURCE_KHR);
|
||||
return nullptr;
|
||||
|
||||
@@ -201,8 +201,9 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
// couldn't find allocation for reuse - create new
|
||||
MemoryManager::OsHandleData osHandleData{bufferInfo.globalShareHandle};
|
||||
graphicsAllocation =
|
||||
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(bufferInfo.globalShareHandle, properties, false, false, false, nullptr);
|
||||
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(osHandleData, properties, false, false, false, nullptr);
|
||||
}
|
||||
|
||||
if (!graphicsAllocation) {
|
||||
|
||||
@@ -145,7 +145,8 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
|
||||
&imgInfo,
|
||||
AllocationType::sharedImage,
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false, false, false, nullptr);
|
||||
MemoryManager::ExtendedOsHandleData osHandleData{texInfo.globalShareHandle};
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, allocProperties, false, false, false, nullptr);
|
||||
|
||||
if (alloc == nullptr) {
|
||||
errorCode.set(CL_INVALID_GL_OBJECT);
|
||||
|
||||
@@ -153,8 +153,9 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
// couldn't find allocation for reuse - create new
|
||||
MemoryManager::OsHandleData osHandleData{bufferInfo.globalShareHandle};
|
||||
graphicsAllocation =
|
||||
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(bufferInfo.globalShareHandle, properties, true, false, true, nullptr);
|
||||
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(osHandleData, properties, true, false, true, nullptr);
|
||||
}
|
||||
|
||||
if (!graphicsAllocation) {
|
||||
|
||||
@@ -59,7 +59,8 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
|
||||
AllocationType::sharedImage,
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false, false, true, nullptr);
|
||||
MemoryManager::ExtendedOsHandleData osHandleData{texInfo.globalShareHandle};
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, allocProperties, false, false, true, nullptr);
|
||||
|
||||
if (alloc == nullptr) {
|
||||
errorCode.set(CL_INVALID_GL_OBJECT);
|
||||
@@ -128,7 +129,8 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
|
||||
GraphicsAllocation *mcsAlloc = nullptr;
|
||||
if (texInfo.globalShareHandleMCS) {
|
||||
AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), 0, AllocationType::mcs, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
|
||||
mcsAlloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandleMCS, allocProperties, false, false, true, nullptr);
|
||||
MemoryManager::OsHandleData osHandleData{texInfo.globalShareHandleMCS};
|
||||
mcsAlloc = memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, allocProperties, false, false, true, nullptr);
|
||||
if (texInfo.pGmmResInfoMCS) {
|
||||
DEBUG_BREAK_IF(mcsAlloc->getDefaultGmm() != nullptr);
|
||||
mcsAlloc->setDefaultGmm(new Gmm(gmmHelper, texInfo.pGmmResInfoMCS));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -51,7 +51,8 @@ GraphicsAllocation *UnifiedSharing::createGraphicsAllocation(Context *context, U
|
||||
imgInfo,
|
||||
allocationType,
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
return memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(description.handle), properties, false, false, true, nullptr);
|
||||
MemoryManager::OsHandleData osHandleData{description.handle};
|
||||
return memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, properties, false, false, true, nullptr);
|
||||
}
|
||||
default:
|
||||
return nullptr;
|
||||
|
||||
@@ -208,7 +208,8 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
|
||||
&sharedSurfaceInfo.imgInfo, AllocationType::sharedImage,
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
|
||||
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedSurfaceInfo.sharedHandle, properties, false, false, true, nullptr);
|
||||
MemoryManager::OsHandleData osHandleData{sharedSurfaceInfo.sharedHandle};
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(osHandleData, properties, false, false, true, nullptr);
|
||||
|
||||
memoryManager->closeSharedHandle(alloc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user