Hello, did you figure out what the issues were here, because now I’m experiencing the same problems, I cannot see any HLSL code, only D3DASM. I can set breakpoints and debug the D3DASM just fine, but I would like to debug HLSL code :\
My setup is this:
Windows 10 - 64-bit
Microsoft Visual Studio Professional 2015 - Version 14.0.25425.01 Update 3
NVIDIA Nsight Visual Studio Edition - 5.2.0.16268
GPU processor: GeForce GTX 760
Driver version: 373.06
In NVIDIA Nsight Option:
Force assembly debugging: False
Show disassembly if source does not exist: Ask
I have downloaded the directx samples from here: GitHub - walbourn/directx-sdk-samples: This repo contains Direct3D 11, XInput, and XAudio2 samples C++ samples from the legacy DirectX SDK updated to build using the Windows 10 SDK
And then built Direct3D11Tutorials/Tutorial02.
I changed the CompileShaderFromFile() function to this:
HRESULT CompileShaderFromFile( WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut ) { HRESULT hr = S_OK; DWORD dwShaderFlags = D3DCOMPILE_PREFER_FLOW_CONTROL | D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; ID3DBlob* pErrorBlob = nullptr; hr = D3DCompileFromFile( szFileName, nullptr, nullptr, szEntryPoint, szShaderModel, dwShaderFlags, 0, ppBlobOut, &pErrorBlob ); if( FAILED(hr) ) { if( pErrorBlob ) { OutputDebugStringA( reinterpret_cast<const char*>( pErrorBlob->GetBufferPointer() ) ); pErrorBlob->Release(); } return hr; } if( pErrorBlob ) pErrorBlob->Release(); return S_OK; }
What I end up with in nSight when debugging the vertex shader of the triangle drawcall (Event 4) is this:
// // Generated by Microsoft (R) HLSL Shader Compiler 10.1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 xyzw 0 NONE float xyzw // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xyzw // 0x00000000: vs_5_0 0x00000008: dcl_globalFlags refactoringAllowed | skipOptimization 0x0000000C: dcl_input v0.xyzw 0x00000018: dcl_output_siv o0.xyzw, position 0x00000028: mov o0.xyzw, v0.xyzw 0x0000003C: ret // Approximately 2 instruction slots used
What I have tried thus far is:
uninstall nsight, delete Nsight in “\ProgramData\NVIDIA Corporation”, reinstall nSight
delete Nsight folder in “\Users\xxx\AppData\Roaming\NVIDIA Corporation”
Any suggestions?