Exemplo n.º 1
0
static void
rbug_context_sampler_view_destroy(struct pipe_context *_pipe,
                                  struct pipe_sampler_view *_view)
{
   rbug_sampler_view_destroy(rbug_context(_pipe),
                             rbug_sampler_view(_view));
}
static struct pipe_transfer *
rbug_context_get_transfer(struct pipe_context *_context,
                          struct pipe_resource *_resource,
                          unsigned level,
                          unsigned usage,
                          const struct pipe_box *box)
{
   struct rbug_context *rb_pipe = rbug_context(_context);
   struct rbug_resource *rb_resource = rbug_resource(_resource);
   struct pipe_context *context = rb_pipe->pipe;
   struct pipe_resource *resource = rb_resource->resource;
   struct pipe_transfer *result;

   pipe_mutex_lock(rb_pipe->call_mutex);
   result = context->get_transfer(context,
                                  resource,
                                  level,
                                  usage,
                                  box);
   pipe_mutex_unlock(rb_pipe->call_mutex);

   if (result)
      return rbug_transfer_create(rb_pipe, rb_resource, result);
   return NULL;
}
Exemplo n.º 3
0
static void
rbug_set_vertex_buffers(struct pipe_context *_pipe,
                        unsigned start_slot, unsigned num_buffers,
                        const struct pipe_vertex_buffer *_buffers)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;
   struct pipe_vertex_buffer unwrapped_buffers[PIPE_MAX_SHADER_INPUTS];
   struct pipe_vertex_buffer *buffers = NULL;
   unsigned i;

   pipe_mutex_lock(rb_pipe->call_mutex);

   if (num_buffers) {
      memcpy(unwrapped_buffers, _buffers, num_buffers * sizeof(*_buffers));
      for (i = 0; i < num_buffers; i++)
         unwrapped_buffers[i].buffer = rbug_resource_unwrap(_buffers[i].buffer);
      buffers = unwrapped_buffers;
   }

   pipe->set_vertex_buffers(pipe, start_slot,
                            num_buffers,
                            buffers);

   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 4
0
static void *
rbug_context_transfer_map(struct pipe_context *_context,
                          struct pipe_resource *_resource,
                          unsigned level,
                          unsigned usage,
                          const struct pipe_box *box,
                          struct pipe_transfer **transfer)
{
   struct rbug_context *rb_pipe = rbug_context(_context);
   struct rbug_resource *rb_resource = rbug_resource(_resource);
   struct pipe_context *context = rb_pipe->pipe;
   struct pipe_resource *resource = rb_resource->resource;
   struct pipe_transfer *result;
   void *map;

   pipe_mutex_lock(rb_pipe->call_mutex);
   map = context->transfer_map(context,
                               resource,
                               level,
                               usage,
                               box, &result);
   pipe_mutex_unlock(rb_pipe->call_mutex);

   *transfer = rbug_transfer_create(rb_pipe, rb_resource, result);
   return *transfer ? map : NULL;
}
Exemplo n.º 5
0
static void
rbug_resource_copy_region(struct pipe_context *_pipe,
                          struct pipe_resource *_dst,
                          unsigned dst_level,
                          unsigned dstx,
                          unsigned dsty,
                          unsigned dstz,
                          struct pipe_resource *_src,
                          unsigned src_level,
                          const struct pipe_box *src_box)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   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_resource *dst = rb_resource_dst->resource;
   struct pipe_resource *src = rb_resource_src->resource;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->resource_copy_region(pipe,
                              dst,
                              dst_level,
                              dstx,
                              dsty,
                              dstz,
                              src,
                              src_level,
                              src_box);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 6
0
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_mutex_lock(rb_pipe->call_mutex);
   pipe->clear_depth_stencil(pipe,
                             dst,
                             clear_flags,
                             depth,
                             stencil,
                             dstx,
                             dsty,
                             width,
                             height);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 7
0
static void
rbug_context_transfer_inline_write(struct pipe_context *_context,
                                   struct pipe_resource *_resource,
                                   unsigned level,
                                   unsigned usage,
                                   const struct pipe_box *box,
                                   const void *data,
                                   unsigned stride,
                                   unsigned layer_stride)
{
   struct rbug_context *rb_pipe = rbug_context(_context);
   struct rbug_resource *rb_resource = rbug_resource(_resource);
   struct pipe_context *context = rb_pipe->pipe;
   struct pipe_resource *resource = rb_resource->resource;

   pipe_mutex_lock(rb_pipe->call_mutex);
   context->transfer_inline_write(context,
                                  resource,
                                  level,
                                  usage,
                                  box,
                                  data,
                                  stride,
                                  layer_stride);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 8
0
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);
}
Exemplo n.º 9
0
static void
rbug_set_sample_mask(struct pipe_context *_pipe,
                     unsigned sample_mask)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_sample_mask(pipe, sample_mask);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 10
