- Home /
Exclude renderer from compute shader compilation
Since Unity 5.1 there is this OpenGL compilation for compute shaders see here. Unfortunately this broke many of my complex compute shaders I'm currently working on.
In Unity 5.0, when selecting one of them in the inspector (with debug enabled), there was one variant with target renderer 2 and target level 0. Everything compiled just fine.
In Unity 5.1 (all versions up to 5.1.2p1 so far), this same compute shader did not compile. It said: 'internal error compiling shader platform=15' and 'internal error compiling shader platform=9'.
Creating a new compute shader shows 4 variants: (target renderer, target level)
(2, 0)
(18, 0)
(17, 12)
(11, 3)
My failing compute shader only shows two variants (2,0) and (18,0), so I guess it fails during the compilation of the second or third one.
Now, finally, here is my question: Is it possible to prevent the compilation of the last three variants? I only need DirectX 11 for Windows, which was working like a charm.
While writing this, I noticed that my compute shaders are still working on my target platform in spite of those error messages! So, I could just ignore those errors. But it would be much better if I could manually exclude the compilation for unwanted target platforms (like exclude_renderers for normal shaders).
I am also very interested in this feature. $$anonymous$$ostly because compiling a compute shader for all the plateform is far tooooo long when you are designing and testing a compute shader.
You should be able to disable compilation for all the plateform except the one you are using while making your shader (PC directX 11 for me). Then when the shader is ready, you enable the compilation for the other plateform if it is usefull.
So even if the shader compile just fine in all the plateform, it is usefull to have compilation disabling options.
Your answer
Follow this Question
Related Questions
Unity project wont build 0 Answers
How do i fix a Compiler error 2 Answers
3D Cellular Automata on the GPU 1 Answer