<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>NVIDIA CUDA Library: cudaD3D9ResourceGetMappedPitch</title> <link href="customdoxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> </div> <div class="contents"> <div class="navpath"><a class="el" href="group__CUDART__D3D9__DEPRECATED.html">Direct3D 9 Interoperability [DEPRECATED]</a> </div> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <div class="navtab"> <table> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_g77fb48ace0d2da465b6f4bcc00ef750b.html#g77fb48ace0d2da465b6f4bcc00ef750b">cudaD3D9MapFlags</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_g59e2838c98639cdc5acdec99856c5aca.html#g59e2838c98639cdc5acdec99856c5aca">cudaD3D9MapResources</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_gcdebbc14eb83032da31bd75503cddfea.html#gcdebbc14eb83032da31bd75503cddfea">cudaD3D9RegisterFlags</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_ga8dabfab33631bc9d8a41f30bc26221c.html#ga8dabfab33631bc9d8a41f30bc26221c">cudaD3D9RegisterResource</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_g60d2dd299c651866dfd0a0480e752783.html#g60d2dd299c651866dfd0a0480e752783">cudaD3D9ResourceGetMappedArray</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__D3D9__DEPRECATED_g52d32c6779befee1742e88dc3036bd68.html#g52d32c6779befee1742e88dc3036bd68">cudaD3D9ResourceGetMappedPitch</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_g44923b51ce411b519c9a3f5a1674071a.html#g44923b51ce411b519c9a3f5a1674071a">cudaD3D9ResourceGetMappedPointer</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_gb592b874549ec1375a570fac7f5e9ab9.html#gb592b874549ec1375a570fac7f5e9ab9">cudaD3D9ResourceGetMappedSize</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_gb280fa315e4728a11f13e4691b19ef61.html#gb280fa315e4728a11f13e4691b19ef61">cudaD3D9ResourceGetSurfaceDimensions</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_gf0c339fe2a9d07ebc02c0469a6f8c296.html#gf0c339fe2a9d07ebc02c0469a6f8c296">cudaD3D9ResourceSetMapFlags</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_g50f637c33fa9ca33777735f769e7d9a6.html#g50f637c33fa9ca33777735f769e7d9a6">cudaD3D9UnmapResources</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9__DEPRECATED_gcca28bc00d63314d2032c36c0ca1fd4d.html#gcca28bc00d63314d2032c36c0ca1fd4d">cudaD3D9UnregisterResource</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="g52d32c6779befee1742e88dc3036bd68"></a><!-- doxytag: member="cuda_d3d9_interop.h::cudaD3D9ResourceGetMappedPitch" ref="g52d32c6779befee1742e88dc3036bd68" args="(size_t *pPitch, size_t *pPitchSlice, IDirect3DResource9 *pResource, unsigned int face, unsigned int level)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CUDART__TYPES_gf599e5b8b829ce7db0f5216928f6ecb6.html#gf599e5b8b829ce7db0f5216928f6ecb6">cudaError_t</a> cudaD3D9ResourceGetMappedPitch </td> <td>(</td> <td class="paramtype">size_t * </td> <td class="paramname"> <em>pPitch</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t * </td> <td class="paramname"> <em>pPitchSlice</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">IDirect3DResource9 * </td> <td class="paramname"> <em>pResource</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>face</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>level</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> <dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000018">Deprecated:</a></b></dt><dd>This function is deprecated as of CUDA 3.0.</dd></dl> Returns in <code>*pPitch</code> and <code>*pPitchSlice</code> the pitch and Z-slice pitch of the subresource of the mapped Direct3D resource <code>pResource</code>, which corresponds to <code>face</code> and <code>level</code>. The values set in <code>pPitch</code> and <code>pPitchSlice</code> may change every time that <code>pResource</code> is mapped.<p> The pitch and Z-slice pitch values may be used to compute the location of a sample on a surface as follows.<p> For a 2D surface, the byte offset of the sample at position <b>x</b>, <b>y</b> from the base pointer of the surface is:<p> <b>y</b> * <b>pitch</b> + (<b>bytes per pixel</b>) * <b>x</b> <p> For a 3D surface, the byte offset of the sample at position <b>x</b>, <b>y</b>, <b>z</b> from the base pointer of the surface is:<p> <b>z*</b> <b>slicePitch</b> + <b>y</b> * <b>pitch</b> + (<b>bytes per pixel</b>) * <b>x</b> <p> Both parameters <code>pPitch</code> and <code>pPitchSlice</code> are optional and may be set to NULL.<p> If <code>pResource</code> is not of type IDirect3DBaseTexture9 or one of its sub-types or if <code>pResource</code> has not been registered for use with CUDA, then <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273">cudaErrorInvalidResourceHandle</a> is returned. If <code>pResource</code> was not registered with usage flags <a class="el" href="group__CUDART__D3D9__DEPRECATED_gcdebbc14eb83032da31bd75503cddfea.html#ggcdebbc14eb83032da31bd75503cddfea10cd58f205c593368626b4ec54a54744">cudaD3D9RegisterFlagsNone</a>, then <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273">cudaErrorInvalidResourceHandle</a> is returned. If <code>pResource</code> is not mapped for access by CUDA then <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c">cudaErrorUnknown</a> is returned.<p> For usage requirements of <code>face</code> and <code>level</code> parameters, see <a class="el" href="group__CUDART__D3D9__DEPRECATED_g44923b51ce411b519c9a3f5a1674071a.html#g44923b51ce411b519c9a3f5a1674071a" title="Get a pointer through which to access a subresource of a Direct3D resource which...">cudaD3D9ResourceGetMappedPointer()</a>.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pPitch</em> </td><td>- Returned pitch of subresource </td></tr> <tr><td valign="top"></td><td valign="top"><em>pPitchSlice</em> </td><td>- Returned Z-slice pitch of subresource </td></tr> <tr><td valign="top"></td><td valign="top"><em>pResource</em> </td><td>- Mapped resource to access </td></tr> <tr><td valign="top"></td><td valign="top"><em>face</em> </td><td>- Face of resource to access </td></tr> <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>- Level of resource to access</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591">cudaSuccess</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273">cudaErrorInvalidResourceHandle</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c">cudaErrorUnknown</a> </dd></dl> <dl class="note" compact><dt><b>Note:</b></dt><dd>Note that this function may also return error codes from previous, asynchronous launches.</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__CUDART__INTEROP_ge7f893864a3d38a630e71a99f5a4e17f.html#ge7f893864a3d38a630e71a99f5a4e17f" title="Get an device pointer through which to access a mapped graphics resource.">cudaGraphicsResourceGetMappedPointer</a> </dd></dl> </div> </div><p> </td> </tr> </table> </div> <hr size="1"><address style="text-align: right;"><small> Generated by Doxygen for NVIDIA CUDA Library <a href="http://www.nvidia.com/cuda"><img src="nvidia_logo.jpg" alt="NVIDIA" align="middle" border="0" height="80"></a></small></address> </body> </html>