trace/rbug: Return textures currently bound to context
authorJakob Bornecrantz <jakob@vmware.com>
Tue, 9 Jun 2009 14:59:29 +0000 (15:59 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Tue, 9 Jun 2009 15:00:40 +0000 (16:00 +0100)
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_context.h
src/gallium/drivers/trace/tr_rbug.c

index b845a649b898f45f76ea7c66b97d5ec54678c490..7a39bdb42c277c951df02ce1d4423d730919543d 100644 (file)
@@ -915,12 +915,17 @@ trace_context_set_sampler_textures(struct pipe_context *_pipe,
                                    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_SAMPLERS];
    unsigned i;
 
-   for(i = 0; i < num_textures; ++i)
-      unwrapped_textures[i] = trace_texture_unwrap(tr_ctx, textures[i]);
+   tr_ctx->curr.num_texs = num_textures;
+   for(i = 0; i < num_textures; ++i) {
+      tr_tex = trace_texture(textures[i]);
+      tr_ctx->curr.tex[i] = tr_tex;
+      unwrapped_textures[i] = tr_tex ? tr_tex->texture : NULL;
+   }
    textures = unwrapped_textures;
 
    trace_dump_call_begin("pipe_context", "set_sampler_textures");
index 0c2bf276895efc2fa3ccb059ace49aafd09a3ee5..ff86b6d1055fba8ce8bd10e49b2c70135098003f 100644 (file)
@@ -51,6 +51,9 @@ struct trace_context
       struct trace_shader *fs;
       struct trace_shader *vs;
 
+      struct trace_texture *tex[PIPE_MAX_SAMPLERS];
+      unsigned num_texs;
+
       unsigned nr_cbufs;
       struct trace_texture *cbufs[PIPE_MAX_COLOR_BUFS];
       struct trace_texture *zsbuf;
index e2de10800910a0af9043a399fca7171cf09e1026..68184e9a5d6ddd199cad18820aa73be9d126794b 100644 (file)
@@ -296,6 +296,7 @@ trace_rbug_context_info(struct trace_rbug *tr_rbug, struct rbug_header *header,
    struct trace_screen *tr_scr = tr_rbug->tr_scr;
    struct trace_context *tr_ctx = NULL;
    rbug_texture_t cbufs[PIPE_MAX_COLOR_BUFS];
+   rbug_texture_t texs[PIPE_MAX_SAMPLERS];
    int i;
 
    pipe_mutex_lock(tr_scr->list_mutex);
@@ -313,9 +314,14 @@ trace_rbug_context_info(struct trace_rbug *tr_rbug, struct rbug_header *header,
    for (i = 0; i < tr_ctx->curr.nr_cbufs; i++)
       cbufs[i] = VOID2U64(tr_ctx->curr.cbufs[i]);
 
+   for (i = 0; i < tr_ctx->curr.num_texs; i++)
+      texs[i] = VOID2U64(tr_ctx->curr.tex[i]);
+
    rbug_send_context_info_reply(tr_rbug->con, serial,
                                 VOID2U64(tr_ctx->curr.vs), VOID2U64(tr_ctx->curr.fs),
-                                cbufs, tr_ctx->curr.nr_cbufs, VOID2U64(tr_ctx->curr.zsbuf),
+                                texs, tr_ctx->curr.num_texs,
+                                cbufs, tr_ctx->curr.nr_cbufs,
+                                VOID2U64(tr_ctx->curr.zsbuf),
                                 tr_ctx->draw_blocker, tr_ctx->draw_blocked, NULL);
 
    trace_dump_call_unlock();