#How do I set up Unity so that NSight can show me the name of the shaders?

1 messages · Page 1 of 1 (latest)

little sundial
#

Whenever I get a GPU Trace from a Unity build in NVidia Nsight it looks like this (see screenshot) Is there a way to set up Unity and NSight so that I can see the full profiling information?

true hill
#

Hey! it should be possible when debug symbols are enabled (#pragma enable_d3d11_debug_symbols included in the shader). Unfortunately we currently lack a way to automatically add those to all shaders, but are looking into it.

#

For the second warning, seems like NSight indicates that DXBC shaderes are not supported fully. So you will need to compile shaders with DXC (#pragma use_dxc) instead of FXC

#

For simply the shader names, you could also look at the created PSOs (who's name would often be derived from shaders). But ofc it does not solve your problem of deeper shader profiling

little sundial
#

Thanks @true hill Is there a way to enable dxc globally by any chance?

#

Also is there a way to enable_d3d11_debug_symbols for hdrp/urp shaders like hdrp/lit? I'm guessing I'd have to move the package to the assets folder

true hill
#

At the moment there is no official project-wide setting to compile with DXC, or to add the debug symbols 😦 For DXC, some shaders may not be compatible with DXC, and we are looking to improve support.

#

You could try to "hack" this with the SRP config file, but be warned as we did not test this and it is not recommended. Not sure if it will include shader files using "include with pragmas". So may not work all

#

So you will likely need to modify the shaders as you suggested

true hill
#

Looking at it a bit more, seems like you will also need to setup an envrionment variable UNITYSHADERCACHE to write out the PDBs to a cache

little sundial