draw: Ensure draw_pt_middle_end::bind_parameters is never NULL.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 18 Sep 2013 19:01:54 +0000 (20:01 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 20 Sep 2013 16:34:57 +0000 (17:34 +0100)
Prevents calling NULL pointer with softpipe in certain cases.

Trivial.

src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c

index 22ec8d6b2b5ea75fb1888d73aedf91fc9c62bbe0..4278429a2fe623299a50d83922dae27aa2f482af 100644 (file)
@@ -180,6 +180,13 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
 }
 
 
+static void
+fetch_emit_bind_parameters(struct draw_pt_middle_end *middle)
+{
+   /* No-op? */
+}
+
+
 static void fetch_emit_run( struct draw_pt_middle_end *middle,
                             const unsigned *fetch_elts,
                             unsigned fetch_count,
@@ -379,6 +386,7 @@ struct draw_pt_middle_end *draw_pt_fetch_emit( struct draw_context *draw )
    }
 
    fetch_emit->base.prepare    = fetch_emit_prepare;
+   fetch_emit->base.bind_parameters = fetch_emit_bind_parameters;
    fetch_emit->base.run        = fetch_emit_run;
    fetch_emit->base.run_linear = fetch_emit_run_linear;
    fetch_emit->base.run_linear_elts = fetch_emit_run_linear_elts;
index d30cd412ef610e0d36a6c3b046b9a4f2a356a39a..bdfbbfb27da6d2a592d00451f9a61c77774f517d 100644 (file)
@@ -178,6 +178,12 @@ fse_prepare(struct draw_pt_middle_end *middle,
 }
 
 
+static void
+fse_bind_parameters(struct draw_pt_middle_end *middle)
+{
+   /* No-op? */
+}
+
 
 static void
 fse_run_linear(struct draw_pt_middle_end *middle,
@@ -366,6 +372,7 @@ draw_pt_middle_fse(struct draw_context *draw)
       return NULL;
 
    fse->base.prepare = fse_prepare;
+   fse->base.bind_parameters = fse_bind_parameters;
    fse->base.run = fse_run;
    fse->base.run_linear = fse_run_linear;
    fse->base.run_linear_elts = fse_run_linear_elts;