Ejemplo n.º 1
0
static INLINE void *
trace_context_create_depth_stencil_alpha_state(struct pipe_context *_pipe,
                                               const struct pipe_depth_stencil_alpha_state *state)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;
   void * result;

   trace_dump_call_begin("pipe_context", "create_depth_stencil_alpha_state");

   result = pipe->create_depth_stencil_alpha_state(pipe, state);;

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(depth_stencil_alpha_state, state);

   trace_dump_ret(ptr, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 2
0
static INLINE struct pipe_query *
trace_context_create_query(struct pipe_context *_pipe,
                           unsigned query_type)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_query *result;

   trace_dump_call_begin("pipe_context", "create_query");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(uint, query_type);

   result = pipe->create_query(pipe, query_type);

   trace_dump_ret(ptr, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 3
0
static unsigned int
trace_is_buffer_referenced( struct pipe_context *_pipe,
			    struct pipe_buffer *_buf)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct trace_buffer *tr_buf = trace_buffer(_buf);
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_buffer *buf = tr_buf->buffer;
   unsigned int referenced;

   trace_dump_call_begin("pipe_context", "is_buffer_referenced");
   trace_dump_arg(ptr, pipe);
   trace_dump_arg(ptr, buf);

   referenced = pipe->is_buffer_referenced(pipe, buf);

   trace_dump_ret(uint, referenced);
   trace_dump_call_end();

   return referenced;
}
Ejemplo n.º 4
0
static INLINE void
trace_context_set_vertex_elements(struct pipe_context *_pipe,
                                  unsigned num_elements,
                                  const struct pipe_vertex_element *elements)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;

   trace_dump_call_begin("pipe_context", "set_vertex_elements");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(uint, num_elements);

   trace_dump_arg_begin("elements");
   trace_dump_struct_array(vertex_element, elements, num_elements);
   trace_dump_arg_end();

   pipe->set_vertex_elements(pipe, num_elements, elements);

   trace_dump_call_end();
}
Ejemplo n.º 5
0
static INLINE void
trace_context_set_framebuffer_state(struct pipe_context *_pipe,
                                    const struct pipe_framebuffer_state *state)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_framebuffer_state unwrapped_state;
   unsigned i;

   {
      tr_ctx->curr.nr_cbufs = state->nr_cbufs;
      for (i = 0; i < state->nr_cbufs; i++)
         if (state->cbufs[i])
            tr_ctx->curr.cbufs[i] = trace_texture(state->cbufs[i]->texture);
         else
            tr_ctx->curr.cbufs[i] = NULL;
      if (state->zsbuf)
         tr_ctx->curr.zsbuf = trace_texture(state->zsbuf->texture);
      else
         tr_ctx->curr.zsbuf = NULL;
   }

   /* Unwrap the input state */
   memcpy(&unwrapped_state, state, sizeof(unwrapped_state));
   for(i = 0; i < state->nr_cbufs; ++i)
      unwrapped_state.cbufs[i] = trace_surface_unwrap(tr_ctx, state->cbufs[i]);
   for(i = state->nr_cbufs; i < PIPE_MAX_COLOR_BUFS; ++i)
      unwrapped_state.cbufs[i] = NULL;
   unwrapped_state.zsbuf = trace_surface_unwrap(tr_ctx, state->zsbuf);
   state = &unwrapped_state;

   trace_dump_call_begin("pipe_context", "set_framebuffer_state");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(framebuffer_state, state);

   pipe->set_framebuffer_state(pipe, state);

   trace_dump_call_end();
}
Ejemplo n.º 6
0
static struct pipe_surface *
trace_screen_get_tex_surface(struct pipe_screen *_screen,
                             struct pipe_resource *_texture,
                             unsigned face, unsigned level,
                             unsigned zslice,
                             unsigned usage)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct trace_resource *tr_tex = trace_resource(_texture);
   struct pipe_screen *screen = tr_scr->screen;
   struct pipe_resource *texture = tr_tex->resource;
   struct pipe_surface *result = NULL;

   assert(texture->screen == screen);

   trace_dump_call_begin("pipe_screen", "get_tex_surface");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(ptr, texture);
   trace_dump_arg(uint, face);
   trace_dump_arg(uint, level);
   trace_dump_arg(uint, zslice);
   trace_dump_arg(uint, usage);

   result = screen->get_tex_surface(screen, texture, face, level, zslice, usage);

   trace_dump_ret(ptr, result);

   trace_dump_call_end();

   result = trace_surface_create(tr_tex, result);

   return result;
}
Ejemplo n.º 7
0
static INLINE void
trace_context_draw_elements(struct pipe_context *_pipe,
                          struct pipe_buffer *_indexBuffer,
                          unsigned indexSize,
                          unsigned mode, unsigned start, unsigned count)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct trace_buffer *tr_buf = trace_buffer(_indexBuffer);
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_buffer *indexBuffer = tr_buf->buffer;

   if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
      return;

   trace_context_draw_block(tr_ctx, 1);

   trace_screen_user_buffer_update(_pipe->screen, indexBuffer);

   trace_dump_call_begin("pipe_context", "draw_elements");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(ptr, indexBuffer);
   trace_dump_arg(uint, indexSize);
   trace_dump_arg(uint, mode);
   trace_dump_arg(uint, start);
   trace_dump_arg(uint, count);

   pipe->draw_elements(pipe, indexBuffer, indexSize, mode, start, count);

   trace_dump_call_end();

   trace_context_draw_block(tr_ctx, 2);
}
Ejemplo n.º 8
0
static INLINE void
trace_context_surface_fill(struct pipe_context *_pipe,
                           struct pipe_surface *dst,
                           unsigned dstx, unsigned dsty,
                           unsigned width, unsigned height,
                           unsigned value)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;

   dst = trace_surface_unwrap(tr_ctx, dst);

   trace_dump_call_begin("pipe_context", "surface_fill");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(ptr, dst);
   trace_dump_arg(uint, dstx);
   trace_dump_arg(uint, dsty);
   trace_dump_arg(uint, width);
   trace_dump_arg(uint, height);

   pipe->surface_fill(pipe, dst, dstx, dsty, width, height, value);

   trace_dump_call_end();
}
Ejemplo n.º 9
0
static int
trace_screen_get_compute_param(struct pipe_screen *_screen,
                               enum pipe_compute_cap param, void *data)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   int result;

   trace_dump_call_begin("pipe_screen", "get_compute_param");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(int, param);
   trace_dump_arg(ptr, data);

   result = screen->get_compute_param(screen, param, data);

   trace_dump_ret(int, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 10
0
static void
trace_screen_fence_reference(struct pipe_screen *_screen,
                             struct pipe_fence_handle **pdst,
                             struct pipe_fence_handle *src)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   struct pipe_fence_handle *dst;

   assert(pdst);
   dst = *pdst;
   
   trace_dump_call_begin("pipe_screen", "fence_reference");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(ptr, dst);
   trace_dump_arg(ptr, src);

   screen->fence_reference(screen, pdst, src);

   trace_dump_call_end();
}
Ejemplo n.º 11
0
static INLINE void
trace_context_clear(struct pipe_context *_pipe,
                    unsigned buffers,
                    const float *rgba,
                    double depth,
                    unsigned stencil)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;

   trace_dump_call_begin("pipe_context", "clear");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(uint, buffers);
   trace_dump_arg_array(float, rgba, 4);
   trace_dump_arg(float, depth);
   trace_dump_arg(uint, stencil);

   pipe->clear(pipe, buffers, rgba, depth, stencil);

   trace_dump_call_end();
}
Ejemplo n.º 12
0
static void
trace_screen_flush_frontbuffer(struct pipe_screen *_screen,
                               struct pipe_surface *_surface,
                               void *context_private)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct trace_surface *tr_surf = trace_surface(_surface);
   struct pipe_screen *screen = tr_scr->screen;
   struct pipe_surface *surface = tr_surf->surface;

   trace_dump_call_begin("pipe_screen", "flush_frontbuffer");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(ptr, surface);
   /* XXX: hide, as there is nothing we can do with this
   trace_dump_arg(ptr, context_private);
   */

   screen->flush_frontbuffer(screen, surface, context_private);

   trace_dump_call_end();
}
Ejemplo n.º 13
0
static int
trace_screen_get_shader_param(struct pipe_screen *_screen, unsigned shader,
                       enum pipe_shader_cap param)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   int result;

   trace_dump_call_begin("pipe_screen", "get_shader_param");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(uint, shader);
   trace_dump_arg(int, param);

   result = screen->get_shader_param(screen, shader, param);

   trace_dump_ret(int, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 14
0
static struct pipe_resource *
trace_screen_resource_create(struct pipe_screen *_screen,
                            const struct pipe_resource *templat)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   struct pipe_resource *result;

   trace_dump_call_begin("pipe_screen", "resource_create");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(resource_template, templat);

   result = screen->resource_create(screen, templat);

   trace_dump_ret(ptr, result);

   trace_dump_call_end();

   result = trace_resource_create(tr_scr, result);

   return result;
}
Ejemplo n.º 15
0
static INLINE void *
trace_context_create_vs_state(struct pipe_context *_pipe,
                              const struct pipe_shader_state *state)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;
   void * result;

   trace_dump_call_begin("pipe_context", "create_vs_state");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(shader_state, state);

   result = pipe->create_vs_state(pipe, state);

   trace_dump_ret(ptr, result);

   trace_dump_call_end();

   result = trace_shader_create(tr_ctx, state, result, TRACE_SHADER_VERTEX);

   return result;
}
Ejemplo n.º 16
0
static void
trace_screen_destroy(struct pipe_screen *_screen)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;

   trace_dump_call_begin("pipe_screen", "destroy");
   trace_dump_arg(ptr, screen);
   trace_dump_call_end();

   screen->destroy(screen);

   FREE(tr_scr);
}
Ejemplo n.º 17
0
static INLINE void
trace_context_bind_vs_state(struct pipe_context *_pipe,
                            void *_state)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct trace_shader *tr_shdr = trace_shader(_state);
   struct pipe_context *pipe = tr_ctx->pipe;
   void *state = tr_shdr ? tr_shdr->state : NULL;

   trace_dump_call_begin("pipe_context", "bind_vs_state");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(ptr, state);

   tr_ctx->curr.vs = tr_shdr;

   if (tr_shdr && tr_shdr->replaced)
      state = tr_shdr->replaced;

   pipe->bind_vs_state(pipe, state);

   trace_dump_call_end();
}
Ejemplo n.º 18
0
static boolean
trace_screen_fence_finish(struct pipe_screen *_screen,
                          struct pipe_fence_handle *fence,
                          uint64_t timeout)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   int result;

   trace_dump_call_begin("pipe_screen", "fence_finish");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(ptr, fence);
   trace_dump_arg(uint, timeout);

   result = screen->fence_finish(screen, fence, timeout);

   trace_dump_ret(bool, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 19
0
static int
trace_winsys_fence_finish(struct pipe_winsys *_winsys,
                          struct pipe_fence_handle *fence,
                          unsigned flag)
{
   struct trace_winsys *tr_ws = trace_winsys(_winsys);
   struct pipe_winsys *winsys = tr_ws->winsys;
   int result;
   
   trace_dump_call_begin("pipe_winsys", "fence_finish");
   
   trace_dump_arg(ptr, winsys);
   trace_dump_arg(ptr, fence);
   trace_dump_arg(uint, flag);

   result = winsys->fence_finish(winsys, fence, flag);
   
   trace_dump_ret(int, result);
   
   trace_dump_call_end();
   
   return result;
}
Ejemplo n.º 20
0
static int
trace_screen_fence_finish(struct pipe_screen *_screen,
                          struct pipe_fence_handle *fence,
                          unsigned flags)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   int result;

   trace_dump_call_begin("pipe_screen", "fence_finish");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(ptr, fence);
   trace_dump_arg(uint, flags);

   result = screen->fence_finish(screen, fence, flags);

   trace_dump_ret(int, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 21
0
static INLINE boolean
trace_context_draw_range_elements(struct pipe_context *_pipe,
                                  struct pipe_buffer *_indexBuffer,
                                  unsigned indexSize,
                                  unsigned minIndex,
                                  unsigned maxIndex,
                                  unsigned mode,
                                  unsigned start,
                                  unsigned count)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct trace_buffer *tr_buf = trace_buffer(_indexBuffer);
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_buffer *indexBuffer = tr_buf->buffer;
   boolean result;

   if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
      return 0;

   trace_context_draw_block(tr_ctx, 1);

   trace_screen_user_buffer_update(_pipe->screen, indexBuffer);

   trace_dump_call_begin("pipe_context", "draw_range_elements");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(ptr, indexBuffer);
   trace_dump_arg(uint, indexSize);
   trace_dump_arg(uint, minIndex);
   trace_dump_arg(uint, maxIndex);
   trace_dump_arg(uint, mode);
   trace_dump_arg(uint, start);
   trace_dump_arg(uint, count);

   result = pipe->draw_range_elements(pipe,
                                      indexBuffer,
                                      indexSize, minIndex, maxIndex,
                                      mode, start, count);

   trace_dump_ret(bool, result);

   trace_dump_call_end();

   trace_context_draw_block(tr_ctx, 2);

   return result;
}
Ejemplo n.º 22
0
static unsigned int
trace_is_texture_referenced( struct pipe_context *_pipe,
			    struct pipe_texture *_texture,
			    unsigned face, unsigned level)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct trace_texture *tr_tex = trace_texture(_texture);
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_texture *texture = tr_tex->texture;
   unsigned int referenced;

   trace_dump_call_begin("pipe_context", "is_texture_referenced");
   trace_dump_arg(ptr, pipe);
   trace_dump_arg(ptr, texture);
   trace_dump_arg(uint, face);
   trace_dump_arg(uint, level);

   referenced = pipe->is_texture_referenced(pipe, texture, face, level);

   trace_dump_ret(uint, referenced);
   trace_dump_call_end();

   return referenced;
}
Ejemplo n.º 23
0
static INLINE void
trace_context_set_constant_buffer(struct pipe_context *_pipe,
                                  uint shader, uint index,
                                  struct pipe_buffer *buffer)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;

   if (buffer) {
      trace_screen_user_buffer_update(_pipe->screen, buffer);
      buffer = trace_buffer_unwrap(tr_ctx, buffer);
   }

   trace_dump_call_begin("pipe_context", "set_constant_buffer");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(uint, shader);
   trace_dump_arg(uint, index);
   trace_dump_arg(ptr, buffer);

   pipe->set_constant_buffer(pipe, shader, index, buffer);

   trace_dump_call_end();
}
Ejemplo n.º 24
0
static struct pipe_context *
trace_screen_context_create(struct pipe_screen *_screen, void *priv,
                            unsigned flags)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   struct pipe_context *result;

   trace_dump_call_begin("pipe_screen", "context_create");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(ptr, priv);
   trace_dump_arg(uint, flags);

   result = screen->context_create(screen, priv, flags);

   trace_dump_ret(ptr, result);

   trace_dump_call_end();

   result = trace_context_create(tr_scr, result);

   return result;
}
Ejemplo n.º 25
0
static INLINE void
trace_context_destroy(struct pipe_context *_pipe)
{
   struct trace_screen *tr_scr = trace_screen(_pipe->screen);
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct pipe_context *pipe = tr_ctx->pipe;

   trace_dump_call_begin("pipe_context", "destroy");
   trace_dump_arg(ptr, pipe);
   trace_dump_call_end();

   trace_screen_remove_from_list(tr_scr, contexts, tr_ctx);

   pipe->destroy(pipe);

   FREE(tr_ctx);
}
Ejemplo n.º 26
0
static uint64_t
trace_screen_get_timestamp(struct pipe_screen *_screen)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   uint64_t result;

   trace_dump_call_begin("pipe_screen", "get_timestamp");
   trace_dump_arg(ptr, screen);

   result = screen->get_timestamp(screen);

   trace_dump_ret(uint, result);
   trace_dump_call_end();

   return result;
}
Ejemplo n.º 27
0
static const char *
trace_screen_get_vendor(struct pipe_screen *_screen)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   const char *result;

   trace_dump_call_begin("pipe_screen", "get_vendor");

   trace_dump_arg(ptr, screen);

   result = screen->get_vendor(screen);

   trace_dump_ret(string, result);

   trace_dump_call_end();

   return result;
}
Ejemplo n.º 28
0
static const char *
trace_winsys_get_name(struct pipe_winsys *_winsys)
{
   struct trace_winsys *tr_ws = trace_winsys(_winsys);
   struct pipe_winsys *winsys = tr_ws->winsys;
   const char *result;
   
   trace_dump_call_begin("pipe_winsys", "get_name");
   
   trace_dump_arg(ptr, winsys);

   result = winsys->get_name(winsys);
   
   trace_dump_ret(string, result);
   
   trace_dump_call_end();
   
   return result;
}
Ejemplo n.º 29
0
static void
trace_winsys_destroy(struct pipe_winsys *_winsys)
{
   struct trace_winsys *tr_ws = trace_winsys(_winsys);
   struct pipe_winsys *winsys = tr_ws->winsys;
   
   trace_dump_call_begin("pipe_winsys", "destroy");
   
   trace_dump_arg(ptr, winsys);

   /* 
   winsys->destroy(winsys); 
   */
   
   trace_dump_call_end();
   
   hash_table_destroy(tr_ws->buffer_maps);

   FREE(tr_ws);
}
Ejemplo n.º 30
0
static float
trace_screen_get_paramf(struct pipe_screen *_screen,
                        enum pipe_capf param)
{
   struct trace_screen *tr_scr = trace_screen(_screen);
   struct pipe_screen *screen = tr_scr->screen;
   float result;

   trace_dump_call_begin("pipe_screen", "get_paramf");

   trace_dump_arg(ptr, screen);
   trace_dump_arg(int, param);

   result = screen->get_paramf(screen, param);

   trace_dump_ret(float, result);

   trace_dump_call_end();

   return result;
}