glsl: add ir_variable::contains_bindless()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 4 May 2017 15:34:33 +0000 (17:34 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 08:04:36 +0000 (10:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/ir.h

index 91e665cc1b961f07f9e747a6a9313fbf86078336..840c06e10ac96e78b88a54f324a553cba19ea9cf 100644 (file)
@@ -474,6 +474,17 @@ public:
       return this->type->without_array() == this->interface_type;
    }
 
+   /**
+    * Return whether this variable contains a bindless sampler/image.
+    */
+   inline bool contains_bindless() const
+   {
+      if (!this->type->contains_sampler() && !this->type->contains_image())
+         return false;
+
+      return this->data.bindless || this->data.mode != ir_var_uniform;
+   }
+
    /**
     * Set this->interface_type on a newly created variable.
     */