Exemplo n.º 1
0
static void 
trace_winsys_flush_frontbuffer(struct pipe_winsys *_winsys,
                               struct pipe_surface *surface,
                               void *context_private)
{
   struct trace_winsys *tr_ws = trace_winsys(_winsys);
   struct pipe_winsys *winsys = tr_ws->winsys;

   assert(surface);
   if(surface->texture) {
      struct trace_screen *tr_scr = trace_screen(surface->texture->screen);
      struct trace_texture *tr_tex = trace_texture(tr_scr, surface->texture);
      struct trace_surface *tr_surf = trace_surface(tr_tex, surface);
      surface = tr_surf->surface;
   }
   
   trace_dump_call_begin("pipe_winsys", "flush_frontbuffer");
   
   trace_dump_arg(ptr, winsys);
   trace_dump_arg(ptr, surface);
   /* XXX: hide, as there is nothing we can do with this
   trace_dump_arg(ptr, context_private);
   */

   winsys->flush_frontbuffer(winsys, surface, context_private);
   
   trace_dump_call_end();
}
Exemplo n.º 2
0
static INLINE void
trace_context_set_vertex_sampler_textures(struct pipe_context *_pipe,
                                          unsigned num_textures,
                                          struct pipe_texture **textures)
{
   struct trace_context *tr_ctx = trace_context(_pipe);
   struct trace_texture *tr_tex;
   struct pipe_context *pipe = tr_ctx->pipe;
   struct pipe_texture *unwrapped_textures[PIPE_MAX_VERTEX_SAMPLERS];
   unsigned i;

   tr_ctx->curr.num_vert_texs = num_textures;
   for(i = 0; i < num_textures; ++i) {
      tr_tex = trace_texture(textures[i]);
      tr_ctx->curr.vert_tex[i] = tr_tex;
      unwrapped_textures[i] = tr_tex ? tr_tex->texture : NULL;
   }
   textures = unwrapped_textures;

   trace_dump_call_begin("pipe_context", "set_vertex_sampler_textures");

   trace_dump_arg(ptr, pipe);
   trace_dump_arg(uint, num_textures);
   trace_dump_arg_array(ptr, textures, num_textures);

   pipe->set_vertex_sampler_textures(pipe, num_textures, textures);

   trace_dump_call_end();
}
Exemplo n.º 3
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();
}
Exemplo n.º 4
0
static INLINE struct pipe_texture *
trace_texture_unwrap(struct trace_context *tr_ctx,
                     struct pipe_texture *texture)
{
   struct trace_texture *tr_tex;

   if(!texture)
      return NULL;

   tr_tex = trace_texture(texture);

   assert(tr_tex->texture);
   return tr_tex->texture;
}
Exemplo n.º 5
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;
}