summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-21 17:03:37 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-21 17:03:37 +0100
commit0d4ece4c5a243dc4b684331bad49f220311e5520 (patch)
tree8678f1241e5b47a6603da13b25a5844c92b8986c /src/gallium/auxiliary/draw/draw_pipe_pstipple.c
parent0cd90a917d289363a3edb5cfa40c391eb07aa97c (diff)
draw: propogate lots of errors
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 5686729cd3..ac08aa10ce 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -686,7 +686,7 @@ pstip_set_polygon_stipple(struct pipe_context *pipe,
* into the draw module's pipeline. This will not be used if the
* hardware has native support for AA lines.
*/
-void
+boolean
draw_install_pstipple_stage(struct draw_context *draw,
struct pipe_context *pipe)
{
@@ -698,7 +698,9 @@ draw_install_pstipple_stage(struct draw_context *draw,
* Create / install AA line drawing / prim stage
*/
pstip = draw_pstip_stage( draw );
- assert(pstip);
+ if (pstip == NULL)
+ goto fail;
+
draw->pipeline.pstipple = &pstip->stage;
pstip->pipe = pipe;
@@ -724,4 +726,12 @@ draw_install_pstipple_stage(struct draw_context *draw,
pipe->bind_sampler_states = pstip_bind_sampler_states;
pipe->set_sampler_textures = pstip_set_sampler_textures;
pipe->set_polygon_stipple = pstip_set_polygon_stipple;
+
+ return TRUE;
+
+ fail:
+ if (pstip)
+ pstip->stage.destroy( &pstip->stage );
+
+ return FALSE;
}