gallium: adjust the query interface to support custom types
[profile/ivi/mesa.git] / src / gallium / drivers / rbug / rbug_context.c
index 59f005e..00b167e 100644 (file)
@@ -241,7 +241,7 @@ static boolean
 rbug_get_query_result(struct pipe_context *_pipe,
                       struct pipe_query *query,
                       boolean wait,
-                      uint64_t *result)
+                      void *result)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
@@ -751,56 +751,52 @@ rbug_set_vertex_buffers(struct pipe_context *_pipe,
                             num_buffers,
                             buffers);
 }
+
 static void
-rbug_surface_copy(struct pipe_context *_pipe,
-                  struct pipe_surface *_dst,
-                  unsigned dstx,
-                  unsigned dsty,
-                  struct pipe_surface *_src,
-                  unsigned srcx,
-                  unsigned srcy,
-                  unsigned width,
-                  unsigned height)
+rbug_set_sample_mask(struct pipe_context *_pipe,
+                     unsigned sample_mask)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
-   struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
-   struct rbug_surface *rb_surface_src = rbug_surface(_src);
    struct pipe_context *pipe = rb_pipe->pipe;
-   struct pipe_surface *dst = rb_surface_dst->surface;
-   struct pipe_surface *src = rb_surface_src->surface;
-
-   pipe->surface_copy(pipe,
-                      dst,
-                      dstx,
-                      dsty,
-                      src,
-                      srcx,
-                      srcy,
-                      width,
-                      height);
+
+   pipe->set_sample_mask(pipe, sample_mask);
 }
 
 static void
-rbug_surface_fill(struct pipe_context *_pipe,
-                  struct pipe_surface *_dst,
-                  unsigned dstx,
-                  unsigned dsty,
-                  unsigned width,
-                  unsigned height,
-                  unsigned value)
+rbug_resource_copy_region(struct pipe_context *_pipe,
+                          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)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
-   struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
+   struct rbug_resource *rb_resource_dst = rbug_resource(_dst);
+   struct rbug_resource *rb_resource_src = rbug_resource(_src);
    struct pipe_context *pipe = rb_pipe->pipe;
-   struct pipe_surface *dst = rb_surface_dst->surface;
-
-   pipe->surface_fill(pipe,
-                      dst,
-                      dstx,
-                      dsty,
-                      width,
-                      height,
-                      value);
+   struct pipe_resource *dst = rb_resource_dst->resource;
+   struct pipe_resource *src = rb_resource_src->resource;
+
+   pipe->resource_copy_region(pipe,
+                              dst,
+                              subdst,
+                              dstx,
+                              dsty,
+                              dstz,
+                              src,
+                              subsrc,
+                              srcx,
+                              srcy,
+                              srcz,
+                              width,
+                              height);
 }
 
 static void
@@ -821,6 +817,52 @@ rbug_clear(struct pipe_context *_pipe,
 }
 
 static void
+rbug_clear_render_target(struct pipe_context *_pipe,
+                         struct pipe_surface *_dst,
+                         const float *rgba,
+                         unsigned dstx, unsigned dsty,
+                         unsigned width, unsigned height)
+{
+   struct rbug_context *rb_pipe = rbug_context(_pipe);
+   struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
+   struct pipe_context *pipe = rb_pipe->pipe;
+   struct pipe_surface *dst = rb_surface_dst->surface;
+
+   pipe->clear_render_target(pipe,
+                             dst,
+                             rgba,
+                             dstx,
+                             dsty,
+                             width,
+                             height);
+}
+
+static void
+rbug_clear_depth_stencil(struct pipe_context *_pipe,
+                         struct pipe_surface *_dst,
+                         unsigned clear_flags,
+                         double depth,
+                         unsigned stencil,
+                         unsigned dstx, unsigned dsty,
+                         unsigned width, unsigned height)
+{
+   struct rbug_context *rb_pipe = rbug_context(_pipe);
+   struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
+   struct pipe_context *pipe = rb_pipe->pipe;
+   struct pipe_surface *dst = rb_surface_dst->surface;
+
+   pipe->clear_depth_stencil(pipe,
+                             dst,
+                             clear_flags,
+                             depth,
+                             stencil,
+                             dstx,
+                             dsty,
+                             width,
+                             height);
+}
+
+static void
 rbug_flush(struct pipe_context *_pipe,
            unsigned flags,
            struct pipe_fence_handle **fence)
@@ -1050,9 +1092,11 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
    rb_pipe->base.set_fragment_sampler_views = rbug_set_fragment_sampler_views;
    rb_pipe->base.set_vertex_sampler_views = rbug_set_vertex_sampler_views;
    rb_pipe->base.set_vertex_buffers = rbug_set_vertex_buffers;
-   rb_pipe->base.surface_copy = rbug_surface_copy;
-   rb_pipe->base.surface_fill = rbug_surface_fill;
+   rb_pipe->base.set_sample_mask = rbug_set_sample_mask;
+   rb_pipe->base.resource_copy_region = rbug_resource_copy_region;
    rb_pipe->base.clear = rbug_clear;
+   rb_pipe->base.clear_render_target = rbug_clear_render_target;
+   rb_pipe->base.clear_depth_stencil = rbug_clear_depth_stencil;
    rb_pipe->base.flush = rbug_flush;
    rb_pipe->base.is_resource_referenced = rbug_is_resource_referenced;
    rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view;