Can we tell unity to compile HLSL with specified flags like these?
I want to debug a compute shader with visual studio but the whole experience is a disaster. When I step over code it jumps to some other line. This behaviour is unpredictable thanks to the shader code optimization. I want to disable shader optimizations to be able to debug the thing.
Did you ever figure this out? Although I’ve gotten the Visual Studio Graphics analyzer to produce somewhat workable results, the code optimization does appear to throw a wrench in a lot of times.
I’ve also tried Nvidia NSight and I simply cannot get it to find the original source at all, only assembly.
Well, I need a simple, straightforward way of debugging shaders while Unity is running. Compiling the shaders elsewhere then loading them through other plugins is anything but. #pragma enable_d3d11_debug_symbols should make the compiler automatically disable optimizations. Or have some other flag that does that…