svgadump: Dump the new depth format names.
[mesa.git] / src / glsl / glsl_types.cpp
index 78d10bd93808ba998e8ea424135d37f33d6673ca..c94aec0d2da8352772aecc284b9d308eab3b5174 100644 (file)
@@ -111,6 +111,22 @@ add_types_to_symbol_table(glsl_symbol_table *symtab,
    }
 }
 
+bool
+glsl_type::contains_sampler() const
+{
+   if (this->is_array()) {
+      return this->fields.array->contains_sampler();
+   } else if (this->is_record()) {
+      for (unsigned int i = 0; i < this->length; i++) {
+        if (this->fields.structure[i].type->contains_sampler())
+           return true;
+      }
+      return false;
+   } else {
+      return this->is_sampler();
+   }
+}
+
 void
 glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
 {
@@ -507,3 +523,19 @@ glsl_type::component_slots() const
       return 0;
    }
 }
+
+bool
+glsl_type::can_implicitly_convert_to(const glsl_type *desired) const
+{
+   if (this == desired)
+      return true;
+
+   /* There is no conversion among matrix types. */
+   if (this->matrix_columns > 1 || desired->matrix_columns > 1)
+      return false;
+
+   /* int and uint can be converted to float. */
+   return desired->is_float()
+          && this->is_integer()
+          && this->vector_elements == desired->vector_elements;
+}