diff options
author | Michal Krol <[email protected]> | 2010-02-19 19:00:26 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2010-02-19 19:00:26 +0100 |
commit | f6106566081978f663cf08e54bb8908cb58a5316 (patch) | |
tree | 7bc2482548f55471d7024f04c75ac7f58402afa9 /src/gallium/drivers/trace | |
parent | 3d0bfc6a4be73d43928493641bf819f77075bbc1 (diff) |
gallium: WIP: Introduce sampler views.
Diffstat (limited to 'src/gallium/drivers/trace')
-rw-r--r-- | src/gallium/drivers/trace/tr_context.c | 76 | ||||
-rw-r--r-- | src/gallium/drivers/trace/tr_context.h | 10 | ||||
-rw-r--r-- | src/gallium/drivers/trace/tr_rbug.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/trace/tr_texture.h | 19 |
4 files changed, 66 insertions, 47 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index df40fbade6c..6293dd79acf 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -112,7 +112,7 @@ trace_context_draw_block(struct trace_context *tr_ctx, int flag) (void *) tr_ctx->draw_rule.fs, (void *) tr_ctx->curr.fs, (void *) tr_ctx->draw_rule.vs, (void *) tr_ctx->curr.vs, (void *) tr_ctx->draw_rule.surf, 0, - (void *) tr_ctx->draw_rule.tex, 0); + (void *) tr_ctx->draw_rule.sampler_view, 0); if (tr_ctx->draw_rule.fs && tr_ctx->draw_rule.fs == tr_ctx->curr.fs) block = TRUE; @@ -126,12 +126,12 @@ trace_context_draw_block(struct trace_context *tr_ctx, int flag) for (k = 0; k < tr_ctx->curr.nr_cbufs; k++) if (tr_ctx->draw_rule.surf == tr_ctx->curr.cbufs[k]) block = TRUE; - if (tr_ctx->draw_rule.tex) { - for (k = 0; k < tr_ctx->curr.num_texs; k++) - if (tr_ctx->draw_rule.tex == tr_ctx->curr.tex[k]) + if (tr_ctx->draw_rule.sampler_view) { + for (k = 0; k < tr_ctx->curr.num_sampler_views; k++) + if (tr_ctx->draw_rule.sampler_view == tr_ctx->curr.sampler_views[k]) block = TRUE; - for (k = 0; k < tr_ctx->curr.num_vert_texs; k++) { - if (tr_ctx->draw_rule.tex == tr_ctx->curr.vert_tex[k]) { + for (k = 0; k < tr_ctx->curr.num_vert_sampler_views; k++) { + if (tr_ctx->draw_rule.sampler_view == tr_ctx->curr.vert_sampler_views[k]) { block = TRUE; } } @@ -950,62 +950,62 @@ trace_context_set_viewport_state(struct pipe_context *_pipe, static INLINE void -trace_context_set_fragment_sampler_textures(struct pipe_context *_pipe, - unsigned num_textures, - struct pipe_texture **textures) +trace_context_set_fragment_sampler_views(struct pipe_context *_pipe, + unsigned num, + struct pipe_sampler_view **views) { struct trace_context *tr_ctx = trace_context(_pipe); - struct trace_texture *tr_tex; + struct trace_sampler_view *tr_view; struct pipe_context *pipe = tr_ctx->pipe; - struct pipe_texture *unwrapped_textures[PIPE_MAX_SAMPLERS]; + struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS]; unsigned 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; + tr_ctx->curr.num_sampler_views = num; + for(i = 0; i < num; ++i) { + tr_view = trace_sampler_view(views[i]); + tr_ctx->curr.sampler_views[i] = tr_view; + unwrapped_views[i] = tr_view ? tr_view->sampler_view : NULL; } - textures = unwrapped_textures; + views = unwrapped_views; - trace_dump_call_begin("pipe_context", "set_fragment_sampler_textures"); + trace_dump_call_begin("pipe_context", "set_fragment_sampler_views"); trace_dump_arg(ptr, pipe); - trace_dump_arg(uint, num_textures); - trace_dump_arg_array(ptr, textures, num_textures); + trace_dump_arg(uint, num); + trace_dump_arg_array(ptr, views, num); - pipe->set_fragment_sampler_textures(pipe, num_textures, textures); + pipe->set_fragment_sampler_views(pipe, num, views); trace_dump_call_end(); } static INLINE void -trace_context_set_vertex_sampler_textures(struct pipe_context *_pipe, - unsigned num_textures, - struct pipe_texture **textures) +trace_context_set_vertex_sampler_views(struct pipe_context *_pipe, + unsigned num, + struct pipe_sampler_view **views) { struct trace_context *tr_ctx = trace_context(_pipe); - struct trace_texture *tr_tex; + struct trace_sampler_view *tr_view; struct pipe_context *pipe = tr_ctx->pipe; - struct pipe_texture *unwrapped_textures[PIPE_MAX_VERTEX_SAMPLERS]; + struct pipe_sampler_view *unwrapped_views[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; + tr_ctx->curr.num_vert_sampler_views = num; + for(i = 0; i < num; ++i) { + tr_view = trace_sampler_view(views[i]); + tr_ctx->curr.vert_sampler_views[i] = tr_view; + unwrapped_views[i] = tr_view ? tr_view->sampler_view : NULL; } - textures = unwrapped_textures; + views = unwrapped_views; - trace_dump_call_begin("pipe_context", "set_vertex_sampler_textures"); + trace_dump_call_begin("pipe_context", "set_vertex_sampler_views"); trace_dump_arg(ptr, pipe); - trace_dump_arg(uint, num_textures); - trace_dump_arg_array(ptr, textures, num_textures); + trace_dump_arg(uint, num); + trace_dump_arg_array(ptr, views, num); - pipe->set_vertex_sampler_textures(pipe, num_textures, textures); + pipe->set_vertex_sampler_views(pipe, num, views); trace_dump_call_end(); } @@ -1311,8 +1311,8 @@ trace_context_create(struct trace_screen *tr_scr, tr_ctx->base.set_polygon_stipple = trace_context_set_polygon_stipple; tr_ctx->base.set_scissor_state = trace_context_set_scissor_state; tr_ctx->base.set_viewport_state = trace_context_set_viewport_state; - tr_ctx->base.set_fragment_sampler_textures = trace_context_set_fragment_sampler_textures; - tr_ctx->base.set_vertex_sampler_textures = trace_context_set_vertex_sampler_textures; + tr_ctx->base.set_fragment_sampler_views = trace_context_set_fragment_sampler_views; + tr_ctx->base.set_vertex_sampler_views = trace_context_set_vertex_sampler_views; tr_ctx->base.set_vertex_buffers = trace_context_set_vertex_buffers; tr_ctx->base.set_vertex_elements = trace_context_set_vertex_elements; if (pipe->surface_copy) diff --git a/src/gallium/drivers/trace/tr_context.h b/src/gallium/drivers/trace/tr_context.h index 14284232485..feec9b6bbf3 100644 --- a/src/gallium/drivers/trace/tr_context.h +++ b/src/gallium/drivers/trace/tr_context.h @@ -53,11 +53,11 @@ struct trace_context struct trace_shader *fs; struct trace_shader *vs; - struct trace_texture *tex[PIPE_MAX_SAMPLERS]; - unsigned num_texs; + struct trace_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; + unsigned num_sampler_views; - struct trace_texture *vert_tex[PIPE_MAX_VERTEX_SAMPLERS]; - unsigned num_vert_texs; + struct trace_sampler_view *vert_sampler_views[PIPE_MAX_VERTEX_SAMPLERS]; + unsigned num_vert_sampler_views; unsigned nr_cbufs; struct trace_texture *cbufs[PIPE_MAX_COLOR_BUFS]; @@ -68,7 +68,7 @@ struct trace_context struct trace_shader *fs; struct trace_shader *vs; - struct trace_texture *tex; + struct trace_sampler_view *sampler_view; struct trace_texture *surf; int blocker; diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c index a43adac6940..07f9de253ec 100644 --- a/src/gallium/drivers/trace/tr_rbug.c +++ b/src/gallium/drivers/trace/tr_rbug.c @@ -313,12 +313,12 @@ 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]); + for (i = 0; i < tr_ctx->curr.num_sampler_views; i++) + texs[i] = VOID2U64(tr_ctx->curr.sampler_views[i]); rbug_send_context_info_reply(tr_rbug->con, serial, VOID2U64(tr_ctx->curr.vs), VOID2U64(tr_ctx->curr.fs), - texs, tr_ctx->curr.num_texs, + texs, tr_ctx->curr.num_sampler_views, cbufs, tr_ctx->curr.nr_cbufs, VOID2U64(tr_ctx->curr.zsbuf), tr_ctx->draw_blocker, tr_ctx->draw_blocked, NULL); @@ -444,7 +444,7 @@ trace_rbug_context_draw_rule(struct trace_rbug *tr_rbug, struct rbug_header *hea pipe_mutex_lock(tr_ctx->draw_mutex); tr_ctx->draw_rule.vs = U642VOID(rule->vertex); tr_ctx->draw_rule.fs = U642VOID(rule->fragment); - tr_ctx->draw_rule.tex = U642VOID(rule->texture); + tr_ctx->draw_rule.sampler_view = U642VOID(rule->texture); tr_ctx->draw_rule.surf = U642VOID(rule->surface); tr_ctx->draw_rule.blocker = rule->block; tr_ctx->draw_blocker |= RBUG_BLOCK_RULE; diff --git a/src/gallium/drivers/trace/tr_texture.h b/src/gallium/drivers/trace/tr_texture.h index 395e523e73a..a2ca3c21dbf 100644 --- a/src/gallium/drivers/trace/tr_texture.h +++ b/src/gallium/drivers/trace/tr_texture.h @@ -55,6 +55,16 @@ struct trace_surface }; +struct trace_sampler_view +{ + struct pipe_sampler_view base; + + struct pipe_sampler_view *sampler_view; + + struct tr_list list; +}; + + struct trace_transfer { struct pipe_transfer base; @@ -87,6 +97,15 @@ trace_surface(struct pipe_surface *surface) } +static INLINE struct trace_sampler_view * +trace_sampler_view(struct pipe_sampler_view *sampler_view) +{ + if (!sampler_view) + return NULL; + return (struct trace_sampler_view *)sampler_view; +} + + static INLINE struct trace_transfer * trace_transfer(struct pipe_transfer *transfer) { |