D3D11_MAPPED_SUBRESOURCE structure (d3d11.h)

Provides access to subresource data.

Syntax

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

Members

pData

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:

RowPitch

Type: UINT

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

DepthPitch

Type: UINT

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

Remarks

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.
 

Requirements

Requirement Value
Header d3d11.h

See also

Resource Structures