| 1324 | } |
| 1325 | |
| 1326 | void addExtensionPropertiesRow(QList<QStandardItem*> item, Property2 property) |
| 1327 | { |
| 1328 | if (vulkanResources::shaderStageValueNames.contains(QString::fromStdString(property.name))) { |
| 1329 | const VkSubgroupFeatureFlags flags = property.value.toUInt(); |
| 1330 | addBitFlagsItem(item[0], QString::fromStdString(property.name), flags, vulkanResources::shaderStagesBitString); |
| 1331 | return; |
| 1332 | } |
| 1333 | |
| 1334 | QList<QStandardItem*> propertyItem; |
| 1335 | propertyItem << new QStandardItem(QString::fromStdString(property.name)); |
| 1336 | |
| 1337 | if (vulkanResources::uuidValueNames.contains(QString::fromStdString(property.name))) { |
| 1338 | const QJsonArray values = property.value.toJsonArray(); |
| 1339 | std::ostringstream ss; |
| 1340 | ss << std::hex << std::noshowbase << std::uppercase << std::setfill('0'); |
| 1341 | for (size_t i = 0; i < VK_UUID_SIZE; i++) { |
| 1342 | if (i == 4 || i == 6 || i == 8 || i == 10) ss << '-'; |
| 1343 | ss << std::setw(2) << static_cast<unsigned short>(values[static_cast<int>(i)].toInt()); |
| 1344 | } |
| 1345 | propertyItem << new QStandardItem(QString::fromStdString(ss.str())); |
| 1346 | item.first()->appendRow(propertyItem); |
| 1347 | return; |
| 1348 | } |
| 1349 | |
| 1350 | if ((property.value.metaType().id() != QMetaType::QString) && property.value.canConvert<QVariantList>()) { |
| 1351 | if ((strcmp(property.extension, VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME) == 0) && ((property.name == "pCopySrcLayouts") || (property.name == "pCopyDstLayouts"))) { |
| 1352 | QList<QVariant> list = property.value.toList(); |
| 1353 | for (auto i = 0; i < list.size(); i++) { |
| 1354 | QStandardItem* formatItem = new QStandardItem(); |
| 1355 | formatItem->setText(vulkanResources::imageLayoutString((VkImageLayout)list[i].toInt())); |
| 1356 | propertyItem.first()->appendRow(formatItem); |
| 1357 | } |
| 1358 | } |
| 1359 | propertyItem << new QStandardItem(arrayToStr(property.value)); |
| 1360 | } |
| 1361 | else { |
| 1362 | switch (property.value.metaType().id()) { |
| 1363 | case QMetaType::Bool: { |
| 1364 | bool boolVal = property.value.toBool(); |
| 1365 | propertyItem << new QStandardItem(boolVal ? "true" : "false"); |
| 1366 | propertyItem[1]->setForeground(boolVal ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0)); |
| 1367 | break; |
| 1368 | } |
| 1369 | default: |
| 1370 | propertyItem << new QStandardItem(property.value.toString()); |
| 1371 | } |
| 1372 | } |
| 1373 | |
| 1374 | item.first()->appendRow(propertyItem); |
| 1375 | } |
| 1376 | |
| 1377 | void VulkanCapsViewer::displayDevice(int index) |
| 1378 | { |
no test coverage detected