Here are some thoughts:
- Move common functionality to separate file and use
#include
to spread it between shaders. - Use
#ifdef
for conditional compilation. Pass defines via/D
flag offxc.exe
ofD3D_SHADER_MACRO
ofD3DCompile
. You can combine all in one shader and then compile it into many different binaries. - Use some effect framework (default DirectX one, googled or make your own): you will not need separate files for shaders, all goes in one file, so as states.
- Leave all as is: HLSL is complicated and any more complications just can lead to unmaintainable mess.
Hope it helps!