private static void CompressTexture(FileInfo file, TextureProcessingType type, bool isLinear)
    {
        string compressionFormat;

        if (type == TextureProcessingType.SingleChannel && isLinear)
        {
            compressionFormat = "BC4_UNORM";
        }
        else
        {
            compressionFormat = isLinear ? "BC7_UNORM" : "BC7_UNORM_SRGB";
        }

        List <string> arguments = new List <string>()
        {
            "-y",
            isLinear ? "" : "-srgb",
            "-f " + compressionFormat,
            "-bcmax",
            file.Name
        };

        ProcessStartInfo startInfo = new ProcessStartInfo {
            WorkingDirectory = file.DirectoryName,
            FileName         = @"third-party\DirectXTex\texconv.exe",
            Arguments        = String.Join(" ", arguments),
            UseShellExecute  = false
        };

        Process process = Process.Start(startInfo);

        process.WaitForExit();
        if (process.ExitCode != 0)
        {
            throw new InvalidOperationException("texconv failed");
        }
    }