[Mesa-dev] [PATCH v2 10/12] gallium: Disable varying packing on hardware with <=8 texture indirections.

Marek Olšák maraeo at gmail.com
Thu Dec 13 14:50:37 PST 2012


For the patches 9 and 10:

Reviewed-by: Marek Olšák <maraeo at gmail.com>

Marek

On Thu, Dec 13, 2012 at 10:58 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> In practice this will disable varying packing on R300, R400, i915g,
> and nv30.
>
> Marek Olšák <maraeo at gmail.com>
> ---
>  src/mesa/state_tracker/st_extensions.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
> index 726d868..f3f01eb 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -663,4 +663,18 @@ void st_init_extensions(struct st_context *st)
>     }
>     if (screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS))
>        ctx->Extensions.ARB_texture_buffer_object = GL_TRUE;
> +
> +   /* Unpacking a varying in the fragment shader costs 1 texture indirection.
> +    * If the number of available texture indirections is very limited, then we
> +    * prefer to disable varying packing rather than run the risk of varying
> +    * packing preventing a shader from running.
> +    */
> +   if (screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
> +                                PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS) <= 8) {
> +      /* We can't disable varying packing if transform feedback is available,
> +       * because transform feedback code assumes a packed varying layout.
> +       */
> +      if (!ctx->Extensions.EXT_transform_feedback)
> +         ctx->Const.DisableVaryingPacking = GL_TRUE;
> +   }
>  }
> --
> 1.8.0.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list