From: Brian Paul Date: Sat, 7 Jan 2012 21:16:27 +0000 (-0700) Subject: draw: replace assert(0) with debug_warn_once() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0f623a9075107461438468e1aea6bca3a3234f3;p=mesa.git draw: replace assert(0) with debug_warn_once() If the assertion was hit, it probably meant that we were unable to allocate or map a vertex buffer. Instead of dying in a debug build, issue a warning and continue. --- diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index fbbaa8138f4..942ddc4d7bc 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -150,7 +150,7 @@ draw_pt_emit(struct pt_emit *emit, hw_verts = render->map_vertices( render ); if (!hw_verts) { - assert(0); + debug_warn_once("map of vertex buffer failed (out of memory?)"); return; } @@ -262,7 +262,7 @@ draw_pt_emit_linear(struct pt_emit *emit, return; fail: - assert(0); + debug_warn_once("allocate or map of vertex buffer failed (out of memory?)"); return; } diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c index 84850812f3a..f30db1386cc 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c @@ -201,7 +201,7 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle, hw_verts = draw->render->map_vertices( draw->render ); if (!hw_verts) { - assert(0); + debug_warn_once("vertex buffer allocation failed (out of memory?)"); return; } @@ -292,7 +292,7 @@ static void fetch_emit_run_linear( struct draw_pt_middle_end *middle, return; fail: - assert(0); + debug_warn_once("allocate or map of vertex buffer failed (out of memory?)"); return; } diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index b875f64e3b2..870b23bbf58 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -236,7 +236,7 @@ fse_run_linear(struct draw_pt_middle_end *middle, return; fail: - assert(0); + debug_warn_once("allocate or map of vertex buffer failed (out of memory?)"); return; } @@ -293,7 +293,7 @@ fse_run(struct draw_pt_middle_end *middle, return; fail: - assert(0); + debug_warn_once("allocate or map of vertex buffer failed (out of memory?)"); return; }