The fact that you can’t find a kernel usually means it didn’t compile correctly. Select your shader and you should see list of errors in inspector.
I see this for your shader (in Unity 5.5):
Shader error in 'NewComputeShader.compute': Program 'CSMain', error X4505: Sum of temp registers and indexable temp registers exceeds limit of 4096 (on d3d11)
Sorry for delayed response, I took the code to another PC in office and yes, this error suddenly popped up. I guess its my home PC’s driver issue. I did a lot of modifications to the shader later on, a bit painful it was and now it compiles and finds kernel anyway.
Nonetheless, if a shader is not successfully compiled, unity should throw some meaningful error messages upon FindKernel() sothat I can understand, what is going on.
Do any of you guys use any tool to debug compute shaders apart from playing with debug buffers? Deving compute shader is so painful :(
The error is from DirectX compiler. It is strange you can’t see it. Drivers shouldn’t matter. It should be HW independent. Maybe this is a Unity bug.
There are several shader debuggers. Mostly annotated assembly debugging. RenderDoc is integrated in Unity so that’s by far the easiest method. Popular alternatives are Visual Studio graphics debugger and NVidia NSight but you need standalone build for those and that gets old quickly. Don’t forget to use “#pragma enable_d3d11_debug_symbols”.
Btw. the shaders are heavily optimized and there’s currently no easy way how to disable optimizations.