diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-04-08 15:30:53 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-04-08 16:26:05 +0100 |
commit | 724929db3ca39ac63ca6f020b3f1faa31948f46b (patch) | |
tree | 6facddb708d9b464ca91bae43c93ae2412f57c77 /src/gallium/state_trackers/python | |
parent | 923b4413a63530be37cd44eed29910db21b39ac6 (diff) | |
download | external_mesa3d-724929db3ca39ac63ca6f020b3f1faa31948f46b.zip external_mesa3d-724929db3ca39ac63ca6f020b3f1faa31948f46b.tar.gz external_mesa3d-724929db3ca39ac63ca6f020b3f1faa31948f46b.tar.bz2 |
python: Cope with null surfaces.
Diffstat (limited to 'src/gallium/state_trackers/python')
-rw-r--r-- | src/gallium/state_trackers/python/p_state.i | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/python/p_state.i b/src/gallium/state_trackers/python/p_state.i index fc8607b..90f157e 100644 --- a/src/gallium/state_trackers/python/p_state.i +++ b/src/gallium/state_trackers/python/p_state.i @@ -66,9 +66,11 @@ if(index >= PIPE_MAX_COLOR_BUFS) SWIG_exception(SWIG_ValueError, "index out of bounds"); - _surface = st_pipe_surface(surface, PIPE_BUFFER_USAGE_GPU_WRITE); - if(!_surface) - SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing"); + if(surface) { + _surface = st_pipe_surface(surface, PIPE_BUFFER_USAGE_GPU_WRITE); + if(!_surface) + SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing"); + } pipe_surface_reference(&$self->cbufs[index], _surface); @@ -81,9 +83,11 @@ { struct pipe_surface *_surface = NULL; - _surface = st_pipe_surface(surface, PIPE_BUFFER_USAGE_GPU_WRITE); - if(!_surface) - SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing"); + if(surface) { + _surface = st_pipe_surface(surface, PIPE_BUFFER_USAGE_GPU_WRITE); + if(!_surface) + SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing"); + } pipe_surface_reference(&$self->zsbuf, _surface); |