From eb168e26aa63f11a47d70c4555cae30691a2cd57 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sat, 4 Apr 2009 19:01:51 +0200 Subject: gallium: Clean up driver clear() interface. Only allows clearing currently bound buffers, but colour and depth/stencil in a single call. --- src/gallium/state_trackers/python/p_context.i | 41 ++------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'src/gallium/state_trackers/python/p_context.i') diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i index a0bf063d81..9a3003a56c 100644 --- a/src/gallium/state_trackers/python/p_context.i +++ b/src/gallium/state_trackers/python/p_context.i @@ -308,45 +308,10 @@ error1: pipe_surface_reference(&_dst, NULL); } - void surface_clear(struct st_surface *surface, unsigned value = 0) + void clear(unsigned buffers, const float *rgba, double depth = 0.0f, + unsigned stencil = 0) { - unsigned i; - struct pipe_surface *_surface = NULL; - - if(!surface) - SWIG_exception(SWIG_TypeError, "surface must not be null"); - - for(i = 0; i < $self->framebuffer.nr_cbufs; ++i) { - struct pipe_surface *cbuf = $self->framebuffer.cbufs[i]; - if(cbuf) { - if(cbuf->texture == surface->texture && - cbuf->face == surface->face && - cbuf->level == surface->level && - cbuf->zslice == surface->zslice) { - _surface = cbuf; - break; - } - } - } - - if(!_surface) { - struct pipe_surface *zsbuf = $self->framebuffer.zsbuf; - if(zsbuf) { - if(zsbuf->texture == surface->texture && - zsbuf->face == surface->face && - zsbuf->level == surface->level && - zsbuf->zslice == surface->zslice) { - _surface = zsbuf; - } - } - } - - if(!_surface) - SWIG_exception(SWIG_ValueError, "surface not bound"); - - $self->pipe->clear($self->pipe, _surface, value); - fail: - return; + $self->pipe->clear($self->pipe, buffers, rgba, depth, stencil); } }; -- cgit v1.2.3