[Mesa-dev] [PATCH v4 1/3] gallium/st: add pipe_context::generate_mipmap()

Michel Dänzer michel at daenzer.net
Tue Jan 12 19:45:45 PST 2016


On 13.01.2016 12:23, Charmaine Lee wrote:
> 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()

[...]

> diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
> index d4c88c9..26ccba1 100644
> --- a/src/gallium/drivers/trace/tr_context.c
> +++ b/src/gallium/drivers/trace/tr_context.c
> @@ -1291,6 +1291,41 @@ 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;
> +}

Other than that, trace_context_generate_mipmap looks good to me now.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list