free(code);
}
+#if 0
static void BuildRGBFragmentShader(vout_display_opengl_t *vgl,
GLint *shader)
{
vgl->ShaderSource(*shader, 1, &code, NULL);
vgl->CompileShader(*shader);
}
+#endif
static void BuildRGBAFragmentShader(vout_display_opengl_t *vgl,
GLint *shader)
vgl->supports_npot = HasExtension(extensions, "GL_ARB_texture_non_power_of_two") ||
HasExtension(extensions, "GL_APPLE_texture_2D_limited_npot");
+#if USE_OPENGL_ES
+ /* OpenGL ES 2 includes support for non-power of 2 textures by specification
+ * so checks for extensions are bound to fail. Check for OpenGL ES version instead. */
+ const unsigned char *ogl_version = glGetString(GL_VERSION);
+ if (strverscmp((const char *)ogl_version, "2.0") >= 0)
+ vgl->supports_npot = true;
+#endif
+
GLint max_texture_units = 0;
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
vgl->shader[1] =
vgl->shader[2] = -1;
vgl->local_count = 0;
- if (supports_shaders && vlc_fourcc_IsYUV(fmt->i_chroma)) {
- BuildYUVFragmentShader(vgl, &vgl->shader[0],
- &vgl->local_count,
- vgl->local_value,
- fmt, yuv_range_correction);
+ if (supports_shaders && need_fs_yuv) {
+ BuildYUVFragmentShader(vgl, &vgl->shader[0], &vgl->local_count,
+ vgl->local_value, fmt, yuv_range_correction);
BuildRGBAFragmentShader(vgl, &vgl->shader[1]);
BuildVertexShader(vgl, &vgl->shader[2]);
glBindTexture(vgl->tex_target, vgl->texture[0][j]);
#ifndef GL_UNPACK_ROW_LENGTH
- if ( (picture->p[j].i_pitch / picture->p[j].i_pixel_pitch) !=
+ if ( (picture->p[j].i_pitch / picture->p[j].i_pixel_pitch) != (unsigned int)
( picture->format.i_visible_width * vgl->chroma->p[j].w.num / vgl->chroma->p[j].w.den ) )
{
uint8_t *new_plane = malloc( picture->format.i_visible_width * vgl->fmt.i_visible_height * vgl->chroma->p[j].h.num / (vgl->chroma->p[j].h.den * vgl->chroma->p[j].w.den ) );