[Mesa-dev] [RFC PATCH 16/65] glsl: add ir_variable::is_bindless()

Nicolai Hähnle nhaehnle at gmail.com
Wed May 24 11:32:49 UTC 2017


On 19.05.2017 18:52, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   src/compiler/glsl/ir.h | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
> index 91e665cc1b..c816a327c1 100644
> --- a/src/compiler/glsl/ir.h
> +++ b/src/compiler/glsl/ir.h
> @@ -475,6 +475,17 @@ public:
>      }
>   
>      /**
> +    * Return whether this variable is a bindless sampler/image.
> +    */
> +   inline bool is_bindless() const
> +   {
> +      if (!this->type->contains_sampler() && !this->type->contains_image())
> +         return false;
> +
> +      return this->data.bindless || this->data.mode != ir_var_uniform;
> +   }

This should really be called contains_bindless(), and the comment be 
adjusted accordingly.

Cheers,
Nicolai

> +
> +   /**
>       * Set this->interface_type on a newly created variable.
>       */
>      void init_interface_type(const struct glsl_type *type)
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list