Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2023
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
}
- // TODO Add correct numbering
int num;
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &num);
data->smap_sampler = num - 1;
+
+ if (data->texture_count >= num)
+ if ((data->flags & E3D_SHADER_FLAG_SHADOWED) || (data->texture_count > num))
+ {
+ ERR("Too many textures for your graphics configuration.");
+ return EINA_FALSE;
+ }
+
return EINA_TRUE;
}
Eina_Bool vertex_attrib_enable[E3D_MAX_VERTEX_ATTRIB_COUNT];
Eina_Bool depth_test_enable;
GLuint texDepth;
+ GLint smap_sampler;
};
static inline GLenum
}
}
}
- glActiveTexture(GL_TEXTURE0 + data->smap_sampler);
- glBindTexture(GL_TEXTURE_2D, renderer->texDepth);
+ if ((data->flags & E3D_SHADER_FLAG_SHADOWED) && (renderer->smap_sampler != data->smap_sampler))
+ {
+ glActiveTexture(GL_TEXTURE0 + data->smap_sampler);
+ glBindTexture(GL_TEXTURE_2D, renderer->texDepth);
+ renderer->smap_sampler = data->smap_sampler;
+ }
}
static inline void