D3D11_SUBRESOURCE_DATA Structure (d3d11.h)

The D3D11_SUBRESOURCE_DATA structure describes the data content of a subresource.

Syntax


typedef struct D3D11_SUBRESOURCE_DATA {
  const void *pSysMem;
  UINT        SysMemPitch;
  UINT        SysMemSlicePitch;
} D3D11_SUBRESOURCE_DATA;
                

Members

Member Description
pSysMem Pointer to the data.

The pointer can be NULL if you want to create an uninitialized resource. This is useful for resources that will be filled later by the GPU (e.g., vertex buffers, index buffers, or constant buffers).

SysMemPitch The pitch (the number of bytes between the beginning of one row and the beginning of the next row) of the data.

For a 1D texture, this is the number of bytes per row. For a 2D texture, this is the number of bytes per row. For a 3D texture, this is the number of bytes per row.

If you are creating a typical buffer or a 1D texture, set this member to 0.

SysMemSlicePitch The slice pitch (the number of bytes between the beginning of one slice and the beginning of the next slice) of the data.

For a 1D texture or a 2D texture, set this member to 0.

For a 3D texture, this is the number of bytes per slice.

Remarks

This structure is a member of D3D11_BUFFER_DESC, D3D11_TEXTURE1D_DESC, D3D11_TEXTURE2D_DESC, and D3D11_TEXTURE3D_DESC. These structures are used to create resources.

When you create a resource, you can provide initial data by setting the members of this structure. If you provide data, the resource must be in system memory (e.g., a vertex buffer or index buffer) or can be a texture that is filled by the CPU. If you are creating a resource that will be filled by the GPU, you can set pSysMem to NULL.

Note

For a 1D texture, SysMemPitch is the number of bytes per row. For a 2D texture, SysMemPitch is the number of bytes per row. For a 3D texture, SysMemPitch is the number of bytes per row.

Note

For a 1D texture, SysMemSlicePitch is 0. For a 2D texture, SysMemSlicePitch is 0. For a 3D texture, SysMemSlicePitch is the number of bytes per slice.

Requirements

Header d3d11.h