summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-09-30 19:25:09 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-10-01 02:17:24 +0200
commit9750ae8ca91fd089a4affe6577265e77852ad548 (patch)
tree97f45598bbba07bbd8d8b47259b88c2c1a505ee4
parente3da8c110c06c6f0c797bf6a6ab91d482092b93c (diff)
galahad: fix indirect draw
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>
-rw-r--r--src/gallium/drivers/galahad/glhd_context.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index 79d549585b7..37ea1703fb9 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 *