st/python: adapt to clear interface changes
authorRoland Scheidegger <sroland@vmware.com>
Fri, 28 May 2010 23:18:17 +0000 (01:18 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 28 May 2010 23:18:17 +0000 (01:18 +0200)
src/gallium/state_trackers/python/p_context.i

index 3d7b640b47281ea1ddc6b703cbda318ac1a46ee8..6a6da1477cf9fce26a692aa7ba71c4bae0d6b927 100644 (file)
@@ -447,28 +447,41 @@ error1:
                                      src->texture, subsrc, srcx, srcy, src->zslice, width, height);
    }
 
-   void surface_fill(struct st_surface *dst,
-                     unsigned x, unsigned y,
-                     unsigned width, unsigned height,
-                     unsigned value) 
+   void clearRT(struct st_surface *dst,
+                float *rgba,
+                unsigned x, unsigned y,
+                unsigned width, unsigned height)
    {
-/* XXX
       struct pipe_surface *_dst = NULL;
 
-     _dst = st_pipe_surface(dst, PIPE_BIND_BLIT_DESTINATION);
+     _dst = st_pipe_surface(dst, PIPE_BIND_RENDER_TARGET);
       if(!_dst)
          SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
 
-      $self->pipe->surface_fill($self->pipe, _dst, x, y, width, height, value);
+      $self->pipe->clearRT($self->pipe, _dst, rgba, x, y, width, height);
+
+   fail:
+      pipe_surface_reference(&_dst, NULL);
+   }
+
+   void clearDS(struct st_surface *dst,
+                unsigned clear_flags,
+                double depth,
+                unsigned stencil,
+                unsigned x, unsigned y,
+                unsigned width, unsigned height)
+   {
+      struct pipe_surface *_dst = NULL;
+
+     _dst = st_pipe_surface(dst, PIPE_BIND_DEPTH_STENCIL);
+      if(!_dst)
+         SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
+
+      $self->pipe->clearDS($self->pipe, _dst, clear_flags, depth, stencil,
+                           x, y, width, height);
 
    fail:
       pipe_surface_reference(&_dst, NULL);
-*/
-   struct pipe_subresource subdst;
-   subdst.face = dst->face;
-   subdst.level = dst->level;
-   $self->pipe->resource_fill_region($self->pipe, dst->texture, subdst, x, y, dst->zslice,
-                                     width, height, value);
    }
 
    %cstring_output_allocate_size(char **STRING, int *LENGTH, free(*$1));