mutter/cogl
Neil Roberts 6607306a2d cogl: Remove the generated array size for cogl_tex_coord_in
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.
2010-12-02 12:27:29 +00:00
..
driver cogl-context: Get rid of the features_cached member 2010-11-24 18:39:07 +00:00
tesselator build: Do not build a noinst library for the tesselator 2010-09-12 19:25:47 +01:00
winsys cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl2-path.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl2-path.h path 2.0: update path API for experimental 2.0 API 2010-11-11 13:17:26 +00:00
cogl-atlas-texture-private.h cogl-atlas-texture: Split out the atlas data structure 2010-08-12 11:56:59 +01:00
cogl-atlas-texture.c Use FBOs and use cogl_read_pixels() to efficiently read partial textures 2010-11-24 15:56:35 +00:00
cogl-atlas.c cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-atlas.h cogl-atlas: Support multiple formats and clearing the texture 2010-08-12 11:56:59 +01:00
cogl-bitmap-fallback.c cogl-bitmap: Encapsulate the CoglBitmap even internally 2010-07-15 17:24:01 +01:00
cogl-bitmap-pixbuf.c cogl-bitmap-pixbuf: Avoid copying the buffer in more circumstances 2010-07-22 20:13:37 +01:00
cogl-bitmap-private.h Add an internal _cogl_bitmap_new_from_buffer 2010-07-15 17:27:15 +01:00
cogl-bitmap.c buffer: make _bind() return base pointer 2010-11-03 17:28:45 +00:00
cogl-bitmap.h Make a public CoglBitmapError enum 2010-07-13 14:28:45 +01:00
cogl-bitmask.c cogl: Add an internal CoglBitmask type 2010-05-24 16:10:56 +01:00
cogl-bitmask.h
cogl-blend-string.c Remove the disabling of layer constants for GLES2 2010-11-24 18:06:44 +00:00
cogl-blend-string.h blend-strings: removes the AUTO_COMPOSITE function enum 2010-06-15 15:26:27 +01:00
cogl-buffer-private.h cogl-buffer: Use void* instead of guint8* for map and set_data 2010-11-04 18:04:03 +00:00
cogl-buffer.c Actually free buffer objects 2010-11-19 13:27:30 +00:00
cogl-buffer.h cogl-buffer: Use void* instead of guint8* for map and set_data 2010-11-04 18:04:03 +00:00
cogl-callback-list.c cogl: Add an internal utility to maintain a list of callback functions 2010-08-12 11:54:42 +01:00
cogl-callback-list.h cogl: Add an internal utility to maintain a list of callback functions 2010-08-12 11:54:42 +01:00
cogl-clip-stack.c clip-stack: combine modelview-projection in set_clip_planes 2010-11-23 12:50:29 +00:00
cogl-clip-stack.h cogl: Move the clip stack dirtiness to the context rather than the FB 2010-11-04 18:08:27 +00:00
cogl-clip-state.c path 2.0: update path API for experimental 2.0 API 2010-11-11 13:17:26 +00:00
cogl-clip-state.h build: cogl-clip-state.h depends on cogl-clip-stack.h 2010-11-19 13:27:30 +00:00
cogl-color-private.h
cogl-color.c
cogl-color.h
cogl-context.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-context.h cogl-context: Get rid of the features_cached member 2010-11-24 18:39:07 +00:00
cogl-debug-options.h Add a COGL_DEBUG option to disable the fixed function pipeline backend 2010-11-24 18:06:44 +00:00
cogl-debug.c Add a COGL_DEBUG option to disable the fixed function pipeline backend 2010-11-24 18:06:44 +00:00
cogl-debug.h Add a COGL_DEBUG option to disable the fixed function pipeline backend 2010-11-24 18:06:44 +00:00
cogl-defines.h.in configure: Include gl2ext.h or glext.h under GLES 2010-07-13 14:28:51 +01:00
cogl-deprecated.h
cogl-enum-types.c.in
cogl-enum-types.h.in
cogl-feature-private.c cogl: Add the infrastructure for checking for winsys extensions 2010-06-22 12:22:43 +01:00
cogl-feature-private.h cogl: Add the infrastructure for checking for winsys extensions 2010-06-22 12:22:43 +01:00
cogl-fixed.c Fixed "the the" repetitions in some doc strings 2010-11-25 18:18:51 +00:00
cogl-fixed.h
cogl-framebuffer-private.h cogl-framebuffer: Try to track format of the framebuffer 2010-11-24 15:56:35 +00:00
cogl-framebuffer.c cogl-framebuffer: Try to track format of the framebuffer 2010-11-24 15:56:35 +00:00
cogl-handle.h
cogl-index-array-private.h cogl: Adds experimental CoglIndexArray type 2010-11-03 18:04:00 +00:00
cogl-index-array.c cogl: Adds experimental CoglIndexArray type 2010-11-03 18:04:00 +00:00
cogl-index-array.h cogl: Adds experimental CoglIndexArray type 2010-11-03 18:04:00 +00:00
cogl-indices-private.h indices: Makes cogl_indices_get_array public 2010-11-19 13:27:30 +00:00
cogl-indices.c indices: Makes cogl_indices_get_array public 2010-11-19 13:27:30 +00:00
cogl-indices.h indices: Makes cogl_indices_get_array public 2010-11-19 13:27:30 +00:00
cogl-internal.h Merge cogl-program-{gl,gles}.c into one cogl-program.c 2010-10-28 19:51:42 +01:00
cogl-journal-private.h journal: remove possability of fallback layers 2010-11-23 12:50:29 +00:00
cogl-journal.c journal: remove possability of fallback layers 2010-11-23 12:50:29 +00:00
cogl-material-compat.c cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-material-compat.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-matrix-mesa.c
cogl-matrix-mesa.h
cogl-matrix-private.h
cogl-matrix-stack.c matrix-stack: use GArray instead of GSList for stack 2010-11-04 18:35:16 +00:00
cogl-matrix-stack.h
cogl-matrix.c matrix: Adds experimental cogl_matrix_{transform,project}_points 2010-11-23 12:50:29 +00:00
cogl-matrix.h matrix: Adds experimental cogl_matrix_{transform,project}_points 2010-11-23 12:50:29 +00:00
cogl-object-private.h cogl-object-private.h: Include cogl-debug.h 2010-09-17 17:22:16 +01:00
cogl-object.c cogl-object: correctly free user_data_array in _unref 2010-11-03 17:28:45 +00:00
cogl-object.h CoglObject: Adds a COGL_OBJECT macro for casting 2010-06-04 14:44:15 +01:00
cogl-offscreen.h Add some more introspection annotations 2010-09-06 16:11:46 +01:00
cogl-path-private.h path 2.0: update path API for experimental 2.0 API 2010-11-11 13:17:26 +00:00
cogl-path.c path 2.0: update path API for experimental 2.0 API 2010-11-11 13:17:26 +00:00
cogl-path.h path 2.0: update path API for experimental 2.0 API 2010-11-11 13:17:26 +00:00
cogl-pipeline-arbfp-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-pipeline-arbfp.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-pipeline-fixed-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-pipeline-fixed.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-pipeline-glsl-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-pipeline-glsl.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-pipeline-opengl-private.h cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-pipeline-opengl.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-pipeline-private.h cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-pipeline.c cogl-pipeline: Fix comparing layer states for finding codgen authority 2010-12-01 15:48:37 +00:00
cogl-pipeline.h cogl-pipeline: Add getters for the alpha test state 2010-11-24 18:06:44 +00:00
cogl-pixel-array-private.h pixel-array: Remove flags member and flag macros 2010-10-26 16:16:40 +01:00
cogl-pixel-array.c Actually free buffer objects 2010-11-19 13:27:30 +00:00
cogl-pixel-array.h pixel-array: Only allow allocation of arrays with a 2D size 2010-07-05 15:20:04 +01:00
cogl-primitive-private.h primitive: adds immutable ref/unref mechanism 2010-11-03 18:04:31 +00:00
cogl-primitive.c vertex-array: Adds data arg for _vertex_array_new() 2010-11-19 13:27:30 +00:00
cogl-primitive.h cogl-primitive: Add the missing cogl_primitive_new_p2 function 2010-11-04 17:59:28 +00:00
cogl-primitives-private.h cogl: Don't flush the journal when flushing clip state 2010-11-04 18:10:08 +00:00
cogl-primitives.c primitives: avoid leaking polygon override materials 2010-11-26 14:33:50 +00:00
cogl-primitives.h
cogl-private.h Add an internal _cogl_read_pixels_with_rowstride 2010-11-24 15:56:34 +00:00
cogl-profile.c Initialize the cogl uprof state in cogl_create_context 2010-09-14 12:43:17 +01:00
cogl-profile.h Initialize the cogl uprof state in cogl_create_context 2010-09-14 12:43:17 +01:00
cogl-program-private.h Merge cogl-program-{gl,gles}.c into one cogl-program.c 2010-10-28 19:51:42 +01:00
cogl-program.c Merge cogl-program-{gl,gles}.c into one cogl-program.c 2010-10-28 19:51:42 +01:00
cogl-rectangle-map.c cogl-rectangle-map: Record largest gap rather than the remaining space 2010-08-12 11:57:00 +01:00
cogl-rectangle-map.h cogl-atlas: Rename to CoglRectangleMap 2010-08-12 11:54:42 +01:00
cogl-shader-boilerplate.h cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-shader-private.h cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-shader.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-shader.h cogl-shader: Add deprecation guards for cogl_program_uniform_* 2010-09-03 16:59:01 +01:00
cogl-spans.c
cogl-spans.h
cogl-sub-texture-private.h
cogl-sub-texture.c Use FBOs and use cogl_read_pixels() to efficiently read partial textures 2010-11-24 15:56:35 +00:00
cogl-texture-2d-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-texture-2d-sliced-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-texture-2d-sliced.c Use FBOs and use cogl_read_pixels() to efficiently read partial textures 2010-11-24 15:56:35 +00:00
cogl-texture-2d.c cogl-texture: Remove the gl_handle from CoglTextureSliceCallback 2010-11-11 16:25:13 +00:00
cogl-texture-3d-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-texture-3d.c cogl-texture: Remove the gl_handle from CoglTextureSliceCallback 2010-11-11 16:25:13 +00:00
cogl-texture-3d.h Add a Cogl texture 3D backend 2010-07-13 14:28:52 +01:00
cogl-texture-driver.h Add a Cogl texture 3D backend 2010-07-13 14:28:52 +01:00
cogl-texture-private.h cogl-texture: Remove the gl_handle from CoglTextureSliceCallback 2010-11-11 16:25:13 +00:00
cogl-texture-rectangle-private.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-texture-rectangle.c cogl-texture: Remove the gl_handle from CoglTextureSliceCallback 2010-11-11 16:25:13 +00:00
cogl-texture.c Use FBOs and use cogl_read_pixels() to efficiently read partial textures 2010-11-24 15:56:35 +00:00
cogl-texture.h
cogl-types.h cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-util.c cogl: rename CoglMaterial -> CoglPipeline 2010-11-03 18:09:23 +00:00
cogl-util.h cogl: Make cogl_util_next_p2 internal and fix the documentation 2010-09-15 15:01:43 +01:00
cogl-vector.c
cogl-vector.h cogl: declare experimental symbols consistently 2010-06-30 18:51:31 +01:00
cogl-vertex-array-private.h cogl: Adds experimental CoglVertexArray type 2010-11-03 18:04:00 +00:00
cogl-vertex-array.c vertex-array: Adds data arg for _vertex_array_new() 2010-11-19 13:27:30 +00:00
cogl-vertex-array.h vertex-array: Adds data arg for _vertex_array_new() 2010-11-19 13:27:30 +00:00
cogl-vertex-attribute-private.h cogl: Adds experimental CoglVertexAttribute API 2010-11-03 18:04:26 +00:00
cogl-vertex-attribute.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl-vertex-attribute.h gtk-doc: Fixes for the API references 2010-11-08 16:01:19 +00:00
cogl-vertex-buffer-private.h vertex-buffer: port to CoglVertexAttributes + CoglPrimitive 2010-11-03 18:09:15 +00:00
cogl-vertex-buffer.c Fixed "the the" repetitions in some doc strings 2010-11-25 18:18:51 +00:00
cogl-vertex-buffer.h Move IndicesType and VerticesMode typedefs to cogl-types.h 2010-10-26 17:25:33 +01:00
cogl.c cogl: Remove the generated array size for cogl_tex_coord_in 2010-12-02 12:27:29 +00:00
cogl.h path 2.0: update path API for experimental 2.0 API 2010-11-11 13:17:26 +00:00
cogl.pc.in
Makefile.am Remove the fragment shader generation from the GLES2 wrapper 2010-11-24 18:06:44 +00:00
stb_image.c