Fixed an uninitialized problem at gradient shader functions.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Sat, 28 Apr 2012 06:54:38 +0000 (14:54 +0800)
committerEric Anholt <eric@anholt.net>
Wed, 18 Dec 2013 19:23:51 +0000 (11:23 -0800)
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
glamor/glamor_render.c

index c6f9c06..b729e98 100644 (file)
@@ -1651,6 +1651,8 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, int dy
                return;
        }
 
+       dispatch = glamor_get_dispatch(glamor_priv);
+
        if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]) {
                dispatch->glDeleteShader(
                    glamor_priv->radial_gradient_shaders[SHADER_GRADIENT_VS_PROG][2]);
@@ -1668,8 +1670,6 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, int dy
                glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2] = 0;
        }
 
-       dispatch = glamor_get_dispatch(glamor_priv);
-
        gradient_prog = dispatch->glCreateProgram();
 
        vs_prog = glamor_compile_glsl_prog(dispatch,
@@ -1883,6 +1883,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, int dy
                return;
        }
 
+       dispatch = glamor_get_dispatch(glamor_priv);
        if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]) {
                dispatch->glDeleteShader(
                    glamor_priv->linear_gradient_shaders[SHADER_GRADIENT_VS_PROG][2]);
@@ -1900,8 +1901,6 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, int dy
                glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2] = 0;
        }
 
-       dispatch = glamor_get_dispatch(glamor_priv);
-
        gradient_prog = dispatch->glCreateProgram();
 
        vs_prog = glamor_compile_glsl_prog(dispatch,