| 1622 | } |
| 1623 | |
| 1624 | void DescribeTextureSet(ntc::ITextureSetMetadata* textureSet) |
| 1625 | { |
| 1626 | ntc::TextureSetDesc const& desc = textureSet->GetDesc(); |
| 1627 | printf("Dimensions: %dx%d, %d channels, %d mip level(s)\n", desc.width, desc.height, desc.channels, desc.mips); |
| 1628 | |
| 1629 | ntc::LatentShape const& latentShape = textureSet->GetLatentShape(); |
| 1630 | printf("Base compression rate: --bitsPerPixel %.3f\n", ntc::GetLatentShapeBitsPerPixel(latentShape)); |
| 1631 | printf("Latent shape: --gridSizeScale %d --numFeatures %d\n", |
| 1632 | latentShape.gridSizeScale, latentShape.numFeatures); |
| 1633 | printf("Inference weights: Int8 [%c], FP8 [%c]\n", |
| 1634 | textureSet->IsInferenceWeightTypeSupported(ntc::InferenceWeightType::GenericInt8) ? 'Y' : 'N', |
| 1635 | textureSet->IsInferenceWeightTypeSupported(ntc::InferenceWeightType::GenericFP8) ? 'Y' : 'N'); |
| 1636 | |
| 1637 | ntc::CompressionType latentCompression = ntc::CompressionType::None; |
| 1638 | ntc::LatentTextureDesc const latentTextureDesc = textureSet->GetLatentTextureDesc(); |
| 1639 | int totalLatentBuffers = 0; |
| 1640 | int compressedLatentBuffers = 0; |
| 1641 | for (int mipLevel = 0; mipLevel < latentTextureDesc.mipLevels; ++mipLevel) |
| 1642 | { |
| 1643 | for (int layerIndex = 0; layerIndex < latentTextureDesc.arraySize; ++layerIndex) |
| 1644 | { |
| 1645 | ntc::LatentTextureFootprint footprint; |
| 1646 | ntc::Status ntcStatus = textureSet->GetLatentTextureFootprint(mipLevel, layerIndex, footprint); |
| 1647 | |
| 1648 | if (ntcStatus == ntc::Status::Ok) |
| 1649 | { |
| 1650 | ++totalLatentBuffers; |
| 1651 | if (footprint.buffer.compressionType != ntc::CompressionType::None) |
| 1652 | { |
| 1653 | latentCompression = footprint.buffer.compressionType; |
| 1654 | ++compressedLatentBuffers; |
| 1655 | } |
| 1656 | } |
| 1657 | } |
| 1658 | } |
| 1659 | printf("Latent compression: %s", ntc::CompressionTypeToString(latentCompression)); |
| 1660 | if (latentCompression != ntc::CompressionType::None) |
| 1661 | { |
| 1662 | printf(" (%d/%d slices)", compressedLatentBuffers, totalLatentBuffers); |
| 1663 | } |
| 1664 | printf("\n"); |
| 1665 | |
| 1666 | printf("Textures:\n"); |
| 1667 | for (int i = 0; i < textureSet->GetTextureCount(); ++i) |
| 1668 | { |
| 1669 | ntc::ITextureMetadata* texture = textureSet->GetTexture(i); |
| 1670 | int firstChannel, numChannels; |
| 1671 | texture->GetChannels(firstChannel, numChannels); |
| 1672 | printf("%d: %s\n", i, texture->GetName()); |
| 1673 | printf(" Channels: %d-%d\n", firstChannel, firstChannel + numChannels - 1); |
| 1674 | printf(" Channel format: %s\n", ntc::ChannelFormatToString(texture->GetChannelFormat())); |
| 1675 | printf(" BCn format: %s\n", ntc::BlockCompressedFormatToString(texture->GetBlockCompressedFormat())); |
| 1676 | printf(" RGB color space: %s\n", ntc::ColorSpaceToString(texture->GetRgbColorSpace())); |
| 1677 | if (numChannels > 3) |
| 1678 | printf(" Alpha color space: %s\n", ntc::ColorSpaceToString(texture->GetAlphaColorSpace())); |
| 1679 | |
| 1680 | bool colorSpacesMatch = true; |
| 1681 | for (int ch = 0; ch < numChannels; ++ch) |