_Time variable in compute shaders

Is the _Time variable not available to compute shaders? I’m seeing undeclared identifier '_Time' at kernel CSMain. Do I need to send the time variable manually?

None of the built-in variables are available in compute shaders; you’ll need to pass them in manually.

m_ComputeShader.SetVector ("_Time", Shader.GetGlobalVector ("_Time"));

You will also need to declare these variables in the compute shader itself to fix the error shown above (you can still include “UnityCG.cginc” but I would recommend doing it manually for only the variables you need).