Most of the time this is what you want, and is the only supported option on older graphics APIs (OpenGL ES).
Note however that DX11-style HLSL syntax does not work on some older platforms (e.g. OpenGL ES 2.0), see shading language for details. You might want to specify #pragma target 3.5 (see shader compilation targets to skip older platforms from using the shader.