[Mesa-dev] [PATCH] nir: Use a single bit for the dual-source blend index

Rob Clark robdclark at gmail.com
Tue Aug 4 15:15:00 PDT 2015


On Sun, Aug 2, 2015 at 1:04 AM, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> The only values allowed are 0 and 1, and the value is checked before
> assigning.
>
> This is a copy of 8eeca7a56c that seems to have been made to the glsl
> ir type after it was copied for use in nir but before nir landed.
> ---
>  src/glsl/nir/nir.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
> index 4551d09..d47f352 100644
> --- a/src/glsl/nir/nir.h
> +++ b/src/glsl/nir/nir.h
> @@ -293,9 +293,13 @@ typedef struct {
>        unsigned int driver_location;
>
>        /**
> -       * output index for dual source blending.
> +       * Output index for dual source blending.
> +       *
> +       * \note
> +       * The GLSL spec only allows the values 0 or 1 for the index in \b dual
> +       * source blending.
>         */
> -      int index;
> +      unsigned index:1;
>

btw, this kinda breaks tgsi_to_nir badly..  Eric has already started
on patches to make tgsi_to_nir not abuse the index field, but since
this doesn't actually change the size of the struct (since it sits
between two ints), any objection to just reverting this patch and
re-applying it again after tgsi_to_nir is fixed?

BR,
-R


>        /**
>         * Initial binding point for a sampler or UBO.
> --
> 2.4.3
>
> _______________________________________________
> 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