summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_setup_tri.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-10-08 17:01:16 +0100
committerKeith Whitwell <keithw@vmware.com>2010-10-08 17:26:29 +0100
commitad6730fadbbeacea96322e31064ede9ea7ebad6f (patch)
tree919e2537e338a16cdb7f0967c2da22ffda36b111 /src/gallium/drivers/llvmpipe/lp_setup_tri.c
parenteb605701aa4af9ea44004008256a5707e470738c (diff)
llvmpipe: fail gracefully on oom in scene creation
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_tri.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 9016bb8e24..eeffbb5fee 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -644,27 +644,30 @@ static void triangle_cw( struct lp_setup_context *setup,
{
if (!do_triangle_ccw( setup, v1, v0, v2, !setup->ccw_is_frontface ))
{
- lp_setup_flush_and_restart(setup);
+ if (!lp_setup_flush_and_restart(setup))
+ return;
if (!do_triangle_ccw( setup, v1, v0, v2, !setup->ccw_is_frontface ))
- assert(0);
+ return;
}
}
/**
- * Draw triangle if it's CCW, cull otherwise.
+ * Draw triangle if it's CW, cull otherwise.
*/
-static void triangle_ccw( struct lp_setup_context *setup,
+static void triangle_cw( struct lp_setup_context *setup,
const float (*v0)[4],
const float (*v1)[4],
const float (*v2)[4] )
{
if (!do_triangle_ccw( setup, v0, v1, v2, setup->ccw_is_frontface ))
{
- lp_setup_flush_and_restart(setup);
+ if (!lp_setup_flush_and_restart(setup))
+ return;
+
if (!do_triangle_ccw( setup, v0, v1, v2, setup->ccw_is_frontface ))
- assert(0);
+ return;
}
}