Read-only mirror of https://gitlab.gnome.org/GNOME/mutter
6607306a2d
Under GLES2 we were defining the cogl_tex_coord_in varying as an array with a size determined by the number of texture coordinate arrays enabled whenever the program is used. This meant that we may have to regenerate the shader with a different size if the shader is used with more texture coord arrays later. However in OpenGL the equivalent builtin varying gl_TexCoord is simply defined as: varying vec4 gl_TexCoord[]; /* <-- no size */ GLSL is documented that if you declare an array with no size then you can only access it with a constant index and the size of the array will be determined by the highest index used. If you want to access it with a non-constant expression you need to redeclare the array yourself with a size. We can replicate the same behaviour in our Cogl shaders by instead declaring the cogl_tex_coord_in with no size. That way we don't have to pass around the number of tex coord attributes enabled when we flush a material. It also means that CoglShader can go back to directly uploading the source string to GL when cogl_shader_source is called so that we don't have to keep a copy of it around. If the user wants to access cogl_tex_coord_in with a non-constant index then they can simply redeclare the array themself. Hopefully developers will expect to have to do this if they are accustomed to the gl_TexCoord array. |
||
---|---|---|
cogl | ||
doc | ||
pango | ||
Makefile.am |