[Mesa-dev] [PATCH 3/6] st/mesa: consolidate view format setup code

Nicolai Hähnle nhaehnle at gmail.com
Thu Oct 6 07:36:39 UTC 2016


On 06.10.2016 02:42, Brian Paul wrote:
> Before, we had code to compute the sampler view's format spread across two
> different functions: in update_single_texture() and
> st_get_texture_sampler_view_from_stobj().  Now it's all in one new function.
>
> Also, use _mesa_texture_base_format() to simplify the code.
>
> Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
> ---
>  src/mesa/state_tracker/st_atom_texture.c | 88 ++++++++++++++++++++------------
>  1 file changed, 54 insertions(+), 34 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
> index 86f1c62..bfa16dc 100644
> --- a/src/mesa/state_tracker/st_atom_texture.c
> +++ b/src/mesa/state_tracker/st_atom_texture.c
> @@ -271,6 +271,58 @@ last_layer(const struct st_texture_object *stObj)
>     return stObj->pt->array_size - 1;
>  }
>
> +
> +/**
> + * Determine the format for the texture sampler view.
> + */
> +static enum pipe_format
> +get_sampler_view_format(struct st_context *st,
> +                        const struct st_texture_object *stObj,
> +                        const struct gl_sampler_object *samp)
> +{
> +   enum pipe_format format;
> +
> +   if (stObj->base.Target == GL_TEXTURE_BUFFER) {
> +      format =
> +         st_mesa_format_to_pipe_format(st, stObj->base._BufferObjectFormat);
> +   }
> +   else {

Slightly odd formatting of the else-branch here and twice below.

Apart from that, patches 1-3:

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


More information about the mesa-dev mailing list