title: Programmatically creating directx 11 textures, pros and cons of the three different methods
body: <p>The <a href="http://msdn.microsoft.com/en-us/library/ff476905%28v=vs.85%29.aspx">msdn documentation</a> explains that in directx 11 there are multiple ways to fill a directx 11 texture programmatically:</p>
  
  <p>(1) Create the texture with default usage texture and initialize it with data from memory</p>
  
  <p>(2) Create the texture with dynamic usage, use DeviceContext Map to get a pointer to texture memory, write to it, then use Unmap to indicate you are done (at which point I guess it is copied to the gpu)</p>
  
  <p>(3) Create the texture with staging usage and follow same steps as for dynamic texture, but follow that with a call to ID3D11DeviceContext.CopyResource to use this staging texture to in turn fill a (non immutable) default or dynamic texture.</p>
  
  <p>However the documentation doesn't explain pros and cons of each method at all, and I am still quite new to directx, so it is not at all clear to me. </p>
  
  <p>What are the pros and cons of each of these ways of creating a texture programmatically in directx 11?</p>
  
  <p><strong>Side note:</strong> I have read that in the context of staging textures, <em>reading</em> back from the gpu isn't buffered so you have to do your own double buffering. But I don't know whether this was accurate and whether it applies to writing using staging textures (or even really what it means).</p>
  
  <p><strong>Second side note:</strong> The Map method documentation says it gets a pointer to data in a subresource and denies the GPU access to that subresource. When the GPU wants to access a texture whose underlying data has been called by Map, what does it do? Stall? (I ask because this sounds like part of the pros and cons I inquired about)</p>