ID3D12Resource::GetGPUVirtualAddress method (d3d12.h)
This method returns the GPU virtual address of a buffer resource.
C++
D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress();
Type: D3D12_GPU_VIRTUAL_ADDRESS
This method returns the GPU virtual address. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd synonym of UINT64.
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.
The D3D1211on12 sample uses ID3D12Resource::GetGPUVirtualAddress as follows:
C++
// 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.
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d12.h |
Library | D3d12.lib |
DLL | D3d12.dll |