svgadump: Dump the new depth format names.
[mesa.git] / src / glsl / glsl_types.cpp
index a5e21bbb96c06ef319c1c12d6b220b790c71b8c9..c94aec0d2da8352772aecc284b9d308eab3b5174 100644 (file)
@@ -523,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;
+}