case GLSL_SAMPLER_DIM_EXTERNAL:
return error_type;
}
+ case GLSL_TYPE_VOID:
+ switch (dim) {
+ case GLSL_SAMPLER_DIM_1D:
+ return (array ? vimage1DArray_type : vimage1D_type);
+ case GLSL_SAMPLER_DIM_2D:
+ return (array ? vimage2DArray_type : vimage2D_type);
+ case GLSL_SAMPLER_DIM_3D:
+ return (array ? error_type : vimage3D_type);
+ case GLSL_SAMPLER_DIM_BUF:
+ return (array ? error_type : vbuffer_type);
+ default:
+ return error_type;
+ }
default:
return error_type;
}
*size = stride * (this->length - 1) + elem_size;
*alignment = elem_align;
return glsl_type::get_array_instance(explicit_element, this->length, stride);
- } else if (this->is_struct()) {
+ } else if (this->is_struct() || this->is_interface()) {
struct glsl_struct_field *fields = (struct glsl_struct_field *)
malloc(sizeof(struct glsl_struct_field) * this->length);
*alignment = MAX2(*alignment, field_align);
}
- const glsl_type *type = glsl_type::get_struct_instance(fields, this->length, this->name, false);
+ const glsl_type *type;
+ if (this->is_struct()) {
+ type = get_struct_instance(fields, this->length, this->name, false);
+ } else {
+ type = get_interface_instance(fields, this->length,
+ (enum glsl_interface_packing)this->interface_packing,
+ this->interface_row_major,
+ this->name);
+ }
free(fields);
return type;
} else if (this->is_matrix()) {