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
parent fe283a9aeb
commit f037b28a7b
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; guint out_width, out_height;
gint i; gint i;
GLint viewport_dim[4]; GLint viewport_dim[4] = { 0 };
GLenum multipleRT[] = { GLenum multipleRT[] = {
GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT0,

View File

@ -1179,7 +1179,8 @@ _build_extension_string (GstGLContext * context)
const GstGLFuncs *gl = context->gl_vtable; const GstGLFuncs *gl = context->gl_vtable;
GString *ext_g_str = g_string_sized_new (1024); GString *ext_g_str = g_string_sized_new (1024);
const gchar *ext_const_c_str = NULL; const gchar *ext_const_c_str = NULL;
int i, n; GLint i = 0;
GLint n = 0;
gl->GetIntegerv (GL_NUM_EXTENSIONS, &n); 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) GLuint texture_fbo, GLCB_V2 cb, gpointer stuff)
{ {
const GstGLFuncs *gl; 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 (GST_IS_GL_FRAMEBUFFER (frame), FALSE);
g_return_val_if_fail (texture_fbo_width > 0 && texture_fbo_height > 0, 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 */ /* compile */
gl->CompileShader (priv->vertex_handle); gl->CompileShader (priv->vertex_handle);
/* check everything is ok */ /* check everything is ok */
status = GL_FALSE;
gl->GetShaderiv (priv->vertex_handle, GL_COMPILE_STATUS, &status); gl->GetShaderiv (priv->vertex_handle, GL_COMPILE_STATUS, &status);
priv->vtable.GetShaderInfoLog (priv->vertex_handle, priv->vtable.GetShaderInfoLog (priv->vertex_handle,
@ -561,6 +562,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* compile */ /* compile */
gl->CompileShader (priv->fragment_handle); gl->CompileShader (priv->fragment_handle);
/* check everything is ok */ /* check everything is ok */
status = GL_FALSE;
priv->vtable.GetShaderiv (priv->fragment_handle, priv->vtable.GetShaderiv (priv->fragment_handle,
GL_COMPILE_STATUS, &status); GL_COMPILE_STATUS, &status);
@ -587,6 +589,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* if nothing failed link shaders */ /* if nothing failed link shaders */
gl->LinkProgram (priv->program_handle); gl->LinkProgram (priv->program_handle);
status = GL_FALSE;
priv->vtable.GetProgramiv (priv->program_handle, GL_LINK_STATUS, &status); priv->vtable.GetProgramiv (priv->program_handle, GL_LINK_STATUS, &status);
priv->vtable.GetProgramInfoLog (priv->program_handle, priv->vtable.GetProgramInfoLog (priv->program_handle,

View File

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