| 1823 | { |
| 1824 | OverrideTextureBcFormat(textureSetMetadata->GetTexture(textureIndex), nullptr); |
| 1825 | } |
| 1826 | } |
| 1827 | |
| 1828 | bool AnyBlockCompressedTextures(ntc::ITextureSetMetadata* textureSetMetadata) |
| 1829 | { |
| 1830 | for (int textureIndex = 0; textureIndex < textureSetMetadata->GetTextureCount(); ++textureIndex) |
| 1831 | { |
| 1832 | ntc::ITextureMetadata* textureMetadata = textureSetMetadata->GetTexture(textureIndex); |
| 1833 | if (textureMetadata->GetBlockCompressedFormat() != ntc::BlockCompressedFormat::None) |
| 1834 | { |
| 1835 | return true; |
| 1836 | } |
| 1837 | } |
| 1838 | return false; |
| 1839 | } |
| 1840 | |
| 1841 | class CustomAllocator : public ntc::IAllocator |
| 1842 | { |
| 1843 | public: |
| 1844 | void* Allocate(size_t size) override |
| 1845 | { |
| 1846 | void* ptr = malloc(size); |
| 1847 | // printf("Allocating %zu bytes at %p.\n", size, ptr); |
| 1848 | m_bytesAllocated += size; |
| 1849 | return ptr; |
| 1850 | } |
| 1851 | |
| 1852 | void Deallocate(void* ptr, size_t size) override |
| 1853 | { |
| 1854 | if (!ptr) |
| 1855 | return; |
| 1856 | // printf("Deallocating %zu bytes at %p.\n", size, ptr); |
| 1857 | m_bytesAllocated -= size; |
| 1858 | free(ptr); |
| 1859 | } |
| 1860 | |
| 1861 | int64_t GetBytesAllocated() const |
| 1862 | { |
| 1863 | return m_bytesAllocated; |
| 1864 | } |
| 1865 | |
| 1866 | private: |
| 1867 | int64_t m_bytesAllocated = 0; |
| 1868 | }; |
| 1869 | |
| 1870 | |
| 1871 | int main(int argc, const char** argv) |
| 1872 | { |
| 1873 | donut::log::ConsoleApplicationMode(); |
| 1874 | donut::log::SetMinSeverity(donut::log::Severity::Warning); |
| 1875 | |
| 1876 | if (!ProcessCommandLine(argc, argv)) |
| 1877 | return 1; |
| 1878 | |
| 1879 | if (g_options.printVersion) |
| 1880 | { |
| 1881 | ntc::VersionInfo libVersion = ntc::GetLibraryVersion(); |
| 1882 | printf("LibNTC version: %d.%d.%d %s-%s\n", libVersion.major, libVersion.minor, libVersion.point, |
nothing calls this directly
no test coverage detected