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 59Returns:Note:See also:cudaSuccess, cudaErrorInvalidResourceHandle, cudaErrorUnknownNote that this function may also return error codes from previous, asynchronous launches.cudaD3D9GetDevice, cudaD3D9SetDirect3DDevice, cudaD3D9GetDirect3DDevice, cudaD3D9RegisterResource,cudaD3D9UnregisterResource, cudaD3D9MapResources, cudaD3D9UnmapResources,cudaD3D9ResourceGetSurfaceDimensions, cudaD3D9ResourceSetMapFlags, cudaD3D9ResourceGetMappedPointer,cudaD3D9ResourceGetMappedSize, cudaD3D9ResourceGetMappedPitch3.10.3.6 cudaError_t cudaD3D9ResourceGetMappedPitch (size_t ∗ pPitch, size_t ∗ pPitchSlice,IDirect3DResource9 ∗ pResource, unsigned int face, unsigned int level)Returns in ∗pPitch and ∗pPitchSlice the pitch and Z-slice pitch of the subresource of the mapped Direct3Dresource pResource, which corresponds to face and level. The values set in pPitch and pPitchSlice maychange 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) ∗ xFor 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) ∗ xBoth 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 registeredfor use with <strong>CUDA</strong>, then cudaErrorInvalidResourceHandle is returned. If pResource was not registered with usageflags cudaD3D9RegisterFlagsNone, then cudaErrorInvalidResourceHandle is returned. If pResource is not mappedfor access by <strong>CUDA</strong> then cudaErrorUnknown is returned.For usage requirements of face and level parameters, see cudaD3D9ResourceGetMappedPointer().Parameters:pPitch - Returned pitch of subresourcepPitchSlice - Returned Z-slice pitch of subresourcepResource - Mapped resource to accessface - Face of resource to accesslevel - Level of resource to accessReturns:Note:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidResourceHandle, cudaErrorUnknownNote that this function may also return error codes from previous, asynchronous launches.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!