After a couple of tries I realized that it is most likely not easy to get HLSL in Nsight. I succeeded at getting some sort of HLSL code in Nsight but there are all referencing to a big shader that contains all the includes. Their name are mostly Main and their referenced line doesn’t fits (they fits if you go on the drive and find the corresponding usf shader.
But the major problem is that debugging is not available. I have a doupt that Nsight is not aware that ue4 is using a worker. The only help founded on the net are coming from an unreal dev guy:
[i]"I haven’t tried source in Nsight for a while, but some things you can try:
- Remove the call to D3DStripShader in D3D11ShaderCompiler.cpp. You have to recompile ShaderCompileWorker Win64 Development to propagate the change. And then add a space or something to common.usf to force shaders to recompile (if you are working on a global shader just edit it a bit).
- In UE4 we compile the shaders in a different app (ShaderCompileWorker) which allows making use of all your cores. However tools like NSight don’t know about this other app and they only hook the compile calls in the main executable. If you open BaseEngine.ini and set bAllowCompilingThroughWorkers=False, any future shaders will be compiled from the main executable. Of course, this will make compiling super slow."[/i]
Since Unreal is one of the most used game engine in the wrold, I think some guile line should be provided by Nsight developper (epic might not put lots of effort since renderdoc is working actually).