In Unity, you write shader programs using the HLSL programming language.
HLSL syntax
The HLSL language itself has two syntaxes: a “legacy” DX9-style syntax, and a more modern DX10+ style syntax.
The difference is mostly in how texture sampling functions work:
The legacy syntax uses sampler2D, tex2D() and similar functions. This syntax works on all platforms.
The DX10+ syntax uses Texture2D, SamplerState and .Sample() functions. Some forms of this syntax do not work on OpenGL platforms, due to how textures and samplers are not different objects in OpenGL.
In Unity, you can avoid problems with HLSL syntax platform support by using predefined macros to declare and sample textures. Unity expands these macros to the most appropriate syntax, depending on the platform that the shader is being compiled for.