return ret;
}
+ if (glsl_type_is_matrix(type))
+ return spirv_builder_type_matrix(&ctx->builder,
+ spirv_builder_type_vector(&ctx->builder,
+ get_glsl_basetype(ctx, glsl_get_base_type(type)),
+ glsl_get_vector_elements(type)),
+ glsl_get_matrix_columns(type));
unreachable("we shouldn't get here, I think...");
}
return get_type_def(b, SpvOpTypeVector, args, ARRAY_SIZE(args));
}
+SpvId
+spirv_builder_type_matrix(struct spirv_builder *b, SpvId component_type,
+ unsigned component_count)
+{
+ assert(component_count > 1);
+ uint32_t args[] = { component_type, component_count };
+ return get_type_def(b, SpvOpTypeMatrix, args, ARRAY_SIZE(args));
+}
+
SpvId
spirv_builder_type_array(struct spirv_builder *b, SpvId component_type,
SpvId length)
spirv_builder_type_vector(struct spirv_builder *b, SpvId component_type,
unsigned component_count);
+SpvId
+spirv_builder_type_matrix(struct spirv_builder *b, SpvId component_type,
+ unsigned component_count);
+
SpvId
spirv_builder_type_array(struct spirv_builder *b, SpvId component_type,
SpvId length);