12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.10 Direct3D 9 Interoperability 57Parameters:count - Number of resources to map for <strong>CUDA</strong>ppResources - Resources to map for <strong>CUDA</strong>Returns:Note:See also:cudaSuccess, cudaErrorInvalidResourceHandle, cudaErrorUnknownNote that this function may also return error codes from previous, asynchronous launches.cudaD3D9GetDevice, cudaD3D9SetDirect3DDevice, cudaD3D9GetDirect3DDevice, cudaD3D9RegisterResource,cudaD3D9UnregisterResource, cudaD3D9UnmapResources,cudaD3D9ResourceGetSurfaceDimensions, cudaD3D9ResourceSetMapFlags, cudaD3D9ResourceGetMappedArray,cudaD3D9ResourceGetMappedPointer, cudaD3D9ResourceGetMappedSize,cudaD3D9ResourceGetMappedPitch3.10.3.4 cudaError_t cudaD3D9RegisterResource (IDirect3DResource9 ∗ pResource, unsigned int flags)Registers the Direct3D resource pResource for access by <strong>CUDA</strong>.If this call is successful, then the application will be able to map and unmap this resource until it is unregistered throughcudaD3D9UnregisterResource(). 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 cudaD3D9UnregisterResource().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.• IDirect3DVertexBuffer9: No notes.• IDirect3DIndexBuffer9: No notes.• IDirect3DSurface9: Only stand-alone objects of type IDirect3DSurface9 may be explicitly shared. In particular,individual mipmap levels and faces of cube maps may not be registered directly. To access individual surfacesassociated with a texture, one must register the base texture object.• IDirect3DBaseTexture9: When a texture is registered, all surfaces associated with all mipmap levels of all facesof the texture will be accessible to <strong>CUDA</strong>.The flags argument specifies the mechanism through which <strong>CUDA</strong> will access the Direct3D resource. The followingvalue is allowed:• cudaD3D9RegisterFlagsNone: Specifies that <strong>CUDA</strong> will access this resource through avoid∗. The pointer, size, and pitch for each subresource of this resource may be queriedthrough cudaD3D9ResourceGetMappedPointer(), cudaD3D9ResourceGetMappedSize(), and cudaD3D9ResourceGetMappedPitch()respectively. This option is valid for all resource types.Not all Direct3D resources of the above types may be used for interoperability with <strong>CUDA</strong>. The following are somelimitations:• The primary rendertarget may not be registered with <strong>CUDA</strong>.Generated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!