[Mesa-dev] [PATCH 10/14] st/mesa: add PBO download enable bit and fragment shaders

Marek Olšák maraeo at gmail.com
Fri May 20 14:44:04 UTC 2016


On Wed, May 18, 2016 at 5:25 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> For downloads, the fragment shader must know the source texture target, hence
> we may cache multiple fragment shaders.
> ---
>  src/mesa/state_tracker/st_context.h |  2 ++
>  src/mesa/state_tracker/st_pbo.c     | 14 ++++++++++++++
>  2 files changed, 16 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
> index 39ea501..a4f56ea 100644
> --- a/src/mesa/state_tracker/st_context.h
> +++ b/src/mesa/state_tracker/st_context.h
> @@ -240,7 +240,9 @@ struct st_context
>        void *vs;
>        void *gs;
>        void *upload_fs;
> +      void *download_fs[PIPE_MAX_TEXTURE_TYPES];
>        bool upload_enabled;
> +      bool download_enabled;
>        bool rgba_only;
>        bool layers;
>        bool use_gs;
> diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c
> index 5bebfc6..57ff9b0 100644
> --- a/src/mesa/state_tracker/st_pbo.c
> +++ b/src/mesa/state_tracker/st_pbo.c
> @@ -447,6 +447,11 @@ st_init_pbo_helpers(struct st_context *st)
>     if (!st->pbo.upload_enabled)
>        return;
>
> +   st->pbo.download_enabled =
> +      st->pbo.upload_enabled &&
> +      screen->get_param(screen, PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT) &&
> +      screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_SHADER_IMAGES) >= 1;

This line is too long.

Marek


More information about the mesa-dev mailing list