Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash when axes are rendered but m_bShowCubes is toggled off #1829

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions samples/hellovr_dx12/hellovr_dx12_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,16 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye )
// draw the controller axis lines
m_pCommandList->SetPipelineState( m_pAxesPipelineState.Get() );

// Select the CBV (left or right eye)
CD3DX12_GPU_DESCRIPTOR_HANDLE cbvHandle(m_pCBVSRVHeap->GetGPUDescriptorHandleForHeapStart());
cbvHandle.Offset(nEye, m_nCBVSRVDescriptorSize);
m_pCommandList->SetGraphicsRootDescriptorTable(0, cbvHandle);

// SRV is just after the left eye
CD3DX12_GPU_DESCRIPTOR_HANDLE srvHandle(m_pCBVSRVHeap->GetGPUDescriptorHandleForHeapStart());
srvHandle.Offset(SRV_TEXTURE_MAP, m_nCBVSRVDescriptorSize);
m_pCommandList->SetGraphicsRootDescriptorTable(1, srvHandle);

m_pCommandList->IASetPrimitiveTopology( D3D_PRIMITIVE_TOPOLOGY_LINELIST );
m_pCommandList->IASetVertexBuffers( 0, 1, &m_controllerAxisVertexBufferView );
m_pCommandList->DrawInstanced( m_uiControllerVertcount, 1, 0, 0 );
Expand Down