freedreno/a4xx: format updates
[mesa.git] / src / gallium / drivers / rbug / rbug_context.c
index d6fca2e4af62d4838833ce80218c805cd41f12eb..9ecddad05ec762ae722775911a9f595da624adac 100644 (file)
@@ -29,7 +29,7 @@
 #include "pipe/p_context.h"
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
-#include "util/u_simple_list.h"
+#include "util/simple_list.h"
 
 #include "rbug/rbug_context.h"
 
@@ -141,12 +141,14 @@ rbug_create_query(struct pipe_context *_pipe,
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
+   struct pipe_query *query;
 
    pipe_mutex_lock(rb_pipe->call_mutex);
-   return pipe->create_query(pipe,
-                             query_type,
-                             index);
+   query = pipe->create_query(pipe,
+                              query_type,
+                              index);
    pipe_mutex_unlock(rb_pipe->call_mutex);
+   return query;
 }
 
 static void
@@ -162,17 +164,18 @@ rbug_destroy_query(struct pipe_context *_pipe,
    pipe_mutex_unlock(rb_pipe->call_mutex);
 }
 
-static void
+static boolean
 rbug_begin_query(struct pipe_context *_pipe,
                  struct pipe_query *query)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
+   boolean ret;
 
    pipe_mutex_lock(rb_pipe->call_mutex);
-   pipe->begin_query(pipe,
-                     query);
+   ret = pipe->begin_query(pipe, query);
    pipe_mutex_unlock(rb_pipe->call_mutex);
+   return ret;
 }
 
 static void
@@ -803,6 +806,49 @@ rbug_set_sample_mask(struct pipe_context *_pipe,
    pipe_mutex_unlock(rb_pipe->call_mutex);
 }
 
+static struct pipe_stream_output_target *
+rbug_create_stream_output_target(struct pipe_context *_pipe,
+                                 struct pipe_resource *_res,
+                                 unsigned buffer_offset, unsigned buffer_size)
+{
+   struct rbug_context *rb_pipe = rbug_context(_pipe);
+   struct pipe_context *pipe = rb_pipe->pipe;
+   struct pipe_resource *res = rbug_resource_unwrap(_res);
+   struct pipe_stream_output_target *target;
+
+   pipe_mutex_lock(rb_pipe->call_mutex);
+   target = pipe->create_stream_output_target(pipe, res, buffer_offset,
+                                              buffer_size);
+   pipe_mutex_unlock(rb_pipe->call_mutex);
+   return target;
+}
+
+static void
+rbug_stream_output_target_destroy(struct pipe_context *_pipe,
+                                  struct pipe_stream_output_target *target)
+{
+   struct rbug_context *rb_pipe = rbug_context(_pipe);
+   struct pipe_context *pipe = rb_pipe->pipe;
+
+   pipe_mutex_lock(rb_pipe->call_mutex);
+   pipe->stream_output_target_destroy(pipe, target);
+   pipe_mutex_unlock(rb_pipe->call_mutex);
+}
+
+static void
+rbug_set_stream_output_targets(struct pipe_context *_pipe,
+                               unsigned num_targets,
+                               struct pipe_stream_output_target **targets,
+                               const unsigned *offsets)
+{
+   struct rbug_context *rb_pipe = rbug_context(_pipe);
+   struct pipe_context *pipe = rb_pipe->pipe;
+
+   pipe_mutex_lock(rb_pipe->call_mutex);
+   pipe->set_stream_output_targets(pipe, num_targets, targets, offsets);
+   pipe_mutex_unlock(rb_pipe->call_mutex);
+}
+
 static void
 rbug_resource_copy_region(struct pipe_context *_pipe,
                           struct pipe_resource *_dst,
@@ -1174,6 +1220,9 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
    rb_pipe->base.set_vertex_buffers = rbug_set_vertex_buffers;
    rb_pipe->base.set_index_buffer = rbug_set_index_buffer;
    rb_pipe->base.set_sample_mask = rbug_set_sample_mask;
+   rb_pipe->base.create_stream_output_target = rbug_create_stream_output_target;
+   rb_pipe->base.stream_output_target_destroy = rbug_stream_output_target_destroy;
+   rb_pipe->base.set_stream_output_targets = rbug_set_stream_output_targets;
    rb_pipe->base.resource_copy_region = rbug_resource_copy_region;
    rb_pipe->base.blit = rbug_blit;
    rb_pipe->base.flush_resource = rbug_flush_resource;