case GLSL_SAMPLER_DIM_3D:
return TEXTURE_3D_INDEX;
case GLSL_SAMPLER_DIM_CUBE:
- return TEXTURE_CUBE_INDEX;
+ return (t->sampler_array) ? TEXTURE_CUBE_ARRAY_INDEX : TEXTURE_CUBE_INDEX;
case GLSL_SAMPLER_DIM_RECT:
return TEXTURE_RECT_INDEX;
case GLSL_SAMPLER_DIM_BUF:
warn);
}
+void
+glsl_type::generate_ARB_texture_cube_map_array_types(glsl_symbol_table *symtab,
+ bool warn)
+{
+ add_types_to_symbol_table(symtab, builtin_ARB_texture_cube_map_array_types,
+ Elements(builtin_ARB_texture_cube_map_array_types),
+ warn);
+}
+
void
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
{
glsl_type::generate_OES_EGL_image_external_types(state->symbols,
state->OES_EGL_image_external_warn);
}
+
+ if (state->ARB_texture_cube_map_array_enable) {
+ glsl_type::generate_ARB_texture_cube_map_array_types(state->symbols,
+ state->ARB_texture_cube_map_array_warn);
+ }
}
* row vectors with <C> components each, according to rule (4).
*/
if (this->is_matrix()) {
- const struct glsl_type *vec_type;
+ const struct glsl_type *vec_type, *array_type;
+ int c = this->matrix_columns;
+ int r = this->vector_elements;
+
if (row_major) {
- vec_type = get_instance(GLSL_TYPE_FLOAT, this->vector_elements, 1);
+ vec_type = get_instance(GLSL_TYPE_FLOAT, c, 1);
+ array_type = glsl_type::get_array_instance(vec_type, r);
} else {
- vec_type = get_instance(GLSL_TYPE_FLOAT, this->matrix_columns, 1);
+ vec_type = get_instance(GLSL_TYPE_FLOAT, r, 1);
+ array_type = glsl_type::get_array_instance(vec_type, c);
}
- return vec_type->std140_base_alignment(false);
+ return array_type->std140_base_alignment(false);
}
/* (9) If the member is a structure, the base alignment of the