Direct3D 9 Interoperability [DEPRECATED]
- Provided by: nvidia-cuda-dev (Version: 7.5.18-0ubuntu1)
- Source: nvidia-cuda-toolkit
- Report a bug
CUresult cuD3D9MapResources (unsigned int count,
IDirect3DResource9 **ppResource)
Map Direct3D resources for access by CUDA. CUresult
cuD3D9RegisterResource (IDirect3DResource9 *pResource, unsigned int
Flags)
Register a Direct3D resource for access by CUDA. CUresult
cuD3D9ResourceGetMappedArray (CUarray *pArray,
IDirect3DResource9 *pResource, unsigned int Face, unsigned int Level)
Get an array through which to access a subresource of a Direct3D resource
which has been mapped for access by CUDA. CUresult
cuD3D9ResourceGetMappedPitch (size_t *pPitch, size_t *pPitchSlice,
IDirect3DResource9 *pResource, unsigned int Face, unsigned int Level)
Get the pitch of a subresource of a Direct3D resource which has been mapped
for access by CUDA. CUresult
cuD3D9ResourceGetMappedPointer (CUdeviceptr *pDevPtr,
IDirect3DResource9 *pResource, unsigned int Face, unsigned int Level)
Get the pointer through which to access a subresource of a Direct3D
resource which has been mapped for access by CUDA. CUresult
cuD3D9ResourceGetMappedSize (size_t *pSize, IDirect3DResource9
*pResource, unsigned int Face, unsigned int Level)
Get the size of a subresource of a Direct3D resource which has been mapped
for access by CUDA. CUresult
cuD3D9ResourceGetSurfaceDimensions (size_t *pWidth, size_t *pHeight,
size_t *pDepth, IDirect3DResource9 *pResource, unsigned int Face, unsigned
int Level)
Get the dimensions of a registered surface. CUresult
cuD3D9ResourceSetMapFlags (IDirect3DResource9 *pResource, unsigned
int Flags)
Set usage flags for mapping a Direct3D resource. CUresult
cuD3D9UnmapResources (unsigned int count, IDirect3DResource9
**ppResource)
Unmaps Direct3D resources. CUresult
cuD3D9UnregisterResource (IDirect3DResource9 *pResource)
Unregister a Direct3D resource.
\brief deprecated Direct3D 9 interoperability functions of the low-level CUDA driver API (cudaD3D9.h)
This section describes deprecated Direct3D 9 interoperability functionality.
Flags to map or unmap a resource
Flags to register a resource
Deprecated
Maps the count Direct3D resources in ppResource for access by CUDA.
The resources in ppResource may be accessed in CUDA kernels until they are unmapped. Direct3D should not access any resources while they are mapped by CUDA. If an application does so the results are undefined.
This function provides the synchronization guarantee that any Direct3D calls issued before cuD3D9MapResources() will complete before any CUDA kernels issued after cuD3D9MapResources() begin.
If any of ppResource have not been registered for use with CUDA or if ppResource contains any duplicate entries, then CUDA_ERROR_INVALID_HANDLE is returned. If any of ppResource are presently mapped for access by CUDA, then CUDA_ERROR_ALREADY_MAPPED is returned.
Parameters:
Returns:
Note:
See also:
Deprecated
Registers the Direct3D resource pResource 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 cuD3D9UnregisterResource(). Also on success, this call will increase the internal reference count on pResource. This reference count will be decremented when this resource is unregistered through cuD3D9UnregisterResource().
This call is potentially high-overhead and should not be called every frame in interactive applications.
The type of pResource must be one of the following.
The Flags argument specifies the mechanism through which CUDA will access the Direct3D resource. The following values are allowed.
Not all Direct3D resources of the above types may be used for interoperability with CUDA. The following are some limitations.
If Direct3D interoperability is not initialized on this context, then CUDA_ERROR_INVALID_CONTEXT is returned. If pResource is of incorrect type (e.g. is a non-stand-alone IDirect3DSurface9) or is already registered, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource cannot be registered then CUDA_ERROR_UNKNOWN is returned.
Parameters:
Returns:
Note:
See also:
Deprecated
Returns in *pArray an array through which the subresource of the mapped Direct3D resource pResource which corresponds to Face and Level may be accessed. The value set in pArray may change every time that pResource is mapped.
If pResource is not registered then CUDA_ERROR_INVALID_HANDLE is returned. If pResource was not registered with usage flags CU_D3D9_REGISTER_FLAGS_ARRAY then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped then CUDA_ERROR_NOT_MAPPED is returned.
For usage requirements of Face and Level parameters, see cuD3D9ResourceGetMappedPointer().
Parameters:
Returns:
Note:
See also:
Deprecated
Returns in *pPitch and *pPitchSlice the pitch and Z-slice pitch of the subresource of the mapped Direct3D resource pResource, which corresponds to Face and Level. The values set in pPitch and pPitchSlice may change every time that pResource is mapped.
The pitch and Z-slice pitch values may be used to compute the location of a sample on a surface as follows.
For a 2D surface, the byte offset of the sample at position x, y from the base pointer of the surface is:
y * pitch + (bytes per pixel) * x
For a 3D surface, the byte offset of the sample at position x, y, z from the base pointer of the surface is:
z* slicePitch + y * pitch + (bytes per pixel) * x
Both parameters pPitch and pPitchSlice are optional and may be set to NULL.
If pResource is not of type IDirect3DBaseTexture9 or one of its sub-types or if pResource has not been registered for use with CUDA, then cudaErrorInvalidResourceHandle is returned. If pResource was not registered with usage flags CU_D3D9_REGISTER_FLAGS_NONE, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped for access by CUDA then CUDA_ERROR_NOT_MAPPED is returned.
For usage requirements of Face and Level parameters, see cuD3D9ResourceGetMappedPointer().
Parameters:
Returns:
Note:
See also:
Deprecated
Returns in *pDevPtr the base pointer of the subresource of the mapped Direct3D resource pResource, which corresponds to Face and Level. The value set in pDevPtr may change every time that pResource is mapped.
If pResource is not registered, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource was not registered with usage flags CU_D3D9_REGISTER_FLAGS_NONE, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped, then CUDA_ERROR_NOT_MAPPED is returned.
If pResource is of type IDirect3DCubeTexture9, then Face must one of the values enumerated by type D3DCUBEMAP_FACES. For all other types Face must be 0. If Face is invalid, then CUDA_ERROR_INVALID_VALUE is returned.
If pResource is of type IDirect3DBaseTexture9, then Level must correspond to a valid mipmap level. At present only mipmap level 0 is supported. For all other types Level must be 0. If Level is invalid, then CUDA_ERROR_INVALID_VALUE is returned.
Parameters:
Returns:
Note:
See also:
Deprecated
Returns in *pSize the size of the subresource of the mapped Direct3D resource pResource, which corresponds to Face and Level. The value set in pSize may change every time that pResource is mapped.
If pResource has not been registered for use with CUDA, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource was not registered with usage flags CU_D3D9_REGISTER_FLAGS_NONE, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped for access by CUDA, then CUDA_ERROR_NOT_MAPPED is returned.
For usage requirements of Face and Level parameters, see cuD3D9ResourceGetMappedPointer.
Parameters:
Returns:
Note:
See also:
Deprecated
Returns in *pWidth, *pHeight, and *pDepth the dimensions of the subresource of the mapped Direct3D resource pResource, which corresponds to Face and Level.
Because anti-aliased surfaces may have multiple samples per pixel, it is possible that the dimensions of a resource will be an integer factor larger than the dimensions reported by the Direct3D runtime.
The parameters pWidth, pHeight, and pDepth are optional. For 2D surfaces, the value returned in *pDepth will be 0.
If pResource is not of type IDirect3DBaseTexture9 or IDirect3DSurface9 or if pResource has not been registered for use with CUDA, then CUDA_ERROR_INVALID_HANDLE is returned.
For usage requirements of Face and Level parameters, see cuD3D9ResourceGetMappedPointer().
Parameters:
Returns:
Note:
See also:
Deprecated
Set Flags for mapping the Direct3D resource pResource.
Changes to Flags will take effect the next time pResource is mapped. The Flags argument may be any of the following:
If pResource has not been registered for use with CUDA, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is presently mapped for access by CUDA, then CUDA_ERROR_ALREADY_MAPPED is returned.
Parameters:
Returns:
Note:
See also:
Deprecated
Unmaps the count Direct3D resources in ppResource.
This function provides the synchronization guarantee that any CUDA kernels issued before cuD3D9UnmapResources() will complete before any Direct3D calls issued after cuD3D9UnmapResources() begin.
If any of ppResource have not been registered for use with CUDA or if ppResource contains any duplicate entries, then CUDA_ERROR_INVALID_HANDLE is returned. If any of ppResource are not presently mapped for access by CUDA, then CUDA_ERROR_NOT_MAPPED is returned.
Parameters:
Returns:
Note:
See also:
Deprecated
Unregisters the Direct3D resource pResource so it is not accessible by CUDA unless registered again.
If pResource is not registered, then CUDA_ERROR_INVALID_HANDLE is returned.
Parameters:
Returns:
Note:
See also:
Generated automatically by Doxygen from the source code.