OpenCL™规范 5.5.2.2. NT句柄类型

5.5.2.2. NT Handle Types
5.5.2.2. NT句柄类型

The cl_khr_external_memory_dx extension extends cl_external_memory_handle_type_khr to support the following new types of handles, and adds as a property that may be specified when creating a buffer or an image memory object from an external handle:

​cl_khr_external_memory_dx扩展 扩展了cl_external_memory_handle_type_khr以支持以下新类型的句柄,并添加为从外部句柄创建缓冲区或图像内存对象时可能指定的属性:

  • CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KHR specifies an NT handle returned by IDXGIResource1::CreateSharedHandle referring to a Direct3D 10 or 11 texture resource. It owns a reference to the memory used by the Direct3D resource.

  • CL_EXTERNAL_MEMORY_HANDLE_D3D11_EXTURE_KHR指定IDXGIResource1::CreateSharedHandle返回的NT句柄,该句柄引用Direct3D 10或11纹理资源。它拥有对Direct3D资源使用的内存的引用。

  • CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KMT_KHR specifies a global share handle returned by IDXGIResource::GetSharedHandle referring to a Direct3D 10 or 11 texture resource. It does not own a reference to the underlying Direct3D resource, and will therefore become invalid when all memory objects and Direct3D resources associated with it are destroyed.

  • CL_EXTERNAL_MEMORY_HANDLE_D3D11_EXTURE_KMT_KHR指定由引用Direct3D 10或11纹理资源的IDXGIResource::GetSharedHandle返回的全局共享句柄。它不拥有对基础Direct3D资源的引用,因此当所有内存对象和与其关联的Direct3D资源都被销毁时,它将变得无效。

  • CL_EXTERNAL_MEMORY_HANDLE_D3D12_HEAP_KHR specifies an NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 heap resource. It owns a reference to the resources used by the Direct3D heap.

  • CL_EXTERNAL_MEMORY_HANDLE_D3D12_HEAP_KHR指定由引用Direct3D 12堆资源的ID3D12Device::CreateSharedHandle返回的NT句柄。它拥有对Direct3D堆使用的资源的引用。

  • CL_EXTERNAL_MEMORY_HANDLE_D3D12_RESOURCE_KHR specifies an NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 committed resource. It owns a reference to the memory used by the Direct3D resource.

  • CL_EXTERNAL_MEMORY_HANDLE_D3D12_RESOURCE_KHR指定由引用Direct3D 12提交资源的ID3D12Device::CreateSharedHandle返回的NT句柄。它拥有对Direct3D资源使用的内存的引用。

The cl_khr_external_memory_win32 extension extends cl_external_memory_handle_type_khr to support the following new types of handles, and adds as a property that may be specified when creating a buffer or an image memory object from an external handle:

​cl_khr_external_memory_win32扩展 扩展cl_external_memory_handle_type_khr以支持以下新类型的句柄,并添加为在从外部句柄创建缓冲区或图像内存对象时可能指定的属性:

  • CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR specifies an NT handle that has only limited valid usage outside of OpenCL and other compatible APIs. It must be compatible with the functions DuplicateHandleCloseHandleCompareObjectHandlesGetHandleInformation, and SetHandleInformation. It owns a reference to the underlying memory resource represented by its memory object.

  • CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR指定一个NT句柄,该句柄在OpenCL和其他兼容API之外的有效使用范围有限。它必须与函数DuplicateHandle、CloseHandle、CompareObjectHandles、GetHandleInformation和SetHandleInformation兼容。它拥有对由其内存对象表示的底层内存资源的引用。

  • CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR specifies a global share handle that has only limited valid usage outside of OpenCL and other compatible APIs. It is not compatible with any native APIs. It does not own a reference to the underlying memory resource represented by its memory object, and will therefore become invalid when all memory objects associated with it are destroyed.

  • CL_EXTERNAL_MEMORY_HANDLE_OPACQUE_WIN32_KMT_KHR指定一个全局共享句柄,该句柄在OpenCL和其他兼容API之外仅具有有限的有效使用。它与任何本机API都不兼容。它不拥有对由其内存对象表示的底层内存资源的引用,因此,当与它相关联的所有内存对象都被销毁时,它将变得无效。

For these extensions, importing memory object payloads from Windows handles does not transfer ownership of the handle to the OpenCL implementation. For handle types defined as NT handles, the application must release handle ownership using the CloseHandle system call when the handle is no longer needed. For handle types defined as NT handles, the imported memory object holds a reference to its payload.

对于这些扩展,从Windows句柄导入内存对象有效负载不会将句柄的所有权转移到OpenCL实现。对于定义为NT句柄的句柄类型,当不再需要句柄时,应用程序必须使用CloseHandle系统调用释放句柄所有权。对于定义为NT句柄的句柄类型,导入的内存对象包含对其有效负载的引用。

Note: Non-NT handle import operations do not add a reference to their associated payload. If the original object owning the payload is destroyed, all resources and handles sharing that payload will become invalid.

注意:非NT句柄导入操作不会添加对其相关负载的引用。如果拥有有效负载的原始对象被销毁,那么共享该有效负载的所有资源和句柄都将无效。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值