[Mesa-dev] [PATCH 2/2] galahad: fix indirect draw

Jose Fonseca jfonseca at vmware.com
Tue Sep 30 13:44:29 PDT 2014


Series looks good. Thanks for looking into this Roland.

It looks nobody else is using galahad, nor looking at the warnings.  I wonder if it makes sense to keep using/updating it.

Jose

________________________________________
From: sroland at vmware.com <sroland at vmware.com>
Sent: 30 September 2014 19:07
To: Jose Fonseca; mesa-dev at lists.freedesktop.org
Cc: Roland Scheidegger
Subject: [PATCH 2/2] galahad: fix indirect draw

From: Roland Scheidegger <sroland at vmware.com>

Need to unwrap the indirect resource otherwise bad things will happen.

Fixes random crashes and timeouts with piglit's arb_indirect_draw tests.
---
 src/gallium/drivers/galahad/glhd_context.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index 79d5495..37ea170 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -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 *
--
1.9.1



More information about the mesa-dev mailing list