diff options
author | José Fonseca <jfonseca@vmware.com> | 2012-06-20 14:25:46 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-01-23 15:49:32 +0000 |
commit | 840154dc5002f7291aa2ece5322be7c2e40d9b6d (patch) | |
tree | ab91aef98add0be634a71b2d6a20371da709e8a1 /src/gallium/auxiliary/draw/draw_pipe_pstipple.c | |
parent | 1a441805781382067e92cd9f3b324f23164c3024 (diff) |
draw: Save original driver functions earlier.
Otherwise they will be NULL when stage destroy is invoked prematurely,
(i.e, on out of memory).
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 73da96677f..d7dcfdb596 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -794,13 +794,6 @@ draw_install_pstipple_stage(struct draw_context *draw, draw->pipeline.pstipple = &pstip->stage; - /* create special texture, sampler state */ - if (!pstip_create_texture(pstip)) - goto fail; - - if (!pstip_create_sampler(pstip)) - goto fail; - /* save original driver functions */ pstip->driver_create_fs_state = pipe->create_fs_state; pstip->driver_bind_fs_state = pipe->bind_fs_state; @@ -810,6 +803,13 @@ draw_install_pstipple_stage(struct draw_context *draw, pstip->driver_set_sampler_views = pipe->set_sampler_views; pstip->driver_set_polygon_stipple = pipe->set_polygon_stipple; + /* create special texture, sampler state */ + if (!pstip_create_texture(pstip)) + goto fail; + + if (!pstip_create_sampler(pstip)) + goto fail; + /* override the driver's functions */ pipe->create_fs_state = pstip_create_fs_state; pipe->bind_fs_state = pstip_bind_fs_state; |