| 1214 | |
| 1215 | template<typename BitsType> |
| 1216 | void addBitFlagsItem(QStandardItem* parent, const QString& key, const VkFlags flags, std::string(* const flagToString)(BitsType)) |
| 1217 | { |
| 1218 | QList<QStandardItem*> flagsParentItem; |
| 1219 | flagsParentItem << new QStandardItem(key); |
| 1220 | flagsParentItem << new QStandardItem(QString::fromStdString(vulkanResources::toHexString(flags))); |
| 1221 | parent->appendRow(flagsParentItem); |
| 1222 | for (typename std::underlying_type<BitsType>::type bit = 0x1; bit != 0; bit <<= 1) { |
| 1223 | const QString bitName = QString::fromStdString(flagToString(static_cast<BitsType>(bit))); |
| 1224 | if (flags & bit) { |
| 1225 | QList<QStandardItem*> flagItem; |
| 1226 | flagItem << new QStandardItem(bitName); |
| 1227 | flagItem << new QStandardItem(); |
| 1228 | flagsParentItem[0]->appendRow(flagItem); |
| 1229 | } |
| 1230 | } |
| 1231 | if (key == "subgroupSupportedStages") { |
| 1232 | if ((flags & VK_SHADER_STAGE_ALL_GRAPHICS) == VK_SHADER_STAGE_ALL_GRAPHICS) { |
| 1233 | QList<QStandardItem*> flagItem; |
| 1234 | flagItem << new QStandardItem(QString::fromStdString(vulkanResources::shaderStagesBitString(VK_SHADER_STAGE_ALL_GRAPHICS))); |
| 1235 | flagItem << new QStandardItem(); |
| 1236 | flagsParentItem[0]->appendRow(flagItem); |
| 1237 | } |
| 1238 | if ((flags & VK_SHADER_STAGE_ALL) == VK_SHADER_STAGE_ALL) { |
| 1239 | QList<QStandardItem*> flagItem; |
| 1240 | flagItem << new QStandardItem(QString::fromStdString(vulkanResources::shaderStagesBitString(VK_SHADER_STAGE_ALL))); |
| 1241 | flagItem << new QStandardItem(); |
| 1242 | flagsParentItem[0]->appendRow(flagItem); |
| 1243 | } |
| 1244 | } |
| 1245 | } |
| 1246 | |
| 1247 | void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator) |
| 1248 | { |
no test coverage detected