Skip to content

Latest commit

 

History

History
120 lines (92 loc) · 4.52 KB

nf-d3d10-id3d10buffer-map.md

File metadata and controls

120 lines (92 loc) · 4.52 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:d3d10.ID3D10Buffer.Map
ID3D10Buffer::Map (d3d10.h)
Get a pointer to the data contained in the resource and deny GPU access to the resource.
7d41a2a2-1ba6-cc42-c30b-821d5734b5c3
ID3D10Buffer interface [Direct3D 10]
Map method
ID3D10Buffer.Map
ID3D10Buffer::Map
Map
Map method [Direct3D 10]
Map method [Direct3D 10]
ID3D10Buffer interface
d3d10/ID3D10Buffer::Map
direct3d10.id3d10buffer_map
direct3d10\id3d10buffer_map.htm
direct3d10
VS|directx_sdk|~\id3d10buffer_map.htm
12/05/2018
7d41a2a2-1ba6-cc42-c30b-821d5734b5c3, ID3D10Buffer interface [Direct3D 10],Map method, ID3D10Buffer.Map, ID3D10Buffer::Map, Map, Map method [Direct3D 10], Map method [Direct3D 10],ID3D10Buffer interface, d3d10/ID3D10Buffer::Map, direct3d10.id3d10buffer_map
d3d10.h
Windows
D3D10.lib
Windows
19H1
ID3D10Buffer::Map
d3d10/ID3D10Buffer::Map
c++
APIRef
kbSyntax
COM
D3D10.lib
D3D10.dll
ID3D10Buffer.Map

ID3D10Buffer::Map

-description

Get a pointer to the data contained in the resource and deny GPU access to the resource.

-parameters

-param MapType [in]

Type: D3D10_MAP

Flag that specifies the CPU's permissions for the reading and writing of a resource. For possible values, see D3D10_MAP.

-param MapFlags [in]

Type: UINT

Flag that specifies what the CPU should do when the GPU is busy (see D3D10_MAP_FLAG). This flag is optional.

-param ppData [out]

Type: void**

Pointer to the buffer resource data.

-returns

Type: HRESULT

If this function succeeds, it returns S_OK. The following list contains some of the reasons that Map can fail:

  • If MapFlags specifies D3D10_MAP_FLAG_DO_NOT_WAIT and the GPU is not yet finished with the resource, ID3D10Buffer::Map returns DXGI_ERROR_WAS_STILL_DRAWING.
  • ID3D10Buffer::Map returns DXGI_ERROR_DEVICE_REMOVED if MapType includes any flags that permit reading and the hardware device (that is, the video card) has been removed.
For more information about the preceding return values, see DXGI_ERROR.

-remarks

For the CPU to write the contents of a resource, the resource must be created with the dynamic usage flag, D3D10_USAGE_DYNAMIC. To both read and write those contents, the resource must be created with the staging usage flag, D3D10_USAGE_STAGING. (For more information about these flags, see D3D10_USAGE.) ID3D10Buffer::Map will retrieve a pointer to the resource data. For a discussion on how to access resources efficiently, see Copying and Accessing Resource Data (Direct3D 10).

Call ID3D10Buffer::Unmap to signify that the application has finished accessing the resource.

ID3D10Buffer::Map has a few other restrictions. For example:

  • The same buffer cannot be mapped multiple times; in other words, do not call ID3D10Buffer::Map on a buffer that is already mapped.
  • Any buffer that is bound to the pipeline must be unmapped before any rendering operation (that is, ID3D10Device::Draw) can be executed.
Differences between Direct3D 9 and Direct3D 10:

ID3D10Buffer::Map in Direct3D 10 is analogous to resource Lock in Direct3D 9.

-see-also

ID3D10Buffer Interface