Iphone OpenGL ES-全局上下文中的限定符无效错误

Iphone OpenGL ES-全局上下文中的限定符无效错误,iphone,ios,opengl-es,Iphone,Ios,Opengl Es,当向我的opengl片段添加浮点属性时,我想在以后找到它,当我编译时,我得到: ERROR: 0:1: Invalid qualifiers 'attribute' in global variable context 这是我的密码: const char * sChromaKeyFragment = _STRINGIFY( attribute float threshold;

当向我的opengl片段添加浮点属性时,我想在以后找到它,当我编译时,我得到:

ERROR: 0:1: Invalid qualifiers 'attribute' in global variable context
这是我的密码:

const char * sChromaKeyFragment = _STRINGIFY(
                                             attribute float threshold;

                                             varying highp vec2 coordinate;
                                             precision mediump float;

                                             uniform sampler2D videoframe;
                                             uniform sampler2D videosprite;
                                             uniform vec4 mask;



                                             vec3 normalize(vec3 color, float meanr)
{
    return color*vec3(0.75 + meanr, 1., 1. - meanr);
}

                                             void main()
{
} 

OpenGL的新功能。任何帮助都会很好。谢谢

那是片段着色器吗?属性只能在顶点着色器中使用。您需要以不同的方式将所有需要的信息从顶点着色器传递到片段着色器。

这是片段着色器吗?属性只能在顶点着色器中使用。您需要以不同的方式将所有需要的信息从顶点着色器传递到片段着色器