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.28 Direct3D 9 Interoperability 179face - Face of resource to accesslevel - Level of resource to accessReturns:Note:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE, <strong>CUDA</strong>_ERROR_INVALID_HANDLE,<strong>CUDA</strong>_ERROR_NOT_MAPPEDSee also:Note that this function may also return error codes from previous, asynchronous launches.cuD3D9CtxCreate, cuD3D9GetDevice, cuD3D9GetDirect3DDevice, cuD3D9MapResources,cuD3D9RegisterResource, cuD3D9ResourceGetMappedPitch, cuD3D9ResourceGetMappedPointer,cuD3D9ResourceGetMappedSize, cuD3D9ResourceGetSurfaceDimensions, cuD3D9ResourceSetMapFlags,cuD3D9UnmapResources, cuD3D9UnregisterResource3.28.2.7 CUresult cuD3D9ResourceGetMappedPitch (unsigned int ∗ pPitch, unsigned int ∗ pPitchSlice,IDirect3DResource9 ∗ pResource, U32 face, U32 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 registeredwith usage flags CU_D3D9_REGISTER_FLAGS_NONE, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned. IfpResource is not mapped for access by <strong>CUDA</strong> then <strong>CUDA</strong>_ERROR_NOT_MAPPED is returned.For usage requirements of face and level parameters, see cuD3D9ResourceGetMappedPointer().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:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE, <strong>CUDA</strong>_ERROR_INVALID_HANDLE,<strong>CUDA</strong>_ERROR_NOT_MAPPEDGenerated 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!