Created
September 3, 2016 11:39
-
-
Save yorung/728d933f716c31bdcc4ccdb15b9d250a to your computer and use it in GitHub Desktop.
[DX12] Set index buffer, forget D3D12_INDEX_BUFFER_VIEW.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SetIndexBuffer(ID3D12GraphicsCommandList* list, ID3D12Resource* indexBuffer) | |
{ | |
D3D12_RESOURCE_DESC desc = indexBuffer->GetDesc(); | |
D3D12_INDEX_BUFFER_VIEW indexBufferView = { indexBuffer->GetGPUVirtualAddress(), (UINT)desc.Width, AFIndexTypeToDevice }; | |
list->IASetIndexBuffer(&indexBufferView); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment