ID3D12Resource::GetGPUVirtualAddress method

This method returns the GPU virtual address of a buffer resource.

Syntax

D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress(

);

Parameters

This method has no parameters.

Return Value

Type: D3D12_GPU_VIRTUAL_ADDRESS

This method returns the GPU virtual address. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd synonym of UINT64.

Remarks

This method is only useful for buffer resources, it will return zero for all texture resources.

For more information on the use of GPU virtual addresses, refer to Indirect Drawing.

Examples

The D3D1211on12 sample uses ID3D12Resource::GetGPUVirtualAddress as follows:

// Initialize the vertex buffer view.
m_vertexBufferView.BufferLocation = m_vertexBuffer->GetGPUVirtualAddress();
m_vertexBufferView.StrideInBytes = sizeof(Vertex);
m_vertexBufferView.SizeInBytes = vertexBufferSize;

Refer to the Example Code in the D3D12 Reference.

Requirements

   
Target Platform Windows
Header d3d12.h
Library D3d12.lib
DLL D3d12.dll

See Also

ID3D12Resource