galahad: fix indirect draw
authorRoland Scheidegger <sroland@vmware.com>
Tue, 30 Sep 2014 17:25:09 +0000 (19:25 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 1 Oct 2014 00:17:24 +0000 (02:17 +0200)
Need to unwrap the indirect resource otherwise bad things will happen.

Fixes random crashes and timeouts with piglit's arb_indirect_draw tests.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/galahad/glhd_context.c

index 79d549585b7e3cfe95a0bf28d841dec13e640593..37ea1703fb97487de5c9831f557c3b02be9925e3 100644 (file)
@@ -49,7 +49,7 @@ galahad_context_destroy(struct pipe_context *_pipe)
 
 static void
 galahad_context_draw_vbo(struct pipe_context *_pipe,
-                 const struct pipe_draw_info *info)
+                         const struct pipe_draw_info *info)
 {
    struct galahad_context *glhd_pipe = galahad_context(_pipe);
    struct pipe_context *pipe = glhd_pipe->pipe;
@@ -58,7 +58,14 @@ galahad_context_draw_vbo(struct pipe_context *_pipe,
     * before drawing.
     */
 
-   pipe->draw_vbo(pipe, info);
+   if (info->indirect) {
+      struct pipe_draw_info info_unwrapped = *info;
+      info_unwrapped.indirect = galahad_resource_unwrap(info->indirect);
+      pipe->draw_vbo(pipe, &info_unwrapped);
+   }
+   else {
+      pipe->draw_vbo(pipe, info);
+   }
 }
 
 static struct pipe_query *