diff options
author | Charmaine Lee <[email protected]> | 2016-01-14 10:22:17 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-01-14 10:39:53 -0700 |
commit | 3038e8984df2be35a7164043ec6d385e32e26238 (patch) | |
tree | b98815d07b7eabb312380128dca1b1a4cdefe12f /src/gallium/drivers/trace | |
parent | b1e11f4d71a570d39958871cc364841afb17bd13 (diff) |
gallium/st: add pipe_context::generate_mipmap()
This patch adds a new interface to support hardware mipmap generation.
PIPE_CAP_GENERATE_MIPMAP is added to allow a driver to specify
if this new interface is supported; if not supported, the state tracker will
fallback to mipmap generation by rendering/texturing.
v2: add PIPE_CAP_GENERATE_MIPMAP to the disabled section for all drivers
v3: add format to the generate_mipmap interface to allow mipmap generation
using a format other than the resource format
v4: fix return type of trace_context_generate_mipmap()
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace')
-rw-r--r-- | src/gallium/drivers/trace/tr_context.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index d4c88c9be6d..b5ab9249835 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -1291,6 +1291,42 @@ trace_context_flush(struct pipe_context *_pipe, } +static inline boolean +trace_context_generate_mipmap(struct pipe_context *_pipe, + struct pipe_resource *res, + enum pipe_format format, + unsigned base_level, + unsigned last_level, + unsigned first_layer, + unsigned last_layer) +{ + struct trace_context *tr_ctx = trace_context(_pipe); + struct pipe_context *pipe = tr_ctx->pipe; + boolean ret; + + res = trace_resource_unwrap(tr_ctx, res); + + trace_dump_call_begin("pipe_context", "generate_mipmap"); + + trace_dump_arg(ptr, pipe); + trace_dump_arg(ptr, res); + + trace_dump_arg(format, format); + trace_dump_arg(uint, base_level); + trace_dump_arg(uint, last_level); + trace_dump_arg(uint, first_layer); + trace_dump_arg(uint, last_layer); + + ret = pipe->generate_mipmap(pipe, res, format, base_level, last_level, + first_layer, last_layer); + + trace_dump_ret(bool, ret); + trace_dump_call_end(); + + return ret; +} + + static inline void trace_context_destroy(struct pipe_context *_pipe) { @@ -1620,6 +1656,7 @@ trace_context_create(struct trace_screen *tr_scr, TR_CTX_INIT(clear_render_target); TR_CTX_INIT(clear_depth_stencil); TR_CTX_INIT(flush); + TR_CTX_INIT(generate_mipmap); TR_CTX_INIT(texture_barrier); TR_CTX_INIT(memory_barrier); TR_CTX_INIT(set_tess_state); |