Merge branch 'gallium-newclear'
[mesa.git] / src / gallium / state_trackers / python / p_context.i
index 13c8d1a95e99f97055739ef1aac9ed4bdf975090..cf0144b5dc60ac99b4c1359fbc6c2d3f8164adac 100644 (file)
@@ -312,22 +312,24 @@ struct st_context {
    }
 
    void draw_elements( struct pipe_resource *indexBuffer,
-                       unsigned indexSize,
+                       unsigned indexSize, int indexBias,
                        unsigned mode, unsigned start, unsigned count) 
    {
       $self->pipe->draw_elements($self->pipe, 
                                  indexBuffer, 
                                  indexSize, 
+                                 indexBias,
                                  mode, start, count);
    }
 
    void draw_range_elements( struct pipe_resource *indexBuffer,
-                             unsigned indexSize, unsigned minIndex, unsigned maxIndex,
+                             unsigned indexSize, int indexBias,
+                             unsigned minIndex, unsigned maxIndex,
                              unsigned mode, unsigned start, unsigned count)
    {
       $self->pipe->draw_range_elements($self->pipe, 
-                                       indexBuffer, 
-                                       indexSize, minIndex, maxIndex,
+                                       indexBuffer, indexSize, indexBias,
+                                       minIndex, maxIndex,
                                        mode, start, count);
    }
 
@@ -411,44 +413,55 @@ error1:
    /*
     * Surface functions
     */
-   
-   void surface_copy(struct st_surface *dst,
-                     unsigned destx, unsigned desty,
-                     struct st_surface *src,
-                     unsigned srcx, unsigned srcy,
-                     unsigned width, unsigned height) 
+
+   void resource_copy_region(struct pipe_resource *dst,
+                             struct pipe_subresource subdst,
+                             unsigned dstx, unsigned dsty, unsigned dstz,
+                             struct pipe_resource *src,
+                             struct pipe_subresource subsrc,
+                             unsigned srcx, unsigned srcy, unsigned srcz,
+                             unsigned width, unsigned height)
+   {
+      $self->pipe->resource_copy_region($self->pipe,
+                                        dst, subdst, dstx, dsty, dstz,
+                                        src, subsrc, srcx, srcy, srcz,
+                                        width, height);
+   }
+
+
+   void clear_render_target(struct st_surface *dst,
+                            float *rgba,
+                            unsigned x, unsigned y,
+                            unsigned width, unsigned height)
    {
       struct pipe_surface *_dst = NULL;
-      struct pipe_surface *_src = 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");
 
-      _src = st_pipe_surface(src, PIPE_BIND_BLIT_SOURCE);
-      if(!_src)
-         SWIG_exception(SWIG_ValueError, "couldn't acquire source surface for reading");
-      
-      $self->pipe->surface_copy($self->pipe, _dst, destx, desty, _src, srcx, srcy, width, height);
-      
+      $self->pipe->clear_render_target($self->pipe, _dst, rgba, x, y, width, height);
+
    fail:
-      pipe_surface_reference(&_src, NULL);
       pipe_surface_reference(&_dst, NULL);
    }
 
-   void surface_fill(struct st_surface *dst,
-                     unsigned x, unsigned y,
-                     unsigned width, unsigned height,
-                     unsigned value) 
+   void clear_depth_stencil(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_BLIT_DESTINATION);
+
+     _dst = st_pipe_surface(dst, PIPE_BIND_DEPTH_STENCIL);
       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->clear_depth_stencil($self->pipe, _dst, clear_flags, depth, stencil,
+                                       x, y, width, height);
+
    fail:
       pipe_surface_reference(&_dst, NULL);
    }