summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-04-08 15:30:53 +0100
committerJosé Fonseca <[email protected]>2009-04-08 16:26:05 +0100
commit724929db3ca39ac63ca6f020b3f1faa31948f46b (patch)
tree6facddb708d9b464ca91bae43c93ae2412f57c77 /src/gallium/state_trackers
parent923b4413a63530be37cd44eed29910db21b39ac6 (diff)
python: Cope with null surfaces.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/python/p_state.i16
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 fc8607ba72f..90f157e0ab0 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);