Adds back tex_coord array for CoglShader compatibility

This adds back compatibility for CoglShaders that reference the
cogl_tex_coord_in[] or cogl_tex_coord_out[] varyings. Unlike the
previous way this was done this patch maintains the use of layer numbers
for attributes and maintains forwards compatibility by letting shaders
alternatively access the per-layer tex_coord varyings via
cogl_tex_coord%i_in/out defines that index into the array.
This commit is contained in:
Robert Bragg
2013-01-19 16:00:33 +00:00
parent 1c449c67f6
commit 7fa04bb1a6
12 changed files with 232 additions and 172 deletions

View File

@ -27,6 +27,7 @@
#include "cogl-object-private.h"
#include "cogl-shader.h"
#include "cogl-gl-header.h"
#include "cogl-pipeline.h"
typedef struct _CoglShader CoglShader;
@ -38,16 +39,17 @@ typedef enum
struct _CoglShader
{
CoglHandleObject _parent;
GLuint gl_handle;
int n_tex_coord_attribs;
CoglShaderType type;
CoglHandleObject _parent;
GLuint gl_handle;
CoglPipeline *compilation_pipeline;
CoglShaderType type;
CoglShaderLanguage language;
char *source;
char *source;
};
void
_cogl_shader_compile_real (CoglHandle handle, int n_tex_coord_attribs);
_cogl_shader_compile_real (CoglHandle handle,
CoglPipeline *pipeline);
CoglShaderLanguage
_cogl_program_get_language (CoglHandle handle);