const struct glsl_type *glsl_get_struct_field(const struct glsl_type *type,
unsigned index);
+const int glsl_get_struct_field_offset(const struct glsl_type *type,
+ unsigned index);
+
+const unsigned glsl_get_explicit_stride(const struct glsl_type *type);
const struct glsl_type *glsl_get_array_element(const struct glsl_type *type);
const struct glsl_type *glsl_without_array(const struct glsl_type *type);
-const struct glsl_type *glsl_get_array_instance(const struct glsl_type *type,
- unsigned array_size);
+const struct glsl_type *glsl_without_array_or_matrix(const struct glsl_type *type);
+const struct glsl_type *glsl_get_bare_type(const struct glsl_type *type);
const struct glsl_type *glsl_get_column_type(const struct glsl_type *type);
enum glsl_sampler_dim glsl_get_sampler_dim(const struct glsl_type *type);
enum glsl_base_type glsl_get_sampler_result_type(const struct glsl_type *type);
unsigned glsl_get_sampler_target(const struct glsl_type *type);
+int glsl_get_sampler_coordinate_components(const struct glsl_type *type);
unsigned glsl_get_record_location_offset(const struct glsl_type *type,
unsigned length);
glsl_get_bit_size(const struct glsl_type *type)
{
switch (glsl_get_base_type(type)) {
+ case GLSL_TYPE_BOOL:
+ return 1;
+
case GLSL_TYPE_INT:
case GLSL_TYPE_UINT:
- case GLSL_TYPE_BOOL:
case GLSL_TYPE_FLOAT: /* TODO handle mediump */
case GLSL_TYPE_SUBROUTINE:
return 32;
bool glsl_type_is_scalar(const struct glsl_type *type);
bool glsl_type_is_vector_or_scalar(const struct glsl_type *type);
bool glsl_type_is_matrix(const struct glsl_type *type);
+bool glsl_matrix_type_is_row_major(const struct glsl_type *type);
bool glsl_type_is_array(const struct glsl_type *type);
bool glsl_type_is_array_of_arrays(const struct glsl_type *type);
+bool glsl_type_is_array_or_matrix(const struct glsl_type *type);
bool glsl_type_is_struct(const struct glsl_type *type);
bool glsl_type_is_sampler(const struct glsl_type *type);
bool glsl_type_is_image(const struct glsl_type *type);
bool glsl_type_is_dual_slot(const struct glsl_type *type);
bool glsl_type_is_numeric(const struct glsl_type *type);
bool glsl_type_is_boolean(const struct glsl_type *type);
+bool glsl_type_is_integer(const struct glsl_type *type);
bool glsl_sampler_type_is_shadow(const struct glsl_type *type);
bool glsl_sampler_type_is_array(const struct glsl_type *type);
bool glsl_contains_atomic(const struct glsl_type *type);
unsigned components);
const struct glsl_type *glsl_matrix_type(enum glsl_base_type base_type,
unsigned rows, unsigned columns);
+const struct glsl_type *glsl_explicit_matrix_type(const struct glsl_type *mat,
+ unsigned stride,
+ bool row_major);
+
const struct glsl_type *glsl_array_type(const struct glsl_type *base,
- unsigned elements);
+ unsigned elements,
+ unsigned explicit_stride);
+
const struct glsl_type *glsl_struct_type(const struct glsl_struct_field *fields,
unsigned num_fields, const char *name);
const struct glsl_type *glsl_interface_type(const struct glsl_struct_field *fields,