Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Provides access to subresource data.


typedef struct D3D11_MAPPED_SUBRESOURCE {
  void *pData;
  UINT RowPitch;
  UINT DepthPitch;



Type: void*

Pointer to the data. When ID3D11DeviceContext::Map provides the pointer, the runtime ensures that the pointer has a specific alignment, depending on the following feature levels:


Type: UINT

The row pitch, or width, or physical size (in bytes) of the data.


Type: UINT

The depth pitch, or width, or physical size (in bytes)of the data.


This structure is used in a call to ID3D11DeviceContext::Map.

The values in these members tell you how much data you can view:

  • pData points to row 0 and depth slice 0.
  • RowPitch contains the value that the runtime adds to pData to move from row to row, where each row contains multiple pixels.
  • DepthPitch contains the value that the runtime adds to pData to move from depth slice to depth slice, where each depth slice contains multiple rows.

When RowPitch and DepthPitch are not appropriate for the resource type, the runtime might set their values to 0. So, don't use these values for anything other than iterating over rows and depth. Here are some examples:

  • For Buffer and Texture1D, the runtime assigns values that aren't 0 to RowPitch and DepthPitch. For example, if a Buffer contains 8 bytes, the runtime assigns values to RowPitch and DepthPitch that are greater than or equal to 8.
  • For Texture2D, the runtime still assigns a value that isn't 0 to DepthPitch, assuming that the field isn't used.
Note   The runtime might assign values to RowPitch and DepthPitch that are larger than anticipated because there might be padding between rows and depth.




See also

Resource Structures



© 2018 Microsoft