[787/906] gl: The GLSL rectangle resampler does not always work with int tex coords

Use floats instead.
This commit is contained in:
Tonu Jaansoo 2013-08-07 11:42:46 +02:00 committed by Matthew Waters
parent 52052a758a
commit e45dfb2f93
5 changed files with 16 additions and 16 deletions

View file

@ -1168,12 +1168,12 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
{
GstGLFuncs *gl = filter->display->gl_vtable;
gfloat verts[] = { -1.0f, -1.0f,
GLfloat verts[] = { -1.0f, -1.0f,
1.0f, -1.0f,
1.0f, 1.0f,
-1.0f, 1.0f
};
gint texcoords[] = { 0, 0,
GLfloat texcoords[] = { 0, 0,
width, 0,
width, height,
0, height
@ -1191,7 +1191,7 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);

View file

@ -1207,12 +1207,12 @@ _do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
gint i;
gfloat tex_scaling[6] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
gfloat verts[8] = { 1.0f, -1.0f,
GLfloat verts[8] = { 1.0f, -1.0f,
-1.0f, -1.0f,
-1.0f, 1.0f,
1.0f, 1.0f
};
gint texcoords[8] = { in_width, 0,
GLfloat texcoords[8] = { in_width, 0,
0, 0,
0, in_height,
in_width, in_height
@ -1337,7 +1337,7 @@ _do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);

View file

@ -267,17 +267,17 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
GstGLFuncs *gl = filter->display->gl_vtable;
guint temp;
gfloat verts[] = { -1.0, -1.0,
GLfloat verts[] = { -1.0, -1.0,
1.0, -1.0,
1.0, 1.0,
-1.0, 1.0
};
gint texcoords0[] = { 0, 0,
GLfloat texcoords0[] = { 0, 0,
width, 0,
width, height,
0, height
};
gint texcoords1[] = { 0, 0,
GLfloat texcoords1[] = { 0, 0,
width, 0,
width, height,
0, height
@ -324,7 +324,7 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
gl->EnableClientState (GL_VERTEX_ARRAY);
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
gl->TexCoordPointer (2, GL_INT, 0, &texcoords0);
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords0);
gl->ClientActiveTexture (GL_TEXTURE1);
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);

View file

@ -280,12 +280,12 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
#if GST_GL_HAVE_OPENGL
if (gst_gl_display_get_gl_api (display) & GST_GL_API_OPENGL) {
gfloat verts[] = { -1.0f, -1.0f,
GLfloat verts[] = { -1.0f, -1.0f,
1.0f, -1.0f,
1.0f, 1.0f,
-1.0f, 1.0f
};
gint texcoords[] = { 0, 0,
GLfloat texcoords[] = { 0, 0,
width, 0,
width, height,
0, height
@ -300,7 +300,7 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);

View file

@ -977,12 +977,12 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
else {
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (gl_sink->display)) {
gfloat verts[8] = { 1.0f, 1.0f,
GLfloat verts[8] = { 1.0f, 1.0f,
-1.0f, 1.0f,
-1.0f, -1.0f,
1.0f, -1.0f
};
gint texcoords[8] = { gl_sink->redisplay_texture_width, 0,
GLfloat texcoords[8] = { gl_sink->redisplay_texture_width, 0,
0, 0,
0, gl_sink->redisplay_texture_height,
gl_sink->redisplay_texture_width,
@ -999,7 +999,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
gl->EnableClientState (GL_VERTEX_ARRAY);
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);