highp
is actually undefined in fragment shaders by default, so it really comes as no surprise that this generates a parse error.
I feel like a broken record, but the proper way to use highp
in a fragment shader is to first check for the pre-processor definition: GL_FRAGMENT_PRECISION_HIGH
. This pre-processor definition is defined in all stages since you need to know when outputting something in a vertex shader whether the fragment shader will support highp
.
Consider the following GLSL snippet:
#ifdef GL_FRAGMENT_PRECISION_HIGH
# define maxfragp highp
#else
# define maxfragp medp
#endif
Since you need to match precision between vertex and fragment shaders for I/O, you might use something like this (for both the fragment and vertex shader):
maxfragp varying vec2 tex_st;
Vertex shaders always support highp
, by the way. This only applies to fragment shaders.
With that out of the way, you should be aware that in desktop GLSL, while version 1.30 defines precision qualifiers they do not actually do anything. They are there simply to make porting shaders from GLSL ES easier.
Precision qualifiers are added for code portability with OpenGL ES, not for functionality. They have the same syntax as in OpenGL ES, as described below, but they have no semantic meaning, which includes no effect on the precision used to store or operate on variables.
If an extension adds in the same semantics and functionality in the OpenGL ES 2.0 specification for precision qualifiers, then the extension is allowed to reuse the keywords below for that purpose.

The only types of precision desktop GLSL deals with are single- and double-precision (GL 4.0+ / ARB_gpu_shader_fp64
) floating-point. And these variables are distinguished using different data types (e.g. dvec2
vs. vec2
) rather than a precision qualifier.