Registers the Direct3D 11 resource
pD3DResource for access by CUDA.
If this call is successful, then the application will be able to map and unmap this resource until it is unregistered through cudaGraphicsUnregisterResource(). Also on success, this call will increase the internal reference count on
pD3DResource. This reference count will be decremented when this resource is unregistered through cudaGraphicsUnregisterResource().
This call is potentially high-overhead and should not be called every frame in interactive applications.
The type of
pD3DResource must be one of the following.
- ID3D11Buffer: may be accessed via a device pointer
- ID3D11Texture1D: individual subresources of the texture may be accessed via arrays
- ID3D11Texture2D: individual subresources of the texture may be accessed via arrays
- ID3D11Texture3D: individual subresources of the texture may be accessed via arrays
flags argument may be used to specify additional parameters at register time. The only valid value for this parameter is
Not all Direct3D resources of the above types may be used for interoperability with CUDA. The following are some limitations.
- The primary rendertarget may not be registered with CUDA.
- Resources allocated as shared may not be registered with CUDA.
- Textures which are not of a format which is 1, 2, or 4 channels of 8, 16, or 32-bit integer or floating-point data cannot be shared.
- Surfaces of depth or stencil formats cannot be shared.
If Direct3D interoperability is not initialized using cudaD3D11SetDirect3DDevice then cudaErrorInvalidDevice is returned. If
pD3DResource is of incorrect type or is already registered, then cudaErrorInvalidResourceHandle is returned. If
pD3DResource cannot be registered, then cudaErrorUnknown is returned.
|resource ||- Pointer to returned resource handle |
|pD3DResource ||- Direct3D resource to register |
|flags ||- Parameters for resource registration|
- cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidValue, cudaErrorInvalidResourceHandle, cudaErrorUnknown
- Note that this function may also return error codes from previous, asynchronous launches.
- See also:
- cudaD3D11SetDirect3DDevice cudaGraphicsUnregisterResource, cudaGraphicsMapResources, cudaGraphicsSubResourceGetMappedArray, cudaGraphicsResourceGetMappedPointer