D3D10_SUBRESOURCE_DATA structure

Specifies data for initializing a subresource.

Syntax


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

Members

pSysMem

Type: const void*

Pointer to the initialization data.

SysMemPitch

Type: UINT

The distance (in bytes) from the beginning of one line of a texture to the next line. System-memory pitch is used only for 2D and 3D texture data as it is has no meaning for the other resource types.

SysMemSlicePitch

Type: UINT

The distance (in bytes) from the beginning of one depth level to the next. System-memory-slice pitch is only used for 3D texture data as it has no meaning for the other resource types.

Remarks

This structure is used in calls to create buffers (ID3D10Device::CreateBuffer) and textures (ID3D10Device::CreateTexture1D, ID3D10Device::CreateTexture2D, and ID3D10Device::CreateTexture3D). If the resource being created does not require a system-memory pitch or a system-memory-pitch slice, then you are free to use those members to pass size information which may help you when debugging a problem creating a resource.

Note that an application should not rely on SysMemPitch being exactly equal to the number of texels in a line times the size of a texel. In some cases SysMemPitch will include padding to skip past additional data in a line. This could be padding for alignment or the texture could be a subsection of a larger texture. For example the D3D10_SUBRESOURCE_DATA structure could represent a 32 by 32 subsection of a 128 by 128 texture. The value for SysMemSlicePitch will reflect any padding included in SysMemPitch.

Requirements

Header

D3D10.h

See also

Resource Structures

 

 

Show: