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.29 Direct3D 10 Interoperability 1893.29.2.5 CUresult cuD3D10ResourceGetMappedArray (CUarray ∗ pArray, ID3D10Resource ∗ pResource,U32 SubResource)Returns in ∗pArray an array through which the subresource of the mapped Direct3D resource pResource, whichcorresponds to SubResource may be accessed. The value set in pArray may change every time that pResourceis mapped.If pResource is not registered, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned. If pResource was notregistered with usage flags CU_D3D10_REGISTER_FLAGS_ARRAY, then <strong>CUDA</strong>_ERROR_INVALID_HANDLEis returned. If pResource is not mapped, then <strong>CUDA</strong>_ERROR_NOT_MAPPED is returned.For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().Parameters:pArray - Returned array corresponding to subresourcepResource - Mapped resource to accessSubResource - Subresource of pResource 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.cuD3D10CtxCreate, cuD3D10GetDevice, cuD3D10MapResources, cuD3D10RegisterResource,cuD3D10ResourceGetMappedPitch, cuD3D10ResourceGetMappedPointer, cuD3D10ResourceGetMappedSize,cuD3D10ResourceGetSurfaceDimensions, cuD3D10ResourceSetMapFlags, cuD3D10UnmapResources,cuD3D10UnregisterResource3.29.2.6 CUresult cuD3D10ResourceGetMappedPitch (unsigned int ∗ pPitch, unsigned int ∗ pPitchSlice,ID3D10Resource ∗ pResource, U32 SubResource)Returns in ∗pPitch and ∗pPitchSlice the pitch and Z-slice pitch of the subresource of the mapped Direct3Dresource pResource, which corresponds to SubResource. 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 IDirect3DBaseTexture10 or one of its sub-types or if pResource has not been registeredfor use with <strong>CUDA</strong>, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned. If pResource was not registeredwith usage flags CU_D3D10_REGISTER_FLAGS_NONE, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned.If pResource is not mapped for access by <strong>CUDA</strong>, then <strong>CUDA</strong>_ERROR_NOT_MAPPED is returned.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!