gl: initialize output params to 0 before calling gl functions

The client side API of the Chromium's GPU Process has asserts
in debug mode that check that output params are initialized to 0.
This commit is contained in:
Julien Isorce 2015-07-02 10:26:18 +01:00 committed by Tim-Philipp Müller
parent b8d3c2d2a5
commit 9b1eb32c49
5 changed files with 8 additions and 4 deletions

View file

@ -1714,7 +1714,7 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert)
guint out_width, out_height;
gint i;
GLint viewport_dim[4];
GLint viewport_dim[4] = { 0 };
GLenum multipleRT[] = {
GL_COLOR_ATTACHMENT0,

View file

@ -1179,7 +1179,8 @@ _build_extension_string (GstGLContext * context)
const GstGLFuncs *gl = context->gl_vtable;
GString *ext_g_str = g_string_sized_new (1024);
const gchar *ext_const_c_str = NULL;
int i, n;
GLint i = 0;
GLint n = 0;
gl->GetIntegerv (GL_NUM_EXTENSIONS, &n);

View file

@ -173,7 +173,7 @@ gst_gl_framebuffer_use_v2 (GstGLFramebuffer * frame, gint texture_fbo_width,
GLuint texture_fbo, GLCB_V2 cb, gpointer stuff)
{
const GstGLFuncs *gl;
GLint viewport_dim[4];
GLint viewport_dim[4] = { 0 };
g_return_val_if_fail (GST_IS_GL_FRAMEBUFFER (frame), FALSE);
g_return_val_if_fail (texture_fbo_width > 0 && texture_fbo_height > 0, FALSE);

View file

@ -522,6 +522,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* compile */
gl->CompileShader (priv->vertex_handle);
/* check everything is ok */
status = GL_FALSE;
gl->GetShaderiv (priv->vertex_handle, GL_COMPILE_STATUS, &status);
priv->vtable.GetShaderInfoLog (priv->vertex_handle,
@ -561,6 +562,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* compile */
gl->CompileShader (priv->fragment_handle);
/* check everything is ok */
status = GL_FALSE;
priv->vtable.GetShaderiv (priv->fragment_handle,
GL_COMPILE_STATUS, &status);
@ -587,6 +589,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* if nothing failed link shaders */
gl->LinkProgram (priv->program_handle);
status = GL_FALSE;
priv->vtable.GetProgramiv (priv->program_handle, GL_LINK_STATUS, &status);
priv->vtable.GetProgramInfoLog (priv->program_handle,

View file

@ -1586,7 +1586,7 @@ _do_view_convert_draw (GstGLContext * context, GstGLViewConvert * viewconvert)
GstGLFuncs *gl;
guint out_width, out_height;
gint out_views, i;
GLint viewport_dim[4];
GLint viewport_dim[4] = { 0 };
GLenum multipleRT[] = {
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT1,