5个版本
0.1.4 | 2019年1月29日 |
---|---|
0.1.3 | 2019年1月29日 |
0.1.2 | 2018年12月23日 |
0.1.1 | 2018年12月23日 |
0.1.0 | 2018年12月23日 |
#722 in 图形API
21KB
371 行
include-merkle
生成包含引用的文本文件的Merkle树的功能,将包含路径替换为确定性的版本化身份,以及将包含指令扁平化到单个文件的功能。主要动机是为各种图形API编译着色器,但该功能也可以应用于各种源代码解析用例。
示例
$ cargo run --example main
Running `target\debug\examples\main.exe`
---
Flatten Test
*
Wrote data out to "./output\\EUv1Sh6w3Sie2iSHM3FtLcn9ZeDp3tnGjfKQiVnJVpJB"
---
Patching Test
*
Wrote data out to "./output\\Bqp6piigLu4FCeVrbXxdifHFuZvAJdWHydHKUbNDpqdt"
Wrote data out to "./output\\E3fsGCD89GRn5xJssirwFKiSQE58qgTPbC4wfA5QPSbz"
Wrote data out to "./output\\B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL"
Wrote data out to "./output\\J2JZmZHPNWyxWCg4rnYPxY88PpbQUt4U1tjBzus6RrSo"
Wrote data out to "./output\\EWqGhBhDUMQk3ggrxyEWDTFPSzsWfFgz9J1V68jjZRNd"
Wrote data out to "./output\\8d2bKyA5JLhnJNUyfg4NNbpHCXHZfppLWUcvFWoGE1QH"
Wrote data out to "./output\\8Jmp4fnvscv4XNeoWBf4adhpaWGGZLZwwuNqN5UB6tRA"
Wrote data out to "./output\\2gMYKEwiVv3xLz2eqVD7r3vASvxEBB2SCR4ZMQJTb12h"
digraph {
0 [label="(s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:[\"ColorSpaceUtility.hlsli\"])"]
1 [label="(s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:[\"ColorSpaceUtility.hlsli\"])"]
2 [label="(s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:[\"ColorSpaceUtility.hlsli\"])"]
3 [label="(s:[4Ei7qCx94ruYT6bUmKXkj1QCGXKu4raGTQTSSbe6d4UN] p:[Bqp6piigLu4FCeVrbXxdifHFuZvAJdWHydHKUbNDpqdt] f:[\"PixelPacking_RGBE.hlsli\"])"]
4 [label="(s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:[\"ColorSpaceUtility.hlsli\"])"]
5 [label="(s:[HHjaptvgha9jdPRkyZE3gFURwU5B4KbeT9BRtZAhneXX] p:[E3fsGCD89GRn5xJssirwFKiSQE58qgTPbC4wfA5QPSbz] f:[\"PixelPacking_RGBM.hlsli\"])"]
6 [label="(s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:[\"ColorSpaceUtility.hlsli\"])"]
7 [label="(s:[EuPrBa4zhNBckh4vJ8uWkaULYhFSaFeX2bfKjHpMnQAd] p:[J2JZmZHPNWyxWCg4rnYPxY88PpbQUt4U1tjBzus6RrSo] f:[\"PixelPacking_R11G11B10.hlsli\"])"]
8 [label="(s:[F82JNfL2QuXCRAYiLcLuRwLQkFjdr6y82akthq7mcSo2] p:[EWqGhBhDUMQk3ggrxyEWDTFPSzsWfFgz9J1V68jjZRNd] f:[\"PixelPacking.hlsli\"])"]
9 [label="(s:[4Vz59nC3dMpkQPG8Ro55VLjuswZDtmcNnj1tznu2zEoq] p:[8d2bKyA5JLhnJNUyfg4NNbpHCXHZfppLWUcvFWoGE1QH] f:[\"ShaderUtility.hlsli\"])"]
10 [label="(s:[8Jmp4fnvscv4XNeoWBf4adhpaWGGZLZwwuNqN5UB6tRA] p:[8Jmp4fnvscv4XNeoWBf4adhpaWGGZLZwwuNqN5UB6tRA] f:[\"PostEffectsRS.hlsli\"])"]
11 [label="(s:[QAFJTtxYCR2WDdx7TCN579qAjsBbK9i4d8XLa3F8U38] p:[2gMYKEwiVv3xLz2eqVD7r3vASvxEBB2SCR4ZMQJTb12h] f:[\"BloomExtractAndDownsampleHdrCS.hlsl\"])"]
3 -> 2 [label="3"]
5 -> 4 [label="3"]
7 -> 6 [label="3"]
8 -> 1 [label="2"]
8 -> 3 [label="2"]
8 -> 5 [label="2"]
8 -> 7 [label="2"]
9 -> 0 [label="1"]
9 -> 8 [label="1"]
11 -> 9 [label="0"]
11 -> 10 [label="0"]
}
(s:[QAFJTtxYCR2WDdx7TCN579qAjsBbK9i4d8XLa3F8U38] p:[2gMYKEwiVv3xLz2eqVD7r3vASvxEBB2SCR4ZMQJTb12h] f:["BloomExtractAndDownsampleHdrCS.hlsl"])
├─ (s:[8Jmp4fnvscv4XNeoWBf4adhpaWGGZLZwwuNqN5UB6tRA] p:[8Jmp4fnvscv4XNeoWBf4adhpaWGGZLZwwuNqN5UB6tRA] f:["PostEffectsRS.hlsli"])
└─ (s:[4Vz59nC3dMpkQPG8Ro55VLjuswZDtmcNnj1tznu2zEoq] p:[8d2bKyA5JLhnJNUyfg4NNbpHCXHZfppLWUcvFWoGE1QH] f:["ShaderUtility.hlsli"])
├─ (s:[F82JNfL2QuXCRAYiLcLuRwLQkFjdr6y82akthq7mcSo2] p:[EWqGhBhDUMQk3ggrxyEWDTFPSzsWfFgz9J1V68jjZRNd] f:["PixelPacking.hlsli"])
│ ├─ (s:[EuPrBa4zhNBckh4vJ8uWkaULYhFSaFeX2bfKjHpMnQAd] p:[J2JZmZHPNWyxWCg4rnYPxY88PpbQUt4U1tjBzus6RrSo] f:["PixelPacking_R11G11B10.hlsli"])
│ │ └─ (s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:["ColorSpaceUtility.hlsli"])
│ ├─ (s:[HHjaptvgha9jdPRkyZE3gFURwU5B4KbeT9BRtZAhneXX] p:[E3fsGCD89GRn5xJssirwFKiSQE58qgTPbC4wfA5QPSbz] f:["PixelPacking_RGBM.hlsli"])
│ │ └─ (s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:["ColorSpaceUtility.hlsli"])
│ ├─ (s:[4Ei7qCx94ruYT6bUmKXkj1QCGXKu4raGTQTSSbe6d4UN] p:[Bqp6piigLu4FCeVrbXxdifHFuZvAJdWHydHKUbNDpqdt] f:["PixelPacking_RGBE.hlsli"])
│ │ └─ (s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:["ColorSpaceUtility.hlsli"])
│ └─ (s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:["ColorSpaceUtility.hlsli"])
└─ (s:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] p:[B6UvYRYE5zP92tmBYKDCAyDSh9b8UuP4NybZCCPeeYcL] f:["ColorSpaceUtility.hlsli"])
用法
将此添加到您的 Cargo.toml
[dependencies]
include-merkle = "0.1.4"
并将此添加到您的crate根目录
extern crate include_merkle;
许可
根据您的选择,许可如下
- Apache License,版本2.0 (LICENSE-APACHE 或 http://apache.ac.cn/licenses/LICENSE-2.0)
- MIT许可 (LICENSE-MIT 或 http://opensource.org/licenses/MIT)
。
贡献
除非您明确声明,否则您有意提交给此crate的所有贡献,根据Apache-2.0许可定义,将按上述方式双许可,不附加任何额外的条款或条件。
欢迎贡献;请查看 问题跟踪器 了解已记录的已知改进。
行为准则
include-merkle crate的贡献在贡献者协约的条款下组织,include-merkle的维护者@gwihlidal承诺将介入维护该行为准则。
依赖项
~11MB
~172K SLoC