[Mesa-dev] [PATCH 02/26] nir: Add a descriptor_set field to nir_variable

Rob Clark robdclark at gmail.com
Sat Mar 26 16:17:12 UTC 2016


On Fri, Mar 25, 2016 at 7:12 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> This is needed for supporting the Vulkan binding model
> ---
>  src/compiler/nir/glsl_to_nir.cpp | 1 +
>  src/compiler/nir/nir.h           | 5 +++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
> index f6e1a17..efef9f5 100644
> --- a/src/compiler/nir/glsl_to_nir.cpp
> +++ b/src/compiler/nir/glsl_to_nir.cpp
> @@ -386,6 +386,7 @@ nir_visitor::visit(ir_variable *ir)
>     }
>
>     var->data.index = ir->data.index;
> +   var->data.descriptor_set = 0;

I suppose it is a good thing that we rzalloc() everywhere, since there
are a bunch of other places were var's are created (and perhaps a
couple places that should be updated to nir_variable_create() instead
of open-coding it)..

Reviewed-by: Rob Clark <robdclark at gmail.com>

>     var->data.binding = ir->data.binding;
>     var->data.offset = ir->data.offset;
>     var->data.image.read_only = ir->data.image_read_only;
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index bd44a40..996f104 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -267,6 +267,11 @@ typedef struct nir_variable {
>        int index;
>
>        /**
> +       * Descriptor set binding for sampler or UBO.
> +       */
> +      int descriptor_set;
> +
> +      /**
>         * Initial binding point for a sampler or UBO.
>         *
>         * For array types, this represents the binding point for the first element.
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list