# C1.Util.DX.Direct3D11.DeviceContext.MapSubresource

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*">MapSubresource Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Texture1D_System_Int32_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_C1_Util_DX_DataStream__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Texture1D,System.Int32,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,C1.Util.DX.DataStream@)">MapSubresource(Texture1D, int, int, MapMode, MapFlags, out DataStream)</h4>
<div class="markdown level1 summary"><p>Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Texture1D resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out DataStream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resource As Texture1D, mipSlice As Integer, arraySlice As Integer, mode As MapMode, flags As MapFlags, ByRef stream As DataStream) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Texture1D.html">Texture1D</a></td>
      <td><span class="parametername">resource</span></td>
      <td><p>The resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mipSlice</span></td>
      <td><p>The mip slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">arraySlice</span></td>
      <td><p>The array slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>The mode.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>The flags.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The output stream containing the pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The locked <a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Texture2D_System_Int32_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_C1_Util_DX_DataStream__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Texture2D,System.Int32,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,C1.Util.DX.DataStream@)">MapSubresource(Texture2D, int, int, MapMode, MapFlags, out DataStream)</h4>
<div class="markdown level1 summary"><p>Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Texture2D resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out DataStream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resource As Texture2D, mipSlice As Integer, arraySlice As Integer, mode As MapMode, flags As MapFlags, ByRef stream As DataStream) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Texture2D.html">Texture2D</a></td>
      <td><span class="parametername">resource</span></td>
      <td><p>The resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mipSlice</span></td>
      <td><p>The mip slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">arraySlice</span></td>
      <td><p>The array slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>The mode.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>The flags.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The output stream containing the pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The locked <a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Texture3D_System_Int32_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_C1_Util_DX_DataStream__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Texture3D,System.Int32,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,C1.Util.DX.DataStream@)">MapSubresource(Texture3D, int, int, MapMode, MapFlags, out DataStream)</h4>
<div class="markdown level1 summary"><p>Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Texture3D resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out DataStream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resource As Texture3D, mipSlice As Integer, arraySlice As Integer, mode As MapMode, flags As MapFlags, ByRef stream As DataStream) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Texture3D.html">Texture3D</a></td>
      <td><span class="parametername">resource</span></td>
      <td><p>The resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mipSlice</span></td>
      <td><p>The mip slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">arraySlice</span></td>
      <td><p>The array slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>The mode.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>The flags.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The output stream containing the pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The locked <a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Buffer_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_C1_Util_DX_DataStream__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Buffer,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,C1.Util.DX.DataStream@)">MapSubresource(Buffer, MapMode, MapFlags, out DataStream)</h4>
<div class="markdown level1 summary"><p>Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Buffer resource, MapMode mode, MapFlags flags, out DataStream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resource As Buffer, mode As MapMode, flags As MapFlags, ByRef stream As DataStream) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Buffer.html">Buffer</a></td>
      <td><span class="parametername">resource</span></td>
      <td><p>The resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>The mode.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>The flags.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The output stream containing the pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The locked <a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Resource_System_Int32_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_System_Int32__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Resource,System.Int32,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,System.Int32@)">MapSubresource(Resource, int, int, MapMode, MapFlags, out int)</h4>
<div class="markdown level1 summary"><p>Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Resource resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out int mipSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resource As Resource, mipSlice As Integer, arraySlice As Integer, mode As MapMode, flags As MapFlags, ByRef mipSize As Integer) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Resource.html">Resource</a></td>
      <td><span class="parametername">resource</span></td>
      <td><p>The resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mipSlice</span></td>
      <td><p>The mip slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">arraySlice</span></td>
      <td><p>The array slice.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>The mode.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>The flags.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mipSize</span></td>
      <td><p>Size of the selected miplevel.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The locked <a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Resource_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_C1_Util_DX_DataStream__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Resource,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,C1.Util.DX.DataStream@)">MapSubresource(Resource, int, MapMode, MapFlags, out DataStream)</h4>
<div class="markdown level1 summary"><p>Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Resource resource, int subresource, MapMode mode, MapFlags flags, out DataStream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resource As Resource, subresource As Integer, mode As MapMode, flags As MapFlags, ByRef stream As DataStream) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Resource.html">Resource</a></td>
      <td><span class="parametername">resource</span></td>
      <td><p>The resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">subresource</span></td>
      <td><p>The subresource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>The mode.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>The flags.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The output stream containing the pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The locked <a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Resource_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Resource,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags)">MapSubresource(Resource, int, MapMode, MapFlags)</h4>
<div class="markdown level1 summary"><p>Gets a reference to the data contained in a subresource, and denies the GPU access to that subresource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataBox MapSubresource(Resource resourceRef, int subresource, MapMode mapType, MapFlags mapFlags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resourceRef As Resource, subresource As Integer, mapType As MapMode, mapFlags As MapFlags) As DataBox</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Resource.html">Resource</a></td>
      <td><span class="parametername">resourceRef</span></td>
      <td><p>A reference to a <strong><a class="xref" href="C1.Util.DX.Direct3D11.Resource.html">Resource</a></strong> interface.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">subresource</span></td>
      <td><p>Index number of the subresource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mapType</span></td>
      <td><p>Specifies the CPU's read and write permissions for a resource. For possible values, see <strong><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></strong>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">mapFlags</span></td>
      <td><p><strong>Flag</strong> that specifies what the CPU should do when the GPU is busy. This flag is optional.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><p>The mapped subresource (see <strong><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></strong>). If <a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html#C1_Util_DX_Direct3D11_MapFlags_DoNotWait">DoNotWait</a> is used and the resource is still being used by the GPU, this method return an empty DataBox whose property <a class="xref" href="C1.Util.DX.DataBox.IsEmpty.html#C1_Util_DX_DataBox_IsEmpty">IsEmpty</a> returns <code>true</code>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource*"></a>
<h4 id="C1_Util_DX_Direct3D11_DeviceContext_MapSubresource_C1_Util_DX_Direct3D11_Resource_System_Int32_C1_Util_DX_Direct3D11_MapMode_C1_Util_DX_Direct3D11_MapFlags_C1_Util_DX_DataBox__" data-uid="C1.Util.DX.Direct3D11.DeviceContext.MapSubresource(C1.Util.DX.Direct3D11.Resource,System.Int32,C1.Util.DX.Direct3D11.MapMode,C1.Util.DX.Direct3D11.MapFlags,C1.Util.DX.DataBox@)">MapSubresource(Resource, int, MapMode, MapFlags, out DataBox)</h4>
<div class="markdown level1 summary"><p>HRESULT ID3D11DeviceContext::Map([In] ID3D11Resource* pResource,[In] unsigned int Subresource,[In] D3D11_MAP MapType,[In] D3D11_MAP_FLAG MapFlags,[Out] D3D11_MAPPED_SUBRESOURCE* pMappedResource)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public HResult MapSubresource(Resource resourceRef, int subresource, MapMode mapType, MapFlags mapFlags, out DataBox mappedResourceRef)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapSubresource(resourceRef As Resource, subresource As Integer, mapType As MapMode, mapFlags As MapFlags, ByRef mappedResourceRef As DataBox) As HResult</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.Resource.html">Resource</a></td>
      <td><span class="parametername">resourceRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">subresource</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapMode.html">MapMode</a></td>
      <td><span class="parametername">mapType</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.MapFlags.html">MapFlags</a></td>
      <td><span class="parametername">mapFlags</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataBox.html">DataBox</a></td>
      <td><span class="parametername">mappedResourceRef</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.HResult.html">HResult</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
