*/
virtual ir_variable *variable_referenced() const = 0;
+ /**
+ * Get the precision. This can either come from the eventual variable that
+ * is dereferenced, or from a record member.
+ */
+ virtual int precision() const = 0;
+
protected:
ir_dereference(enum ir_node_type t)
: ir_rvalue(t)
return this->var;
}
+ virtual int precision() const
+ {
+ return this->var->data.precision;
+ }
+
virtual ir_variable *whole_variable_referenced()
{
/* ir_dereference_variable objects always dereference the entire
return this->array->variable_referenced();
}
+ virtual int precision() const
+ {
+ ir_dereference *deref = this->array->as_dereference();
+
+ if (deref == NULL)
+ return GLSL_PRECISION_NONE;
+ else
+ return deref->precision();
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);
return this->record->variable_referenced();
}
+ virtual int precision() const
+ {
+ glsl_struct_field *field = record->type->fields.structure + field_idx;
+
+ return field->precision;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);