cogl-shader-boilerplate: Add the 3D texture extension on GLES2

To use the 3D texture extension on GLES2 it has to be enabled with the
following line in GLSL:

#extension GL_OES_texture_3D : enable
This commit is contained in:
Neil Roberts 2010-12-07 13:44:45 +00:00
parent 38971e4977
commit 03d33a6f4d

View File

@ -196,8 +196,8 @@ _cogl_shader_set_source_with_boilerplate (GLuint shader_gl_handle,
static const char vertex_boilerplate[] = _COGL_VERTEX_SHADER_BOILERPLATE;
static const char fragment_boilerplate[] = _COGL_FRAGMENT_SHADER_BOILERPLATE;
const char **strings = g_alloca (sizeof (char *) * (count_in + 2));
GLint *lengths = g_alloca (sizeof (GLint) * (count_in + 2));
const char **strings = g_alloca (sizeof (char *) * (count_in + 3));
GLint *lengths = g_alloca (sizeof (GLint) * (count_in + 3));
int count = 0;
#ifdef HAVE_COGL_GLES2
char *tex_coord_declarations = NULL;
@ -205,6 +205,16 @@ _cogl_shader_set_source_with_boilerplate (GLuint shader_gl_handle,
GET_CONTEXT (ctx, NO_RETVAL);
#ifdef HAVE_COGL_GLES2
if (cogl_features_available (COGL_FEATURE_TEXTURE_3D))
{
static const char texture_3d_extension[] =
"#extension GL_OES_texture_3D : enable\n";
strings[count] = texture_3d_extension;
lengths[count++] = sizeof (texture_3d_extension) - 1;
}
#endif
if (shader_gl_type == GL_VERTEX_SHADER)
{
strings[count] = vertex_boilerplate;