On 22 January 2013 00:52, Ian Romanick <i...@freedesktop.org> wrote: > From: Ian Romanick <ian.d.roman...@intel.com> > > For the first declaration below, there will be an ir_variable named > "instance" whose type and whose instance_type will be the same > glsl_type. For the second declaration, there will be an ir_variable > named "f" whose type is float and whose instance_type is B2. > > "instance" is an interface instance variable, but "f" is not. > > uniform B1 { > float f; > } instance; > > uniform B2 { > float f; > }; > > Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> > --- > src/glsl/ir.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/src/glsl/ir.h b/src/glsl/ir.h > index 49c5f8d..a776f49 100644 > --- a/src/glsl/ir.h > +++ b/src/glsl/ir.h > @@ -355,6 +355,14 @@ public: > return this->mode == ir_var_uniform && this->interface_type != NULL; > } > > + inline bool is_interface_instance() const > + { > + const glsl_type *const t = this->type; > + > + return (t == this->interface_type) > + || (t->is_array() && t->fields.array == this->interface_type); > + } > + >
Not wanting to sound like a broken record here, but I could really use a comment above this function explaining what it means for a variable to be an "interface instance", and as in patch 12/32, I think the text that you have in the commit message would be perfect. With that change, this patch is: Reviewed-by: Paul Berry <stereotype...@gmail.com> > /** > * Declared type of the variable > */ > -- > 1.7.11.7 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev