diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-08-27 17:49:40 +0100 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-09-07 14:01:43 +0100 |
commit | 6419ecd02ce43a2614822e228f306d4db589f317 (patch) | |
tree | 36aeeb7d37fdec2cd5e6a7f72440c3e1fa30c552 /src/gallium/drivers/llvmpipe/lp_setup_point.c | |
parent | c512ba88a7e33f14b86feb9c0aaf1ebed5f50629 (diff) |
llvmpipe: enforce fixed memory limit on scenes
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_point.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_point.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c index 6ae318d328..fd6b53e2bb 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_point.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c @@ -210,8 +210,9 @@ subpixel_snap(float a) } -static void lp_setup_point( struct lp_setup_context *setup, - const float (*v0)[4] ) +static boolean +try_setup_point( struct lp_setup_context *setup, + const float (*v0)[4] ) { /* x/y positions in fixed point */ const int sizeAttr = setup->psize; @@ -259,7 +260,7 @@ static void lp_setup_point( struct lp_setup_context *setup, if (!u_rect_test_intersection(&setup->draw_region, &bbox)) { if (0) debug_printf("offscreen\n"); LP_COUNT(nr_culled_tris); - return; + return TRUE; } u_rect_find_intersection(&setup->draw_region, &bbox); @@ -269,7 +270,7 @@ static void lp_setup_point( struct lp_setup_context *setup, nr_planes, &bytes); if (!point) - return; + return FALSE; #ifdef DEBUG point->v[0][0] = v0[0][0]; @@ -315,7 +316,20 @@ static void lp_setup_point( struct lp_setup_context *setup, point->plane[3].eo = 0; } - lp_setup_bin_triangle(setup, point, &bbox, nr_planes); + return lp_setup_bin_triangle(setup, point, &bbox, nr_planes); +} + + +static void lp_setup_point( struct lp_setup_context *setup, + const float (*v0)[4] ) +{ + if (!try_setup_point( setup, v0 )) + { + lp_setup_flush_and_restart(setup); + + if (!try_setup_point( setup, v0 )) + assert(0); + } } |