0
static void
rbug_delete_gs_state(struct pipe_context *_pipe,
                     void *_gs)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct rbug_shader *rb_shader = rbug_shader(_gs);

   pipe_mutex_lock(rb_pipe->call_mutex);
   rbug_shader_destroy(rb_pipe, rb_shader);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 11
0
static void
rbug_bind_sampler_states(struct pipe_context *_pipe, unsigned shader,
                         unsigned start, unsigned count,
                         void **samplers)
{
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;

    pipe_mutex_lock(rb_pipe->call_mutex);
    pipe->bind_sampler_states(pipe, shader, start, count, samplers);
    pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 12
0
static void
rbug_delete_blend_state(struct pipe_context *_pipe,
                        void *blend)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->delete_blend_state(pipe,
                            blend);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 13
0
static void
rbug_set_clip_state(struct pipe_context *_pipe,
                    const struct pipe_clip_state *clip)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_clip_state(pipe,
                        clip);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 14
0
static void
rbug_set_polygon_stipple(struct pipe_context *_pipe,
                         const struct pipe_poly_stipple *poly_stipple)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_polygon_stipple(pipe,
                             poly_stipple);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 15
0
static void
rbug_set_blend_color(struct pipe_context *_pipe,
                     const struct pipe_blend_color *blend_color)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_blend_color(pipe,
                         blend_color);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 16
0
static void
rbug_set_stencil_ref(struct pipe_context *_pipe,
                     const struct pipe_stencil_ref *stencil_ref)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_stencil_ref(pipe,
                         stencil_ref);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
rbug_context_transfer_destroy(struct pipe_context *_pipe,
                              struct pipe_transfer *_transfer)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct rbug_transfer *rb_transfer =rbug_transfer(_transfer);

   pipe_mutex_lock(rb_pipe->call_mutex);
   rbug_transfer_destroy(rb_pipe,
                         rb_transfer);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
rbug_set_viewport_state(struct pipe_context *_pipe,
                        const struct pipe_viewport_state *viewport)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_viewport_state(pipe,
                            viewport);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 19
0
static void
rbug_delete_depth_stencil_alpha_state(struct pipe_context *_pipe,
                                      void *depth_stencil_alpha)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->delete_depth_stencil_alpha_state(pipe,
                                          depth_stencil_alpha);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 20
0
static void
rbug_delete_rasterizer_state(struct pipe_context *_pipe,
                             void *rasterizer)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->delete_rasterizer_state(pipe,
                                 rasterizer);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 21
0
static void
rbug_context_surface_destroy(struct pipe_context *_pipe,
                             struct pipe_surface *_surface)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct rbug_surface *rb_surface = rbug_surface(_surface);

   pipe_mutex_lock(rb_pipe->call_mutex);
   rbug_surface_destroy(rb_pipe,
                        rb_surface);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 22
0
static void
rbug_end_query(struct pipe_context *_pipe,
               struct pipe_query *query)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->end_query(pipe,
                   query);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 23
0
static struct pipe_query *
rbug_create_query(struct pipe_context *_pipe,
                  unsigned query_type)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   return pipe->create_query(pipe,
                             query_type);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 24
0
static void
rbug_delete_vertex_elements_state(struct pipe_context *_pipe,
                                  void *velems)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->delete_vertex_elements_state(pipe,
                                      velems);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
rbug_set_scissor_state(struct pipe_context *_pipe,
                       const struct pipe_scissor_state *scissor)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_scissor_state(pipe,
                           scissor);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 26
0
static void
rbug_flush(struct pipe_context *_pipe,
           struct pipe_fence_handle **fence,
           unsigned flags)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->flush(pipe, fence, flags);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 27
0
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);
}
Exemplo n.º 28
0
static void
rbug_flush_resource(struct pipe_context *_pipe,
                    struct pipe_resource *_res)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct rbug_resource *rb_resource_res = rbug_resource(_res);
   struct pipe_context *pipe = rb_pipe->pipe;
   struct pipe_resource *res = rb_resource_res->resource;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->flush_resource(pipe, res);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 29
0
static void
rbug_set_scissor_states(struct pipe_context *_pipe,
                        unsigned start_slot,
                        unsigned num_scissors,
                        const struct pipe_scissor_state *scissor)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_scissor_states(pipe, start_slot, num_scissors, scissor);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}
Exemplo n.º 30
0
static void
rbug_set_viewport_states(struct pipe_context *_pipe,
                         unsigned start_slot,
                         unsigned num_viewports,
                         const struct pipe_viewport_state *viewport)
{
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->set_viewport_states(pipe, start_slot, num_viewports, viewport);
   pipe_mutex_unlock(rb_pipe->call_mutex);
}