10 #include <gpu/Format.h>
11 #include <gpu/Stream.h>
15 using DebugEnums = QMap<T, QString>;
18 extern DebugEnums<Mesh::Topology> TOPOLOGIES;
19 inline QDebug operator<<(QDebug dbg, Mesh::Topology type) {
return dbg << TOPOLOGIES.value(type);}
20 inline const QString toString(Mesh::Topology v) {
return TOPOLOGIES.value(v); }
24 extern DebugEnums<Type> TYPES;
25 extern DebugEnums<Dimension> DIMENSIONS;
26 extern DebugEnums<Semantic> SEMANTICS;
27 extern DebugEnums<Stream::InputSlot> SLOTS;
28 inline QDebug operator<<(QDebug dbg, gpu::Type type) {
return dbg << TYPES.value(type); }
29 inline QDebug operator<<(QDebug dbg, gpu::Dimension type) {
return dbg << DIMENSIONS.value(type); }
30 inline QDebug operator<<(QDebug dbg, gpu::Semantic type) {
return dbg << SEMANTICS.value(type); }
31 inline QDebug operator<<(QDebug dbg, gpu::Stream::InputSlot type) {
return dbg << SLOTS.value(type); }
32 inline const QString toString(gpu::Type v) {
return TYPES.value(v); }
33 inline const QString toString(gpu::Dimension v) {
return DIMENSIONS.value(v); }
34 inline const QString toString(gpu::Semantic v) {
return SEMANTICS.value(v); }
35 inline const QString toString(gpu::Stream::InputSlot v) {
return SLOTS.value(v); }
36 inline const QString toString(gpu::Element v) {
37 return QString(
"[Element semantic=%1 type=%1 dimension=%2]")
38 .arg(toString(v.getSemantic()))
39 .arg(toString(v.getType()))
40 .arg(toString(v.getDimension()));
44 Q_DECLARE_METATYPE(gpu::Type)
45 Q_DECLARE_METATYPE(gpu::Dimension)
46 Q_DECLARE_METATYPE(gpu::Semantic)
47 Q_DECLARE_METATYPE(graphics::Mesh::Topology)