Compare commits
1592 Commits
temp-geome
...
temp-enum-
Author | SHA1 | Date | |
---|---|---|---|
c6f85d7a8d | |||
25f44ab631 | |||
1d729aa2f7 | |||
aa440923c8 | |||
1f6010e609 | |||
![]() |
3a4c8f406a | ||
4648c4990c | |||
b17561f8b2 | |||
44239fa106 | |||
dea72dbb9d | |||
fe2cde8390 | |||
74257d6ccb | |||
7c25399576 | |||
a356e4fb3f | |||
4f246b8bf9 | |||
7383f95443 | |||
74fe19b193 | |||
fd0ba6449b | |||
ed0df0f3c6 | |||
aa13c4b386 | |||
e5fb5c9d7b | |||
![]() |
e452c43fd6 | ||
570331ca96 | |||
0bdf9d10a4 | |||
cc949f0a40 | |||
fb0ae66ee5 | |||
![]() |
368d794407 | ||
8eff3b5fe0 | |||
5f44298280 | |||
9dc3f454d9 | |||
9b2f212016 | |||
07a4338b3a | |||
![]() |
c092cc35b3 | ||
accdd4c1bc | |||
41607ced2b | |||
625349a6bd | |||
65bbac6692 | |||
faeb2cc900 | |||
440a3475b8 | |||
9daf6a69a6 | |||
0bcf014bcf | |||
65c5ebf577 | |||
0b01b81754 | |||
41b0820ddd | |||
45bd98d4cf | |||
6c24cafecc | |||
cb487b6507 | |||
09f1be53d8 | |||
c56cf50bd0 | |||
![]() |
de8e13036b | ||
![]() |
4e2478940e | ||
6b0a6c2ca9 | |||
04b4ec7889 | |||
ad679ee747 | |||
![]() |
486d1e8510 | ||
a7540f4b36 | |||
2eb94f3036 | |||
2772a033c9 | |||
8772a6fb9b | |||
b3597f310d | |||
![]() |
d5d97e4169 | ||
![]() |
afc60f9957 | ||
e0dae0f98f | |||
ab7214ca2e | |||
fe2ed4a229 | |||
abab16f7c7 | |||
33beec1cec | |||
e1c4e5df22 | |||
b4d47523c2 | |||
c865577643 | |||
![]() |
495e60c0da | ||
d728c22181 | |||
1c31d62951 | |||
e6ba5ec37b | |||
bb6547cb5f | |||
c55d0ebea5 | |||
393ef4d871 | |||
cd8350764b | |||
62bd391187 | |||
e736900e9a | |||
![]() |
d6e2210935 | ||
fc373af8f5 | |||
09cef0fc00 | |||
65548da002 | |||
3481d13104 | |||
ee4966d146 | |||
c3f5fca8a2 | |||
de581a2302 | |||
fb4b737518 | |||
27b37517f8 | |||
42df2a7b57 | |||
0969dcc861 | |||
8fa8e8bc37 | |||
34d289f98c | |||
c516659b5e | |||
0f80602632 | |||
b24a03e635 | |||
ed24b7d9a2 | |||
3b726cfee8 | |||
0654c41b0c | |||
4f387e66ac | |||
56ee96349d | |||
23ef20855b | |||
ebc81c6de4 | |||
ffd8b05e20 | |||
1006e84faa | |||
892da668dc | |||
dfb86671fe | |||
eddf5ad581 | |||
2fb43d04cb | |||
6002914f14 | |||
dad7371b41 | |||
eaa9feb9a0 | |||
d12eff1a88 | |||
6069ff45c7 | |||
f121713ece | |||
f315a46982 | |||
81baeec59b | |||
a804a11db1 | |||
7a5b8cb202 | |||
48841c479f | |||
6c83001143 | |||
9e611c5616 | |||
![]() |
9be49a1069 | ||
97ff37bf54 | |||
d1a9425a2f | |||
f0bc7f3261 | |||
4b56eed0f7 | |||
f24ad274cb | |||
81bee0e75a | |||
3211c80a31 | |||
ae899e4bb8 | |||
8d2a0d9b4c | |||
cc49c479a7 | |||
1bc655c5aa | |||
aaf86bad87 | |||
c473b2ce8b | |||
212dcd6075 | |||
594ee5f160 | |||
bbd8d33453 | |||
![]() |
7c75529333 | ||
87e2154daf | |||
f415b41a94 | |||
616594fcb1 | |||
625b2f59f0 | |||
2986924301 | |||
29efd26e71 | |||
885c79915f | |||
e65230f0c0 | |||
![]() |
b4af70563f | ||
a0f50c1890 | |||
da97859656 | |||
4e09fd76bc | |||
35198606d5 | |||
00734d5724 | |||
32c90d2d7c | |||
29e5c330cf | |||
d7f4fdf845 | |||
016a575002 | |||
3a4dade2f8 | |||
b9968b83ad | |||
40d090cc72 | |||
5cc21b095a | |||
68e86c4816 | |||
9b1882f986 | |||
445361c2ac | |||
82efcfc188 | |||
c5ace142e6 | |||
7061d1e39f | |||
1b6238edba | |||
5b7a14c019 | |||
9d2e325694 | |||
50b0503a11 | |||
![]() |
3364a5bea6 | ||
![]() |
6986b43b3d | ||
df3e30398f | |||
e7e3431b29 | |||
e51735d276 | |||
![]() |
4960ad420b | ||
![]() |
36f5198282 | ||
556c71a84a | |||
5c34e34195 | |||
1c6d3d614a | |||
101fa4a425 | |||
c7fcc50842 | |||
b7260ca4c9 | |||
2373ce7fcf | |||
2eed1afd11 | |||
a72b26527d | |||
ffe115d1a8 | |||
2becb3e9af | |||
b646846646 | |||
37b862fa6c | |||
db43d19c16 | |||
![]() |
9e71a07547 | ||
d3328fabc9 | |||
8eff1eca52 | |||
be4478d1f8 | |||
ff4959eeaa | |||
![]() |
b5162638c5 | ||
165100d8ac | |||
ffb5d1205e | |||
805540c713 | |||
80a46955d8 | |||
c641107c95 | |||
978ef093db | |||
2d6d8fc7ca | |||
82b20b6975 | |||
bfb664b65d | |||
feaf5b95e0 | |||
74ef424cb7 | |||
36a6528723 | |||
08c4f134d2 | |||
d7f9f083d4 | |||
7c188d8241 | |||
9cd5b3c9b6 | |||
682f1548be | |||
b849f290c5 | |||
27103c56b4 | |||
c0fdaf700a | |||
3e6907eb8a | |||
915f911daa | |||
0c6b815855 | |||
d6ed9c2b40 | |||
a9bda98519 | |||
431524aebc | |||
ccead2ed9c | |||
![]() |
4e5537d841 | ||
7aaedc09c7 | |||
c29f9e14e4 | |||
e10caf6fe3 | |||
d17128520d | |||
a7672caeb2 | |||
![]() |
a827864e6b | ||
![]() |
1e590234f7 | ||
c5d08aa0a3 | |||
de2988ea1b | |||
debf4b70db | |||
ec5d2e6872 | |||
ef30a876b5 | |||
2ecaa971f0 | |||
![]() |
aa0ac0035a | ||
8b516d8712 | |||
b73993bcc9 | |||
2a88343213 | |||
04d35f9315 | |||
0d8f1414a2 | |||
f81190f85f | |||
3532da44ee | |||
42d0107ee5 | |||
5095e4fc22 | |||
bdf6665e3a | |||
b55bddde40 | |||
2b12b4cd7d | |||
e1f1b0841d | |||
68759625b1 | |||
cea7ee7582 | |||
7996b49cb0 | |||
8dbca01531 | |||
ac0eefe26f | |||
11392829ad | |||
c4b73847d3 | |||
f674176d77 | |||
8c58838f6a | |||
a72ed0bb7f | |||
18392cef17 | |||
5cd1210b52 | |||
7aa311e539 | |||
48e2a15160 | |||
3dcd042bfc | |||
978f2cb900 | |||
53fdde3f64 | |||
3a454beae7 | |||
0a254109b8 | |||
29dff8f844 | |||
242ad4bd0f | |||
20b163b533 | |||
27621490c2 | |||
980bc5a707 | |||
12bf4adbe3 | |||
2c23256288 | |||
dabfac37e3 | |||
cde982d672 | |||
![]() |
6981bee2c7 | ||
c01b3c534b | |||
89c9fa8b73 | |||
1b2342b4d3 | |||
698b05fc58 | |||
a7e92843f7 | |||
e64d4d0200 | |||
efcf36f2e9 | |||
0daf429591 | |||
2f0f08bc98 | |||
b7dc667eb2 | |||
b1bf884889 | |||
7a4ee2fd4f | |||
9bd97e62ad | |||
52f4a908f7 | |||
ffd3dd6376 | |||
0c3b215e7d | |||
a2f5a10129 | |||
2b3becf2be | |||
223f2b27d1 | |||
21e168069d | |||
8ca6e51ade | |||
a5b996df88 | |||
69a7734b75 | |||
47d12268e3 | |||
9cc05fe9c4 | |||
af9e0409f1 | |||
7b436ead6b | |||
2fb43f08e7 | |||
4511964594 | |||
a0edddaa0c | |||
5363437555 | |||
24310441dd | |||
75f5edcaf3 | |||
348d7c35a9 | |||
6ddbcaa096 | |||
55e68f1b70 | |||
e045249a28 | |||
1c0be7da4c | |||
b8c573c9cd | |||
85176c86f0 | |||
765c2cc6c7 | |||
b6c2deef05 | |||
6321dd3d40 | |||
4ed1e19d2f | |||
339fd8027f | |||
2f667c2bc9 | |||
adc540cf7c | |||
69e5042258 | |||
1704a394d8 | |||
d56d3fc6b1 | |||
06b183d1ca | |||
6acba759e0 | |||
8fbbd69946 | |||
e85e126e3f | |||
c0fbbc53e8 | |||
64de6ad4fe | |||
2fb725ea30 | |||
bb3de31f84 | |||
9de4f64197 | |||
6897c2141e | |||
f85c58ab65 | |||
fc01801df7 | |||
7150f919d3 | |||
0eb63328e8 | |||
d5e343be27 | |||
d07e3bde20 | |||
9111ea78ac | |||
b6dd5be213 | |||
b5eada7f69 | |||
![]() |
3df587b798 | ||
3f0991266f | |||
2a4dfaa0e9 | |||
![]() |
81bd49d4fe | ||
894096a528 | |||
a96b2f39b8 | |||
![]() |
7dd84f05aa | ||
fe44001215 | |||
![]() |
a50f8b3fd8 | ||
8379eefafb | |||
5327413b37 | |||
28eaa81f1e | |||
![]() |
0b060905d9 | ||
0ab1b19de4 | |||
cedc80c08d | |||
6bc54cddfb | |||
806521f703 | |||
289f013e64 | |||
154a060777 | |||
49a0453799 | |||
![]() |
6e26c615af | ||
de4793e0e6 | |||
55ce05e0bb | |||
346a812d7e | |||
3cd398f16f | |||
d052169e7e | |||
1e749d0602 | |||
b99d6e1bed | |||
e2937ff24f | |||
a0633e2484 | |||
d4d38e8a34 | |||
c312c71969 | |||
![]() |
b2e9f35c5e | ||
![]() |
1b6daa871d | ||
![]() |
4e502bb6d2 | ||
![]() |
a06abbac92 | ||
ae9052a33e | |||
9cfffe8468 | |||
03a962d8ca | |||
945a99386b | |||
02a9377da0 | |||
fcf1ba18f0 | |||
b5f42029b8 | |||
dcdbaf89bd | |||
0c3da7f370 | |||
2383628ee1 | |||
837b72fa83 | |||
7e94499bb3 | |||
d18d87d3e7 | |||
e1db6dc11b | |||
c8c53ceecc | |||
259731909c | |||
e3b2f0fd6f | |||
51c1c1cd93 | |||
eae59645de | |||
c112418e95 | |||
f13826a572 | |||
43bc494892 | |||
2d42dc4182 | |||
7c860ab9d4 | |||
fb688c8d5c | |||
![]() |
be0d5da341 | ||
261bb766fb | |||
2887d87232 | |||
1688cb27cd | |||
cf771807b7 | |||
657923cf93 | |||
b546202a9a | |||
57f7650dc7 | |||
![]() |
c8aaa00e00 | ||
99fbf1716f | |||
38fc19d643 | |||
1e2589bfa5 | |||
0e71162e68 | |||
70947ebc65 | |||
59534dbee2 | |||
bbb5a77896 | |||
0283a22456 | |||
8eb10de739 | |||
c1c016b9a4 | |||
b43077ba3a | |||
adf82fe943 | |||
fc36772b06 | |||
35f4d254fd | |||
f2cc38a62b | |||
049510f425 | |||
673984b222 | |||
731926e70e | |||
![]() |
eda8065afc | ||
a6af0e570d | |||
690300eb4a | |||
ec9357a94e | |||
db8be0cdfb | |||
3620ce7f67 | |||
cefb0122b4 | |||
60b278a3bb | |||
43f97393bb | |||
e96b7c0092 | |||
ddb4eb8a89 | |||
5f1107ffaf | |||
aebb3d3062 | |||
289843119d | |||
2f8ed53d6f | |||
be7ce7cb4d | |||
c1cfb475b3 | |||
4b57d5a9a0 | |||
4adde62f60 | |||
2501d00268 | |||
45439dfe4c | |||
5568599015 | |||
a7879dea7c | |||
8761699eab | |||
43c603c2ff | |||
2a2d873124 | |||
5aeecc0a29 | |||
4979537a65 | |||
99b6127b73 | |||
f0d20198b2 | |||
e1fb7740f8 | |||
c647bd899f | |||
16f468fb14 | |||
a2f0f98271 | |||
b838eaf2b9 | |||
b69195dd13 | |||
7d2c759054 | |||
8f02de3de7 | |||
e4a5fd4298 | |||
b02c8a40ff | |||
10789c5329 | |||
a8a1f48479 | |||
78c9c1012b | |||
39c11c03d0 | |||
3e32a68f38 | |||
bfd2921d38 | |||
c346bb1990 | |||
17efd14682 | |||
78c1c71988 | |||
f7a3450e63 | |||
dab3591588 | |||
f0a37dc31c | |||
7b9e3534cf | |||
bfec984cf8 | |||
71adad288b | |||
bca9ec767c | |||
487faed6d0 | |||
defc1b8e18 | |||
87470169e0 | |||
dc37990e24 | |||
![]() |
974002743e | ||
0d6f2cb303 | |||
9beb5e38a9 | |||
212b02b548 | |||
b6bed63b5b | |||
383985a91b | |||
ef6e03c8e0 | |||
059e5a8a4c | |||
62928b618a | |||
827d7e7d25 | |||
c1936be0c5 | |||
cc6d5bc241 | |||
7cbb01f07e | |||
9217f5c7a3 | |||
f5d8339fa5 | |||
aea7e55522 | |||
2a709c82c3 | |||
ff2e8d6510 | |||
bbd6dc55d1 | |||
19a559d170 | |||
332de3a2da | |||
aae5f15238 | |||
1832e11f39 | |||
8507336e76 | |||
![]() |
82cf25dfbf | ||
![]() |
7b1c5712f8 | ||
18b6f0d0f1 | |||
051bb46c55 | |||
c06a86f99f | |||
d161b5d204 | |||
e16bc136f9 | |||
933215d6da | |||
8b15b06b20 | |||
4d605ef2f4 | |||
b94447a298 | |||
16e1b18dd8 | |||
ec77228f0f | |||
b3b2cd1fa9 | |||
d9799e7706 | |||
55dda9fdb3 | |||
526e60d4f0 | |||
9cb4624296 | |||
0d155f274f | |||
a3b785bc08 | |||
44ac5830c5 | |||
99a2a73706 | |||
8d8ce64435 | |||
f195a3a30d | |||
2c2d4bc3a3 | |||
3e3ff1a464 | |||
485c634c4c | |||
e7fedf6dba | |||
7d3d09b69c | |||
b37caa3f06 | |||
71fd0f7b7b | |||
ca2ae350ec | |||
d040493cd4 | |||
8422b24e1c | |||
0cf9794c7e | |||
319de793d7 | |||
35aa3bf22d | |||
f81c514bd2 | |||
18ace3b541 | |||
63de6078da | |||
4db4a97355 | |||
c7b27f45ae | |||
0bfae1b120 | |||
be3e09ecec | |||
9fa304bf13 | |||
b6d2bee28f | |||
6871f8482b | |||
3286150ac9 | |||
7bffddfa6e | |||
a062d86230 | |||
eaed38cbd3 | |||
730de2e7fd | |||
11e8a2ec5f | |||
03c0581c6e | |||
2d5c9e0baf | |||
5acbc01d0d | |||
26e3045eb9 | |||
03013d19d1 | |||
8ddfdfd2b2 | |||
7979dff9dc | |||
df2e053935 | |||
ec831ce5df | |||
3371a4c472 | |||
f1a662c157 | |||
01d7211380 | |||
efbd36429a | |||
773f5065f3 | |||
c3ef1c15f5 | |||
![]() |
52ccb44501 | ||
a90cb41cb9 | |||
d89c4999a7 | |||
dde11219c6 | |||
![]() |
366262bef5 | ||
4094868f73 | |||
![]() |
f41d4735e9 | ||
567bcb9387 | |||
b937b6d069 | |||
8de942b11d | |||
949dbb08d2 | |||
fd25e883e2 | |||
d7d40745fa | |||
b698fe1e04 | |||
fd477e738d | |||
b8b9023d8c | |||
af26720b21 | |||
75704091fc | |||
eb1fed9d60 | |||
16a8d0fab0 | |||
118664e463 | |||
6d3d2988fa | |||
![]() |
ddf97d6270 | ||
d20fa6c4d4 | |||
![]() |
41a4c62c31 | ||
816d3f830b | |||
5bfe09df22 | |||
fee2cedb33 | |||
f11ed418e5 | |||
fe68b54edb | |||
9ba22bd1f7 | |||
7bc7d1747c | |||
ee743204b0 | |||
5f9b00a07e | |||
89637f40df | |||
9dbfa05c44 | |||
9db13c8d79 | |||
4c0512bc32 | |||
7ae2810848 | |||
3434a991ec | |||
e463d2c16f | |||
![]() |
6f5bf8aa3b | ||
4e22a9ab9e | |||
32cc9ff037 | |||
40f59b5dad | |||
4468c34378 | |||
348b5f98f0 | |||
8f1284ab78 | |||
3be91d6da5 | |||
046a99d580 | |||
08a1492ae5 | |||
972677b25e | |||
![]() |
a84f1c02d2 | ||
b17038db31 | |||
e8027ec2a0 | |||
2a7b9f2d45 | |||
6da63b19ff | |||
1267dfee7c | |||
4758a7d357 | |||
1bc28fc73b | |||
bc2f4dd8b4 | |||
4b1ad2dc17 | |||
cfde1f9f3b | |||
b15e1861ac | |||
bd7f1c5cce | |||
cdcca917cf | |||
4100a79219 | |||
e7bea3fb6e | |||
60e2103507 | |||
5c2330203e | |||
8cecf88dca | |||
61bb70e0c7 | |||
039094c1ec | |||
2b91445ddd | |||
3c2e4f4cfd | |||
06ae3c98eb | |||
892e5f4a9f | |||
550cbec5c4 | |||
31f6e78370 | |||
beea601e72 | |||
8e56f3e8a3 | |||
b3ca926aa8 | |||
1ecb4e6fd8 | |||
15762e9611 | |||
d16e732638 | |||
c4fa17c67a | |||
8733d310e5 | |||
b714f9bf43 | |||
![]() |
82ae7b990a | ||
84f7bf56a8 | |||
4266538ab9 | |||
28ad680ff0 | |||
3e75f70acd | |||
6f0dd4f0f0 | |||
665657812d | |||
cc388651eb | |||
6ce383a9df | |||
1411118055 | |||
e288e392a8 | |||
![]() |
dc2524eaae | ||
8c21667f3c | |||
a3d0b50d75 | |||
dd505a7ebb | |||
7a0cad0989 | |||
9ad642c59a | |||
50e7645211 | |||
3bcd264141 | |||
![]() |
3af597d16b | ||
2a7a8a04e3 | |||
231d66d8ba | |||
![]() |
62d64bec2a | ||
1d9e2dc954 | |||
cfc64261c1 | |||
c51eac24fe | |||
ca5d84b31d | |||
3e1fd26828 | |||
8cd4cee0d5 | |||
cf72b10075 | |||
742b7adbad | |||
7ac4e874db | |||
cca811de98 | |||
7ef3fe492e | |||
cd6fc651ce | |||
85312f2236 | |||
70aad5f498 | |||
16ffa7bb6e | |||
76ebc10794 | |||
39f88480bb | |||
0c16ac9ddf | |||
![]() |
781289e31f | ||
01e2a532f5 | |||
![]() |
029cf23d71 | ||
c4b02bb6bc | |||
269f4a3024 | |||
ab1909fe06 | |||
282516e53e | |||
65dbeb1d81 | |||
![]() |
d092933abb | ||
d1fcf93f03 | |||
675a22b341 | |||
1133b1478e | |||
c37121f16c | |||
622d8b77a6 | |||
fa688fbf06 | |||
b0d64841d2 | |||
05ab3356a7 | |||
3e1baa7d53 | |||
bdbaf0301d | |||
d9ebe25a0c | |||
f45470472f | |||
94fb47e572 | |||
a286148799 | |||
9aab1a4626 | |||
0c66885276 | |||
be171b295f | |||
be558d2d97 | |||
aea2287af3 | |||
0a63297a88 | |||
![]() |
9b1b4b9e32 | ||
1d96a48267 | |||
65490e6270 | |||
3858bf5c6f | |||
7b9319adf9 | |||
deb7ec312a | |||
594c857f65 | |||
16c79d3b82 | |||
ff46afb4dd | |||
4b48b1079d | |||
5ccec8ec6b | |||
9a1fce698b | |||
090be2775e | |||
6600ae3aa7 | |||
![]() |
df00463764 | ||
fd560ef2af | |||
7681326acd | |||
10fb5cc58d | |||
91b4c1841a | |||
ab0195c78f | |||
a5917175d8 | |||
417ce7ffc1 | |||
f81f56751a | |||
39810b3f51 | |||
![]() |
6ef8c9e646 | ||
f6af3d9197 | |||
641a5be50e | |||
17a96051cf | |||
84bb6d7c02 | |||
e79e86018e | |||
2eb2e861a3 | |||
8d2cabcb97 | |||
98e1c6e935 | |||
f0f1198867 | |||
cfbac9032b | |||
5faa333e78 | |||
d71c423c28 | |||
3a2b7f35f4 | |||
063c4e467d | |||
2a047fadc0 | |||
33d6d7c6e3 | |||
ec31f31749 | |||
5297bf318e | |||
035dcdad90 | |||
6910278604 | |||
2905b493fe | |||
15e71f3d97 | |||
6b761c59d2 | |||
3f8b45d8d1 | |||
98c53f660a | |||
![]() |
f0df0e9e07 | ||
704d077d8f | |||
010e675b1b | |||
1de8374374 | |||
![]() |
9959c5315f | ||
7d111f4ac2 | |||
0baa876b83 | |||
40c3b8836b | |||
1a96045eec | |||
0c52eed863 | |||
52c5300214 | |||
cccfa597ba | |||
001f548227 | |||
![]() |
2537b32392 | ||
334a8d9b3e | |||
e00bf04c0f | |||
990b912fd7 | |||
494c3fb1bd | |||
2d46cef2e8 | |||
4539c7cc57 | |||
2743d746ea | |||
3435ea014d | |||
dfb193f634 | |||
f855e2e06e | |||
40180c3500 | |||
![]() |
ba4e227def | ||
d28aaf6139 | |||
4f15c24705 | |||
9001dd7f29 | |||
690e1baf72 | |||
f605ce7e9a | |||
dd728e1539 | |||
381965eb56 | |||
16eafdadf6 | |||
![]() |
df445cc571 | ||
dfa1c7e554 | |||
6cd191a660 | |||
25c173ffd1 | |||
2bcf93bbbe | |||
943debfab5 | |||
6ed93391c4 | |||
fd7510984a | |||
b280699078 | |||
ef9269bd62 | |||
bca2701236 | |||
93197c4660 | |||
967fec6883 | |||
d73f664790 | |||
d7b4350749 | |||
![]() |
a83b405a45 | ||
85c8dd6c96 | |||
fccc530003 | |||
![]() |
67dbb42236 | ||
![]() |
56bf34aa17 | ||
823996b034 | |||
b6c3b41d41 | |||
a3d4ed20f9 | |||
7a61916717 | |||
a7ade57e11 | |||
79a88b5e91 | |||
57f1379104 | |||
b3b7319de7 | |||
1c5722ba07 | |||
0a6cf3ed0c | |||
9a1d75e0b9 | |||
a7075a30e2 | |||
219058c213 | |||
cd36f59027 | |||
fd77a28031 | |||
d06828f0b8 | |||
![]() |
943e73b07e | ||
6e473a897c | |||
7fa6794037 | |||
5b6dacb9eb | |||
9e9d003a82 | |||
8e8932c8ff | |||
6ee181ec24 | |||
a395a1b36b | |||
c107a3c4d9 | |||
765eba5a6e | |||
abc3128011 | |||
d6b54068d4 | |||
6e859f7ff8 | |||
9c8255d486 | |||
695dc07cb1 | |||
a76bb1a277 | |||
da949c3574 | |||
c4f733a76c | |||
b74f2c7d74 | |||
a3457704fb | |||
482c5f0014 | |||
![]() |
c1d138dd92 | ||
d7b231baa8 | |||
3a898db363 | |||
41eba47a87 | |||
06356115b7 | |||
5f59bf0044 | |||
ec8a9a0d65 | |||
9f895fbb97 | |||
9a8badc1e4 | |||
3a25501143 | |||
a9cb330815 | |||
2430f75279 | |||
3065d26097 | |||
a184d0dd02 | |||
fc4b1fede3 | |||
![]() |
1df3b51988 | ||
44c3bb729b | |||
2944f3e92b | |||
46fe43feca | |||
3cbe921899 | |||
aef8ac7db8 | |||
0071001879 | |||
fb88ff8f0c | |||
b246f81412 | |||
dd689eeda4 | |||
ef7e21fd4a | |||
3edae09eaa | |||
![]() |
729b2d026d | ||
de6bf5d4d2 | |||
e150f171d5 | |||
![]() |
765b1c6b53 | ||
![]() |
4de0e2e771 | ||
f9113c4be8 | |||
1f51037676 | |||
6f76bcc12c | |||
![]() |
f9fe755dba | ||
eb0d216dc1 | |||
746ee29d36 | |||
4f3f79c382 | |||
3f4ba64ae3 | |||
2a8e5128c1 | |||
6bf8c95e52 | |||
59c95a8ca2 | |||
![]() |
69d6222481 | ||
be22e36692 | |||
f5edc69150 | |||
e538b2c3a3 | |||
c5a13ffcb4 | |||
![]() |
452c78757f | ||
![]() |
962b17b3ca | ||
93544b641b | |||
19740b25c7 | |||
6b0719c0f3 | |||
3c36803189 | |||
4a00faca1a | |||
5c961b3b58 | |||
b3c469153e | |||
73753e1a67 | |||
1c18f05f0b | |||
4586688323 | |||
5fed3aec4a | |||
138fdf78ba | |||
73fbd3eebd | |||
![]() |
41dc558747 | ||
![]() |
c383397d07 | ||
e11b33fec3 | |||
81514b0e91 | |||
9a3c7da934 | |||
9b1b1d9269 | |||
5b9a911c4b | |||
![]() |
88d295f952 | ||
19bab2a536 | |||
76f386a37a | |||
47a72ac4fd | |||
4682aad432 | |||
![]() |
45e16a6c96 | ||
d9e697fbbd | |||
1b6752e599 | |||
4ba7201546 | |||
b66b3f547c | |||
7bf9c70b14 | |||
![]() |
104887800c | ||
6e4ab5b761 | |||
![]() |
d4f1bc5f39 | ||
![]() |
78b5050ff4 | ||
2f36762def | |||
5d565062ed | |||
509b637d59 | |||
eb71157e2a | |||
2ba7c3aa65 | |||
70376154a0 | |||
53f25df5bc | |||
f834939ceb | |||
da3946b710 | |||
aca38148ad | |||
e46055ae9d | |||
![]() |
93a8fd1249 | ||
30bed8761d | |||
3022e190a2 | |||
d649b4b066 | |||
9a76dd2454 | |||
beecd24fc6 | |||
3ca2697001 | |||
3ccdee7532 | |||
2055ef107a | |||
89c7c115ce | |||
cddda70618 | |||
42a05ff6ea | |||
17b8da7196 | |||
1996efe7aa | |||
497d0400bd | |||
328b6f672b | |||
2289295555 | |||
5e12e62a6a | |||
b42ce0c54c | |||
5e8775a8da | |||
a0f269f682 | |||
47caeb8c26 | |||
![]() |
2341ca990c | ||
55cf9bb5e6 | |||
![]() |
25a255c32a | ||
138aa20959 | |||
![]() |
240345842d | ||
9ca567bc4e | |||
56b35991bc | |||
42d79a6041 | |||
583939c54d | |||
aa46459543 | |||
4f5ef3b018 | |||
3be2d6078f | |||
a620ce7e54 | |||
f12ea3d52e | |||
5fec6eda55 | |||
a059d16f65 | |||
5401fda412 | |||
576142dc85 | |||
c6e956bbb1 | |||
9dff3de6ac | |||
685ceaa2f7 | |||
8434aa1b78 | |||
8278ad3dfb | |||
a3610c451a | |||
f609b05b11 | |||
1c42d4930a | |||
a2ee3c3a9f | |||
ea79efef70 | |||
ecb8a574c7 | |||
91c33c8b99 | |||
988b9bc40c | |||
1ae79b704a | |||
10abaf3ddf | |||
d39cd851c0 | |||
98a62a5c08 | |||
366cea95c5 | |||
96876305e1 | |||
![]() |
78445ebd5f | ||
51ea08487b | |||
![]() |
92b7bf4856 | ||
![]() |
6c11b320c4 | ||
d0a4a41b5d | |||
![]() |
9d49fc2ba0 | ||
356dce13f0 | |||
c29f20a521 | |||
e659f78d3e | |||
24cc552cf4 | |||
d4e8390e95 | |||
![]() |
5183653951 | ||
72e81a45c4 | |||
![]() |
59113df8ec | ||
8c0698460b | |||
f71d479556 | |||
0558907ae6 | |||
86536e7859 | |||
f12513a21c | |||
9c412b6e2d | |||
![]() |
3021babf38 | ||
53af51ad50 | |||
9e3c84a5d6 | |||
![]() |
351721d0ea | ||
f18ab3470f | |||
9d03990e32 | |||
eb56e8cd78 | |||
a6da1884ba | |||
![]() |
5e3877e0c8 | ||
![]() |
0c7e836a1d | ||
ad80248875 | |||
72a47fea5d | |||
c63fb657c8 | |||
45f167237f | |||
6535779c92 | |||
a2daf92a57 | |||
1db42c9b79 | |||
aaf3a63dca | |||
c1a1644db7 | |||
30cd1d10a9 | |||
b7b2103cf7 | |||
7867feae56 | |||
a7300a217d | |||
74ea21ec9d | |||
f1d97a308d | |||
3a03d6c851 | |||
a06435e43a | |||
b67a937394 | |||
cc04399937 | |||
ad1735f8ed | |||
ac657bee01 | |||
![]() |
29e5dc1b19 | ||
690382bef5 | |||
e8dc02aa3f | |||
9dda65455b | |||
cfa59b3fab | |||
eb8afc39f8 | |||
6139782d81 | |||
3d35d4a9e5 | |||
7b0b050dd5 | |||
fe958d7d99 | |||
c1c6c11ca6 | |||
a91c6f1804 | |||
![]() |
70fd6a313e | ||
8f66f40318 | |||
cdeb506008 | |||
4b31a21bcd | |||
![]() |
f7ef68514b | ||
![]() |
e005ad5b54 | ||
![]() |
ca8e8fd8d4 | ||
d993c7b503 | |||
db851ccd2a | |||
a94343a8af | |||
73a05ff9e8 | |||
40360253ae | |||
bb6cc67d05 | |||
![]() |
c1b4abf527 | ||
83f87d9f21 | |||
3de76a067a | |||
ecedef09e7 | |||
cae4d8637c | |||
4703e125bf | |||
![]() |
9c00486451 | ||
275d0d3397 | |||
eca2a41964 | |||
a82c9e1e40 | |||
0ceded7bc9 | |||
![]() |
f9755add65 | ||
cc6ca13852 | |||
a6d34f4c3f | |||
6e92a2d591 | |||
813ca82f1e | |||
a282efecbc | |||
bdd2a7f466 | |||
fef4dc7269 | |||
d2454487d1 | |||
1bfa9539d3 | |||
![]() |
79425ed326 | ||
2561145da8 | |||
e541f37529 | |||
27ac80f068 | |||
13df8616ce | |||
6391949601 | |||
728e31e18a | |||
886196b888 | |||
8f8982d57c | |||
17c928e975 | |||
7bd0de9240 | |||
3a65571195 | |||
94d2736dfb | |||
ff57ce8617 | |||
38c4888f09 | |||
0c684a7046 | |||
736be7cf58 | |||
4d71138738 | |||
bff3dcf330 | |||
f01c4f27f9 | |||
ff9587d28e | |||
ebe2374528 | |||
601a6a7dc6 | |||
596446dbc6 | |||
7afde7cd22 | |||
092424dae3 | |||
2aca08fc1c | |||
86643a4e73 | |||
04ad42d83b | |||
5da58f48ae | |||
482806c816 | |||
a3e2cc0bb7 | |||
bd65d3ce97 | |||
3284b5bbde | |||
6c11733dfb | |||
741fb0d6c9 | |||
415098abc3 | |||
ebe216f532 | |||
de07bf2b13 | |||
8f4697e570 | |||
2f9fab716d | |||
f9f88f50cb | |||
29e496e768 | |||
23791db145 | |||
4ee97f129a | |||
9708b1f317 | |||
e9daca77d6 | |||
0cd3d46246 | |||
ba4e5399fc | |||
d04d27b406 | |||
919e513fa8 | |||
cc6a3509a0 | |||
1de922f88c | |||
1b79b4dd30 | |||
c7b237e7d1 | |||
9f9e2dd25d | |||
0d4c53ecfe | |||
0f58cc1594 | |||
719c319055 | |||
c0a5b13b5e | |||
13a28d9e6f | |||
123255be6b | |||
7fc11744e6 | |||
87a36cba1a | |||
00bd631c7c | |||
eadbacdbb0 | |||
70cc80ea1c | |||
439c9b0b84 | |||
877ba6b251 | |||
306e9bff46 | |||
04857cc8ef | |||
0fd0b0643a | |||
8a6f224e26 | |||
bbfa6a92cf | |||
b7dc0346aa | |||
0194e54fd3 | |||
75fbf6f17e | |||
536109b4ec | |||
2012d541ae | |||
![]() |
12c66854bd | ||
c6275da852 | |||
e41dddd29a | |||
cda20a7af8 | |||
539575b585 | |||
335f40ebfa | |||
03f8c1abd0 | |||
18c6314e26 | |||
3c4537cd38 | |||
ac9ec52e9e | |||
4ab8212e1a | |||
9ed19db539 | |||
b5ea3d2c09 | |||
![]() |
ca0450feef | ||
85267ec1ae | |||
68dc970219 | |||
82f0e4948c | |||
ce66075d00 | |||
c73a550e90 | |||
876b250499 | |||
ba95cf6234 | |||
8e2a21e862 | |||
9161993e02 | |||
0e590f9078 | |||
df8f507f41 | |||
bf35dba7fb | |||
b534806ecb | |||
0d68d7baa3 | |||
8113b8391a | |||
76de3ac4ce | |||
11d31addf8 | |||
c148eba16f | |||
b93e947306 | |||
dcac86f4f1 | |||
fd592538d9 | |||
26dac33ce1 | |||
6d2b486e43 | |||
7b5835c793 | |||
432d5bc692 | |||
16e7a7b5b1 | |||
88c02bf826 | |||
0a1a173e57 | |||
6eefcd7d78 | |||
11be9edae2 | |||
c11585a82f | |||
6e268a749f | |||
758f3f7456 | |||
dbe3981b0a | |||
9a0850c8c2 | |||
b1e6e63c22 | |||
55b8fc718a | |||
71cf9f4b3f | |||
b6ad0735a6 | |||
7df6f66ea2 | |||
9824df49c0 | |||
7a66a9f22e | |||
1d49293b80 | |||
08511b1c3d | |||
300403a38b | |||
caac532565 | |||
![]() |
1b22650fbf | ||
2b66b372bc | |||
2dace5f3ef | |||
92c449776d | |||
18959c502d | |||
c38d2513c5 | |||
d1ade756a9 | |||
655ce5dc3e | |||
c8d59b60b5 | |||
3391a2ef1d | |||
ffa20de050 | |||
65b5023df4 | |||
076d797bda | |||
301ee97b93 | |||
f2c896a9ad | |||
2b6f2072f1 | |||
4fd7ce321d | |||
0bc4056455 | |||
4a3464050c | |||
b536605e78 | |||
4882208633 | |||
cc636db8f2 | |||
f806bd8261 | |||
fc4886a314 | |||
326bd76d3b | |||
a80a2f07b7 | |||
76238af213 | |||
8ca7250982 | |||
dc4c2815a6 | |||
![]() |
e62ce9e08e | ||
23d9953c80 | |||
ce6a24976a | |||
f2b86471ea | |||
37003cbbc1 | |||
87a3cb3bff | |||
8c55333a8e | |||
fc6228bd85 | |||
93e92ac126 | |||
357acd1d50 | |||
e43fcc014a | |||
3c3669894f | |||
6e48a51af7 | |||
606271966e | |||
e0e7a5522f | |||
e7274dedc4 | |||
cc8fa3ee90 | |||
dfdc9c6219 | |||
b6195f6664 | |||
272a38e0c2 | |||
c9af025936 | |||
1e5cfebf66 | |||
57272d598d | |||
ee79bde54d | |||
c4dca65228 | |||
3b1a243039 | |||
2305f270c5 | |||
adc084a3e9 | |||
ae86584404 | |||
98fe05fb5b | |||
1833ebea31 | |||
bf354cde96 | |||
64d07ffcc3 | |||
17e2d54a3d | |||
a812fe8ceb | |||
2f52f5683c | |||
06c3bac23b | |||
fb34cdc7da | |||
0998856c92 | |||
8fc97a871f | |||
5d5a753d96 | |||
e1e75bd62c | |||
a8d6a86981 | |||
c206fa9627 | |||
f2da98d816 | |||
d3afe0c126 | |||
e863e05697 | |||
b57b4dfab1 | |||
f49dff97d4 | |||
74f45ed9c5 | |||
![]() |
c5c94e3eae | ||
34cf33eb12 | |||
![]() |
54927caf4f | ||
12e8c78353 | |||
1476d35870 | |||
1fb364491b | |||
eacdc0ab4a | |||
dc30a9087c | |||
9e456ca695 | |||
aae96176e8 | |||
e1952c541a | |||
![]() |
fb820496f5 | ||
f497e471f8 | |||
3be4cb5b27 | |||
56ce51d1f7 | |||
1c7ce7e0b4 | |||
271210126e | |||
f9acf21063 | |||
bdc66c9569 | |||
eb3a8fb4e8 | |||
798e593002 | |||
21c29480c3 | |||
928d644895 | |||
af0b7925db | |||
7843cd63d8 | |||
ae4b45145c | |||
2e6c6426d3 | |||
bdb7d262aa | |||
b559fb178e | |||
4485dc483c | |||
![]() |
3a59ddb292 | ||
66fe1c79f3 | |||
e2df5c8a56 | |||
f3274bfa70 | |||
4569d9c0c3 | |||
![]() |
33dc584b37 | ||
![]() |
213554f24a | ||
8d60ac2bb0 | |||
![]() |
1a134c4c30 | ||
a754e35198 | |||
ac582056e2 | |||
![]() |
be70827e6f | ||
827e30bd15 | |||
6cff1d6480 | |||
dd3391dd99 | |||
4389067929 | |||
4ee2d9df42 | |||
42ce88f15c | |||
628fab696c | |||
5d42ea0369 | |||
d754d85845 | |||
1a72744ddc | |||
779ea49af7 | |||
07c5d02a11 | |||
3453b22b1e | |||
9628ef4135 | |||
80d7cac22d | |||
ae0f944a57 | |||
5f632f9f6e | |||
af13168a3f | |||
e9dac3eab8 | |||
fdcae48663 | |||
2c2516bfc9 | |||
66e24ce35b | |||
84dcf12ceb | |||
81f552e9ad | |||
cd03f5b6e5 | |||
0cddbcf1d7 | |||
a2e321aa6d | |||
d3d021601d | |||
19785cb022 | |||
![]() |
22c61e8060 | ||
6f23e4484d | |||
1d478851f8 | |||
214baf5422 | |||
45a312fd8f | |||
9d9f205dc4 | |||
df9120b365 | |||
6aac892fad | |||
367775ac6a | |||
4d4113adc2 | |||
fe070fe33b | |||
901fa96b7f | |||
1f4545dc9c | |||
b80ed8396d | |||
c33a005297 | |||
ef29bf9023 | |||
![]() |
5cebcb415e | ||
ffb9577ac9 | |||
731325a022 | |||
adaf4f56e1 | |||
![]() |
78b9a8c7b9 | ||
6351c73b75 | |||
0c32e3b312 | |||
4cf4bb2664 | |||
eabb134840 | |||
24a965bb16 | |||
f51bef75f4 | |||
8cbec0beb2 | |||
![]() |
a285299ebb | ||
![]() |
bf06f76be6 | ||
008ae26712 | |||
eddc3f5bc8 | |||
756c22bb41 | |||
d1220f795f | |||
8e40bb2dea | |||
84251acfcc | |||
e81533b25e | |||
f0f70729b1 | |||
7f5d62dfc6 | |||
4a48482247 | |||
960b21e1d7 | |||
6dceaafe5a | |||
b524153d61 | |||
79290f5160 | |||
efe3a13b55 | |||
9f0a3a99ab | |||
283d76a70d | |||
0830211c95 | |||
f84fb12f5d | |||
76377f0176 | |||
2ecd963d87 | |||
5cdb2aadfc | |||
![]() |
c7a7c3f5e5 | ||
87e315c237 | |||
![]() |
85aac0ef6a | ||
cc653c9b02 | |||
95fca22bfe | |||
86ec9d79ec | |||
e45ffce5fa | |||
![]() |
faedfd5740 | ||
![]() |
044a77352f | ||
262b211856 | |||
797064544e | |||
44e4f077a9 | |||
b32b38b380 | |||
f35ea668a1 | |||
e694165123 | |||
6ee2f2da96 | |||
10d926cd4a | |||
3acf3e9e2f | |||
330a04d7c7 | |||
53fa4801a0 | |||
34ba6968b2 | |||
f17ca53cdd | |||
640c4ace0b | |||
ff7e67afd5 | |||
728ae33f37 | |||
52a702468a | |||
d2004326a1 | |||
3e78c9e5bb | |||
3674347849 | |||
73b2ecb297 | |||
![]() |
9490db1ad2 | ||
6a745e54f6 | |||
5d160dec3b | |||
b3431a8846 | |||
6f29801f1b | |||
b91946780c | |||
741fa8180c | |||
e5ff9f3615 | |||
a64782b133 | |||
7cd43a9d28 | |||
def8fd6330 | |||
e7b9423623 | |||
c7d94a7827 | |||
986d60490c | |||
c53ffda8a4 | |||
f94164d896 | |||
5d70a4d7ee | |||
e6aabcae14 | |||
50b7253257 | |||
8da23fd5aa | |||
8967bcb755 | |||
847d355cab | |||
c76ccd85be | |||
11bfbc3337 | |||
c75c08a737 | |||
efa9667c09 | |||
10061ee18a | |||
90aa0a5256 | |||
aafbe111fc | |||
6578db57cd | |||
824733ea47 | |||
5bea5e25d5 | |||
0559971ab3 | |||
2189dfd6e2 | |||
7270ba011c | |||
4a0ddeb62b | |||
3d2ce25afd | |||
43167a2c25 | |||
5949d598bc | |||
b077f0684e | |||
a6b53ef994 | |||
2bd0205215 | |||
8fecc2a852 | |||
![]() |
0419c74ae8 | ||
4a562f5077 | |||
2a0db195c9 | |||
e87783a5ec | |||
95af9317f0 | |||
2c2e1b3d61 | |||
32ffb858d6 | |||
c618075541 | |||
a13b9d20b5 | |||
d90f542b04 | |||
5d5504d8a4 | |||
69893ef27c | |||
8dcddbcc07 | |||
30ef197c7b | |||
617954c143 | |||
547f7d23ca | |||
![]() |
f3ace5aa80 | ||
fe49904646 | |||
ddb0dc2527 | |||
10a26d583d | |||
![]() |
037e66999a | ||
d2dda0e8b9 | |||
![]() |
ad3e5d2bf5 | ||
f9e0981976 | |||
d046a1f2fa | |||
1cd8a438bb | |||
88a2b054da | |||
93b36fad68 | |||
80f7bc6d8e | |||
505422220d | |||
43394e41a8 | |||
ab09844be8 | |||
a3027fb094 | |||
b314d3e787 |
@@ -180,6 +180,7 @@ ForEachMacros:
|
|||||||
- CTX_DATA_BEGIN_WITH_ID
|
- CTX_DATA_BEGIN_WITH_ID
|
||||||
- DEG_OBJECT_ITER_BEGIN
|
- DEG_OBJECT_ITER_BEGIN
|
||||||
- DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
|
- DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
|
||||||
|
- DRW_ENABLED_ENGINE_ITER
|
||||||
- DRIVER_TARGETS_LOOPER_BEGIN
|
- DRIVER_TARGETS_LOOPER_BEGIN
|
||||||
- DRIVER_TARGETS_USED_LOOPER_BEGIN
|
- DRIVER_TARGETS_USED_LOOPER_BEGIN
|
||||||
- FOREACH_BASE_IN_EDIT_MODE_BEGIN
|
- FOREACH_BASE_IN_EDIT_MODE_BEGIN
|
||||||
@@ -267,3 +268,6 @@ ForEachMacros:
|
|||||||
StatementMacros:
|
StatementMacros:
|
||||||
- PyObject_HEAD
|
- PyObject_HEAD
|
||||||
- PyObject_VAR_HEAD
|
- PyObject_VAR_HEAD
|
||||||
|
|
||||||
|
MacroBlockBegin: "^BSDF_CLOSURE_CLASS_BEGIN$"
|
||||||
|
MacroBlockEnd: "^BSDF_CLOSURE_CLASS_END$"
|
||||||
|
5
.github/pull_request_template.md
vendored
Normal file
5
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
This repository is only used as a mirror of git.blender.org. Blender development happens on
|
||||||
|
https://developer.blender.org.
|
||||||
|
|
||||||
|
To get started with contributing code, please see:
|
||||||
|
https://wiki.blender.org/wiki/Process/Contributing_Code
|
@@ -30,7 +30,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
|||||||
"CMake generation for blender is not allowed within the source directory!"
|
"CMake generation for blender is not allowed within the source directory!"
|
||||||
"\n Remove \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" and try again from another folder, e.g.:"
|
"\n Remove \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" and try again from another folder, e.g.:"
|
||||||
"\n "
|
"\n "
|
||||||
"\n rm CMakeCache.txt"
|
"\n rm -rf CMakeCache.txt CMakeFiles"
|
||||||
"\n cd .."
|
"\n cd .."
|
||||||
"\n mkdir cmake-make"
|
"\n mkdir cmake-make"
|
||||||
"\n cd cmake-make"
|
"\n cd cmake-make"
|
||||||
@@ -156,6 +156,15 @@ get_blender_version()
|
|||||||
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
||||||
mark_as_advanced(WITH_BLENDER)
|
mark_as_advanced(WITH_BLENDER)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
# Currently this causes a build error linking, disable.
|
||||||
|
set(WITH_BLENDER_THUMBNAILER OFF)
|
||||||
|
elseif(WIN32)
|
||||||
|
option(WITH_BLENDER_THUMBNAILER "Build \"BlendThumb.dll\" helper for Windows explorer integration" ON)
|
||||||
|
else()
|
||||||
|
option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail extraction utility" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||||
|
|
||||||
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
|
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
|
||||||
@@ -388,42 +397,55 @@ if(WITH_PYTHON_INSTALL)
|
|||||||
set(PYTHON_REQUESTS_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'requests' module")
|
set(PYTHON_REQUESTS_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'requests' module")
|
||||||
mark_as_advanced(PYTHON_REQUESTS_PATH)
|
mark_as_advanced(PYTHON_REQUESTS_PATH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(WITH_PYTHON_INSTALL_ZSTANDARD "Copy zstandard into the blender install folder" ON)
|
||||||
|
set(PYTHON_ZSTANDARD_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'zstandard' module")
|
||||||
|
mark_as_advanced(PYTHON_ZSTANDARD_PATH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(WITH_CPU_SIMD "Enable SIMD instruction if they're detected on the host machine" ON)
|
option(WITH_CPU_SIMD "Enable SIMD instruction if they're detected on the host machine" ON)
|
||||||
mark_as_advanced(WITH_CPU_SIMD)
|
mark_as_advanced(WITH_CPU_SIMD)
|
||||||
|
|
||||||
# Cycles
|
# Cycles
|
||||||
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
|
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
|
||||||
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
|
option(WITH_CYCLES_OSL "Build Cycles with OpenShadingLanguage support" ON)
|
||||||
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
|
option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" ON)
|
||||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ON)
|
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||||
option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" ON)
|
|
||||||
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
|
||||||
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
|
||||||
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
|
|
||||||
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
option(WITH_CYCLES_DEBUG_NAN "Build Cycles with additional asserts for detecting NaNs and invalid values" OFF)
|
||||||
set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified device types (CPU CUDA OPTIX)" )
|
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
|
||||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF)
|
||||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified device types (CPU CUDA OPTIX HIP)" )
|
||||||
unset(PLATFORM_DEFAULT)
|
|
||||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
|
||||||
option(WITH_CYCLES_DEBUG_NAN "Build Cycles with additional asserts for detecting NaNs and invalid values" OFF)
|
|
||||||
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
|
|
||||||
option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF)
|
|
||||||
mark_as_advanced(WITH_CYCLES_KERNEL_ASAN)
|
mark_as_advanced(WITH_CYCLES_KERNEL_ASAN)
|
||||||
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
|
||||||
mark_as_advanced(WITH_CYCLES_LOGGING)
|
mark_as_advanced(WITH_CYCLES_LOGGING)
|
||||||
mark_as_advanced(WITH_CYCLES_DEBUG_NAN)
|
mark_as_advanced(WITH_CYCLES_DEBUG_NAN)
|
||||||
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
||||||
|
|
||||||
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
|
# NVIDIA CUDA & OptiX
|
||||||
option(WITH_CYCLES_DEVICE_OPTIX "Enable Cycles OptiX support" ON)
|
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles NVIDIA CUDA compute support" ON)
|
||||||
|
option(WITH_CYCLES_DEVICE_OPTIX "Enable Cycles NVIDIA OptiX support" ON)
|
||||||
mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
|
mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
|
||||||
|
|
||||||
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
|
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles NVIDIA CUDA binaries" OFF)
|
||||||
|
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||||
|
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
||||||
|
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
|
||||||
|
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime (for developers, makes cuda-gdb work)" ON)
|
||||||
|
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||||
|
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
||||||
|
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
||||||
mark_as_advanced(WITH_CUDA_DYNLOAD)
|
mark_as_advanced(WITH_CUDA_DYNLOAD)
|
||||||
|
|
||||||
|
# AMD HIP
|
||||||
|
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" OFF)
|
||||||
|
option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF)
|
||||||
|
set(CYCLES_HIP_BINARIES_ARCH gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 CACHE STRING "AMD HIP architectures to build binaries for")
|
||||||
|
mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
|
||||||
|
mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
|
||||||
|
|
||||||
# Draw Manager
|
# Draw Manager
|
||||||
option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF)
|
option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF)
|
||||||
mark_as_advanced(WITH_DRAW_DEBUG)
|
mark_as_advanced(WITH_DRAW_DEBUG)
|
||||||
@@ -620,7 +642,7 @@ if(WIN32)
|
|||||||
option(WITH_WINDOWS_PDB "Generate a pdb file for client side stacktraces" ON)
|
option(WITH_WINDOWS_PDB "Generate a pdb file for client side stacktraces" ON)
|
||||||
mark_as_advanced(WITH_WINDOWS_PDB)
|
mark_as_advanced(WITH_WINDOWS_PDB)
|
||||||
|
|
||||||
option(WITH_WINDOWS_STRIPPED_PDB "Use a stripped PDB file" On)
|
option(WITH_WINDOWS_STRIPPED_PDB "Use a stripped PDB file" ON)
|
||||||
mark_as_advanced(WITH_WINDOWS_STRIPPED_PDB)
|
mark_as_advanced(WITH_WINDOWS_STRIPPED_PDB)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
@@ -821,6 +843,11 @@ if(NOT WITH_CUDA_DYNLOAD)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_CYCLES_DEVICE_HIP)
|
||||||
|
# Currently HIP must be dynamically loaded, this may change in future toolkits
|
||||||
|
set(WITH_HIP_DYNLOAD ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Check check if submodules are cloned
|
# Check check if submodules are cloned
|
||||||
|
|
||||||
@@ -1716,6 +1743,12 @@ if(WITH_PYTHON)
|
|||||||
elseif(WITH_PYTHON_INSTALL_REQUESTS)
|
elseif(WITH_PYTHON_INSTALL_REQUESTS)
|
||||||
find_python_package(requests "")
|
find_python_package(requests "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32 OR APPLE)
|
||||||
|
# pass, we have this in lib/python/site-packages
|
||||||
|
elseif(WITH_PYTHON_INSTALL_ZSTANDARD)
|
||||||
|
find_python_package(zstandard "")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Select C++17 as the standard for C++ projects.
|
# Select C++17 as the standard for C++ projects.
|
||||||
@@ -1850,6 +1883,9 @@ elseif(WITH_CYCLES_STANDALONE)
|
|||||||
if(WITH_CUDA_DYNLOAD)
|
if(WITH_CUDA_DYNLOAD)
|
||||||
add_subdirectory(extern/cuew)
|
add_subdirectory(extern/cuew)
|
||||||
endif()
|
endif()
|
||||||
|
if(WITH_HIP_DYNLOAD)
|
||||||
|
add_subdirectory(extern/hipew)
|
||||||
|
endif()
|
||||||
if(NOT WITH_SYSTEM_GLEW)
|
if(NOT WITH_SYSTEM_GLEW)
|
||||||
add_subdirectory(extern/glew)
|
add_subdirectory(extern/glew)
|
||||||
endif()
|
endif()
|
||||||
@@ -1984,6 +2020,7 @@ if(FIRST_RUN)
|
|||||||
endif()
|
endif()
|
||||||
info_cfg_option(WITH_PYTHON_INSTALL)
|
info_cfg_option(WITH_PYTHON_INSTALL)
|
||||||
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
|
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
|
||||||
|
info_cfg_option(WITH_PYTHON_INSTALL_ZSTANDARD)
|
||||||
info_cfg_option(WITH_PYTHON_MODULE)
|
info_cfg_option(WITH_PYTHON_MODULE)
|
||||||
info_cfg_option(WITH_PYTHON_SAFETY)
|
info_cfg_option(WITH_PYTHON_SAFETY)
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
define HELP_TEXT
|
define HELP_TEXT
|
||||||
|
|
||||||
Blender Convenience Targets
|
Blender Convenience Targets
|
||||||
Provided for building Blender, (multiple at once can be used).
|
Provided for building Blender (multiple targets can be used at once).
|
||||||
|
|
||||||
* debug: Build a debug binary.
|
* debug: Build a debug binary.
|
||||||
* full: Enable all supported dependencies & options.
|
* full: Enable all supported dependencies & options.
|
||||||
@@ -40,6 +40,8 @@ Blender Convenience Targets
|
|||||||
* ninja: Use ninja build tool for faster builds.
|
* ninja: Use ninja build tool for faster builds.
|
||||||
* ccache: Use ccache for faster rebuilds.
|
* ccache: Use ccache for faster rebuilds.
|
||||||
|
|
||||||
|
Note: when passing in multiple targets their order is not important.
|
||||||
|
So for a fast build you can for e.g. run 'make lite ccache ninja'.
|
||||||
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
|
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
|
||||||
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
|
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
|
||||||
|
|
||||||
|
@@ -38,7 +38,6 @@ ExternalProject_Add(external_numpy
|
|||||||
PREFIX ${BUILD_DIR}/numpy
|
PREFIX ${BUILD_DIR}/numpy
|
||||||
PATCH_COMMAND ${NUMPY_PATCH}
|
PATCH_COMMAND ${NUMPY_PATCH}
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff
|
|
||||||
LOG_BUILD 1
|
LOG_BUILD 1
|
||||||
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
|
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
@@ -18,14 +18,20 @@
|
|||||||
|
|
||||||
if(WIN32 AND BUILD_MODE STREQUAL Debug)
|
if(WIN32 AND BUILD_MODE STREQUAL Debug)
|
||||||
set(SITE_PACKAGES_EXTRA --global-option build --global-option --debug)
|
set(SITE_PACKAGES_EXTRA --global-option build --global-option --debug)
|
||||||
|
# zstandard is determined to build and link release mode libs in a debug
|
||||||
|
# configuration, the only way to make it happy is to bend to its will
|
||||||
|
# and give it a library to link with.
|
||||||
|
set(PIP_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.lib ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib)
|
||||||
|
else()
|
||||||
|
set(PIP_CONFIGURE_COMMAND echo ".")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ExternalProject_Add(external_python_site_packages
|
ExternalProject_Add(external_python_site_packages
|
||||||
DOWNLOAD_COMMAND ""
|
DOWNLOAD_COMMAND ""
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND}
|
||||||
BUILD_COMMAND ""
|
BUILD_COMMAND ""
|
||||||
PREFIX ${BUILD_DIR}/site_packages
|
PREFIX ${BUILD_DIR}/site_packages
|
||||||
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all:
|
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} --no-binary :all:
|
||||||
)
|
)
|
||||||
|
|
||||||
if(USE_PIP_NUMPY)
|
if(USE_PIP_NUMPY)
|
||||||
|
@@ -189,11 +189,11 @@ set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
|
|||||||
set(OSL_HASH_TYPE MD5)
|
set(OSL_HASH_TYPE MD5)
|
||||||
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
|
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
|
||||||
|
|
||||||
set(PYTHON_VERSION 3.9.2)
|
set(PYTHON_VERSION 3.9.7)
|
||||||
set(PYTHON_SHORT_VERSION 3.9)
|
set(PYTHON_SHORT_VERSION 3.9)
|
||||||
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
|
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
|
||||||
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
|
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
|
||||||
set(PYTHON_HASH f0dc9000312abeb16de4eccce9a870ab)
|
set(PYTHON_HASH fddb060b483bc01850a3f412eea1d954)
|
||||||
set(PYTHON_HASH_TYPE MD5)
|
set(PYTHON_HASH_TYPE MD5)
|
||||||
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
|
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
|
||||||
|
|
||||||
@@ -215,17 +215,18 @@ set(NANOVDB_HASH e7b9e863ec2f3b04ead171dec2322807)
|
|||||||
set(NANOVDB_HASH_TYPE MD5)
|
set(NANOVDB_HASH_TYPE MD5)
|
||||||
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
|
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
|
||||||
|
|
||||||
set(IDNA_VERSION 2.10)
|
set(IDNA_VERSION 3.2)
|
||||||
set(CHARDET_VERSION 4.0.0)
|
set(CHARSET_NORMALIZER_VERSION 2.0.6)
|
||||||
set(URLLIB3_VERSION 1.26.3)
|
set(URLLIB3_VERSION 1.26.7)
|
||||||
set(CERTIFI_VERSION 2020.12.5)
|
set(CERTIFI_VERSION 2021.10.8)
|
||||||
set(REQUESTS_VERSION 2.25.1)
|
set(REQUESTS_VERSION 2.26.0)
|
||||||
set(CYTHON_VERSION 0.29.21)
|
set(CYTHON_VERSION 0.29.24)
|
||||||
|
set(ZSTANDARD_VERSION 0.15.2 )
|
||||||
|
|
||||||
set(NUMPY_VERSION 1.19.5)
|
set(NUMPY_VERSION 1.21.2)
|
||||||
set(NUMPY_SHORT_VERSION 1.19)
|
set(NUMPY_SHORT_VERSION 1.21)
|
||||||
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
|
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
|
||||||
set(NUMPY_HASH f6a1b48717c552bbc18f1adc3cc1fe0e)
|
set(NUMPY_HASH 5638d5dae3ca387be562912312db842e)
|
||||||
set(NUMPY_HASH_TYPE MD5)
|
set(NUMPY_HASH_TYPE MD5)
|
||||||
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
|
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
|
||||||
|
|
||||||
|
@@ -371,71 +371,78 @@ NO_BUILD=false
|
|||||||
NO_CONFIRM=false
|
NO_CONFIRM=false
|
||||||
USE_CXX11=true
|
USE_CXX11=true
|
||||||
|
|
||||||
# Note about versions: Min is inclusive, Max is exclusive (i.e. XXX_VERSION_MIN <= ACTUAL_VERSION < XXX_VERSION_MAX)
|
# Note about versions: Min is inclusive, Mex is 'minimum exclusive' (i.e. XXX_VERSION_MIN <= ACTUAL_VERSION < XXX_VERSION_MEX)
|
||||||
# XXX_VERSION is officially supported/used version in official builds.
|
# XXX_VERSION is officially supported/used version in official builds.
|
||||||
# XXX_VERSION_SHORT is used for various things, like preferred version (when distribution provides several of them),
|
# XXX_VERSION_SHORT is used for various things, like preferred version (when distribution provides several of them),
|
||||||
# and to name shortcuts to built libraries' installation directories...
|
# and to name shortcuts to built libraries' installation directories...
|
||||||
|
|
||||||
CLANG_FORMAT_VERSION_MIN="6.0"
|
CLANG_FORMAT_VERSION_MIN="6.0"
|
||||||
CLANG_FORMAT_VERSION_MAX="10.0"
|
CLANG_FORMAT_VERSION_MEX="10.0"
|
||||||
|
|
||||||
PYTHON_VERSION="3.9.2"
|
PYTHON_VERSION="3.9.7"
|
||||||
PYTHON_VERSION_SHORT="3.9"
|
PYTHON_VERSION_SHORT="3.9"
|
||||||
PYTHON_VERSION_MIN="3.7"
|
PYTHON_VERSION_MIN="3.7"
|
||||||
PYTHON_VERSION_MAX="3.11"
|
PYTHON_VERSION_MEX="3.11"
|
||||||
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_SHORT
|
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_SHORT
|
||||||
PYTHON_FORCE_BUILD=false
|
PYTHON_FORCE_BUILD=false
|
||||||
PYTHON_FORCE_REBUILD=false
|
PYTHON_FORCE_REBUILD=false
|
||||||
PYTHON_SKIP=false
|
PYTHON_SKIP=false
|
||||||
|
|
||||||
# Additional Python modules.
|
# Additional Python modules.
|
||||||
PYTHON_IDNA_VERSION="2.9"
|
PYTHON_IDNA_VERSION="3.2"
|
||||||
PYTHON_IDNA_VERSION_MIN="2.0"
|
PYTHON_IDNA_VERSION_MIN="2.0"
|
||||||
PYTHON_IDNA_VERSION_MAX="3.0"
|
PYTHON_IDNA_VERSION_MEX="4.0"
|
||||||
PYTHON_IDNA_NAME="idna"
|
PYTHON_IDNA_NAME="idna"
|
||||||
|
|
||||||
PYTHON_CHARDET_VERSION="3.0.4"
|
PYTHON_CHARSET_NORMALIZER_VERSION="2.0.6"
|
||||||
PYTHON_CHARDET_VERSION_MIN="3.0"
|
PYTHON_CHARSET_NORMALIZER_VERSION_MIN="2.0.6"
|
||||||
PYTHON_CHARDET_VERSION_MAX="5.0"
|
PYTHON_CHARSET_NORMALIZER_VERSION_MEX="2.1.0" # requests uses `charset_normalizer~=2.0.0`
|
||||||
PYTHON_CHARDET_NAME="chardet"
|
PYTHON_CHARSET_NORMALIZER_NAME="charset-normalizer"
|
||||||
|
|
||||||
PYTHON_URLLIB3_VERSION="1.25.9"
|
PYTHON_URLLIB3_VERSION="1.26.7"
|
||||||
PYTHON_URLLIB3_VERSION_MIN="1.0"
|
PYTHON_URLLIB3_VERSION_MIN="1.0"
|
||||||
PYTHON_URLLIB3_VERSION_MAX="2.0"
|
PYTHON_URLLIB3_VERSION_MEX="2.0"
|
||||||
PYTHON_URLLIB3_NAME="urllib3"
|
PYTHON_URLLIB3_NAME="urllib3"
|
||||||
|
|
||||||
PYTHON_CERTIFI_VERSION="2020.4.5.2"
|
PYTHON_CERTIFI_VERSION="2021.10.8"
|
||||||
PYTHON_CERTIFI_VERSION_MIN="2020.0"
|
PYTHON_CERTIFI_VERSION_MIN="2021.0"
|
||||||
PYTHON_CERTIFI_VERSION_MAX="2021.0"
|
PYTHON_CERTIFI_VERSION_MEX="2023.0"
|
||||||
PYTHON_CERTIFI_NAME="certifi"
|
PYTHON_CERTIFI_NAME="certifi"
|
||||||
|
|
||||||
PYTHON_REQUESTS_VERSION="2.23.0"
|
PYTHON_REQUESTS_VERSION="2.23.0"
|
||||||
PYTHON_REQUESTS_VERSION_MIN="2.0"
|
PYTHON_REQUESTS_VERSION_MIN="2.0"
|
||||||
PYTHON_REQUESTS_VERSION_MAX="3.0"
|
PYTHON_REQUESTS_VERSION_MEX="3.0"
|
||||||
PYTHON_REQUESTS_NAME="requests"
|
PYTHON_REQUESTS_NAME="requests"
|
||||||
|
|
||||||
PYTHON_NUMPY_VERSION="1.19.5"
|
PYTHON_ZSTANDARD_VERSION="0.15.2"
|
||||||
|
PYTHON_ZSTANDARD_VERSION_MIN="0.15.2"
|
||||||
|
PYTHON_ZSTANDARD_VERSION_MEX="0.16.0"
|
||||||
|
PYTHON_ZSTANDARD_NAME="zstandard"
|
||||||
|
|
||||||
|
PYTHON_NUMPY_VERSION="1.21.2"
|
||||||
PYTHON_NUMPY_VERSION_MIN="1.14"
|
PYTHON_NUMPY_VERSION_MIN="1.14"
|
||||||
PYTHON_NUMPY_VERSION_MAX="2.0"
|
PYTHON_NUMPY_VERSION_MEX="2.0"
|
||||||
PYTHON_NUMPY_NAME="numpy"
|
PYTHON_NUMPY_NAME="numpy"
|
||||||
|
|
||||||
# As package-ready parameters (only used with distro packages).
|
# As package-ready parameters (only used with distro packages).
|
||||||
PYTHON_MODULES_PACKAGES=(
|
PYTHON_MODULES_PACKAGES=(
|
||||||
"$PYTHON_IDNA_NAME $PYTHON_IDNA_VERSION_MIN $PYTHON_IDNA_VERSION_MAX"
|
"$PYTHON_IDNA_NAME $PYTHON_IDNA_VERSION_MIN $PYTHON_IDNA_VERSION_MEX"
|
||||||
"$PYTHON_CHARDET_NAME $PYTHON_CHARDET_VERSION_MIN $PYTHON_CHARDET_VERSION_MAX"
|
"$PYTHON_CHARSET_NORMALIZER_NAME $PYTHON_CHARSET_NORMALIZER_VERSION_MIN $PYTHON_CHARSET_NORMALIZER_VERSION_MEX"
|
||||||
"$PYTHON_URLLIB3_NAME $PYTHON_URLLIB3_VERSION_MIN $PYTHON_URLLIB3_VERSION_MAX"
|
"$PYTHON_URLLIB3_NAME $PYTHON_URLLIB3_VERSION_MIN $PYTHON_URLLIB3_VERSION_MEX"
|
||||||
"$PYTHON_CERTIFI_NAME $PYTHON_CERTIFI_VERSION_MIN $PYTHON_CERTIFI_VERSION_MAX"
|
"$PYTHON_CERTIFI_NAME $PYTHON_CERTIFI_VERSION_MIN $PYTHON_CERTIFI_VERSION_MEX"
|
||||||
"$PYTHON_REQUESTS_NAME $PYTHON_REQUESTS_VERSION_MIN $PYTHON_REQUESTS_VERSION_MAX"
|
"$PYTHON_REQUESTS_NAME $PYTHON_REQUESTS_VERSION_MIN $PYTHON_REQUESTS_VERSION_MEX"
|
||||||
"$PYTHON_NUMPY_NAME $PYTHON_NUMPY_VERSION_MIN $PYTHON_NUMPY_VERSION_MAX"
|
"$PYTHON_ZSTANDARD_NAME $PYTHON_ZSTANDARD_VERSION_MIN $PYTHON_ZSTANDARD_VERSION_MEX"
|
||||||
|
"$PYTHON_NUMPY_NAME $PYTHON_NUMPY_VERSION_MIN $PYTHON_NUMPY_VERSION_MEX"
|
||||||
)
|
)
|
||||||
|
|
||||||
# As pip-ready parameters (only used when building python).
|
# As pip-ready parameters (only used when building python).
|
||||||
PYTHON_MODULES_PIP=(
|
PYTHON_MODULES_PIP=(
|
||||||
"$PYTHON_IDNA_NAME==$PYTHON_IDNA_VERSION"
|
"$PYTHON_IDNA_NAME==$PYTHON_IDNA_VERSION"
|
||||||
"$PYTHON_CHARDET_NAME==$PYTHON_CHARDET_VERSION"
|
"$PYTHON_CHARSET_NORMALIZER_NAME==$PYTHON_CHARSET_NORMALIZER_VERSION"
|
||||||
"$PYTHON_URLLIB3_NAME==$PYTHON_URLLIB3_VERSION"
|
"$PYTHON_URLLIB3_NAME==$PYTHON_URLLIB3_VERSION"
|
||||||
"$PYTHON_CERTIFI_NAME==$PYTHON_CERTIFI_VERSION"
|
"$PYTHON_CERTIFI_NAME==$PYTHON_CERTIFI_VERSION"
|
||||||
"$PYTHON_REQUESTS_NAME==$PYTHON_REQUESTS_VERSION"
|
"$PYTHON_REQUESTS_NAME==$PYTHON_REQUESTS_VERSION"
|
||||||
|
"$PYTHON_ZSTANDARD_NAME==$PYTHON_ZSTANDARD_VERSION"
|
||||||
"$PYTHON_NUMPY_NAME==$PYTHON_NUMPY_VERSION"
|
"$PYTHON_NUMPY_NAME==$PYTHON_NUMPY_VERSION"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -443,7 +450,7 @@ PYTHON_MODULES_PIP=(
|
|||||||
BOOST_VERSION="1.73.0"
|
BOOST_VERSION="1.73.0"
|
||||||
BOOST_VERSION_SHORT="1.73"
|
BOOST_VERSION_SHORT="1.73"
|
||||||
BOOST_VERSION_MIN="1.49"
|
BOOST_VERSION_MIN="1.49"
|
||||||
BOOST_VERSION_MAX="2.0"
|
BOOST_VERSION_MEX="2.0"
|
||||||
BOOST_FORCE_BUILD=false
|
BOOST_FORCE_BUILD=false
|
||||||
BOOST_FORCE_REBUILD=false
|
BOOST_FORCE_REBUILD=false
|
||||||
BOOST_SKIP=false
|
BOOST_SKIP=false
|
||||||
@@ -452,7 +459,7 @@ TBB_VERSION="2020"
|
|||||||
TBB_VERSION_SHORT="2020"
|
TBB_VERSION_SHORT="2020"
|
||||||
TBB_VERSION_UPDATE="_U2" # Used for source packages...
|
TBB_VERSION_UPDATE="_U2" # Used for source packages...
|
||||||
TBB_VERSION_MIN="2018"
|
TBB_VERSION_MIN="2018"
|
||||||
TBB_VERSION_MAX="2022"
|
TBB_VERSION_MEX="2022"
|
||||||
TBB_FORCE_BUILD=false
|
TBB_FORCE_BUILD=false
|
||||||
TBB_FORCE_REBUILD=false
|
TBB_FORCE_REBUILD=false
|
||||||
TBB_SKIP=false
|
TBB_SKIP=false
|
||||||
@@ -460,7 +467,7 @@ TBB_SKIP=false
|
|||||||
OCIO_VERSION="2.0.0"
|
OCIO_VERSION="2.0.0"
|
||||||
OCIO_VERSION_SHORT="2.0"
|
OCIO_VERSION_SHORT="2.0"
|
||||||
OCIO_VERSION_MIN="2.0"
|
OCIO_VERSION_MIN="2.0"
|
||||||
OCIO_VERSION_MAX="3.0"
|
OCIO_VERSION_MEX="3.0"
|
||||||
OCIO_FORCE_BUILD=false
|
OCIO_FORCE_BUILD=false
|
||||||
OCIO_FORCE_REBUILD=false
|
OCIO_FORCE_REBUILD=false
|
||||||
OCIO_SKIP=false
|
OCIO_SKIP=false
|
||||||
@@ -468,7 +475,7 @@ OCIO_SKIP=false
|
|||||||
OPENEXR_VERSION="2.5.5"
|
OPENEXR_VERSION="2.5.5"
|
||||||
OPENEXR_VERSION_SHORT="2.5"
|
OPENEXR_VERSION_SHORT="2.5"
|
||||||
OPENEXR_VERSION_MIN="2.4"
|
OPENEXR_VERSION_MIN="2.4"
|
||||||
OPENEXR_VERSION_MAX="3.0"
|
OPENEXR_VERSION_MEX="3.0"
|
||||||
OPENEXR_FORCE_BUILD=false
|
OPENEXR_FORCE_BUILD=false
|
||||||
OPENEXR_FORCE_REBUILD=false
|
OPENEXR_FORCE_REBUILD=false
|
||||||
OPENEXR_SKIP=false
|
OPENEXR_SKIP=false
|
||||||
@@ -477,7 +484,7 @@ _with_built_openexr=false
|
|||||||
OIIO_VERSION="2.2.15.1"
|
OIIO_VERSION="2.2.15.1"
|
||||||
OIIO_VERSION_SHORT="2.2"
|
OIIO_VERSION_SHORT="2.2"
|
||||||
OIIO_VERSION_MIN="2.1.12"
|
OIIO_VERSION_MIN="2.1.12"
|
||||||
OIIO_VERSION_MAX="2.3.0"
|
OIIO_VERSION_MEX="2.3.0"
|
||||||
OIIO_FORCE_BUILD=false
|
OIIO_FORCE_BUILD=false
|
||||||
OIIO_FORCE_REBUILD=false
|
OIIO_FORCE_REBUILD=false
|
||||||
OIIO_SKIP=false
|
OIIO_SKIP=false
|
||||||
@@ -485,7 +492,7 @@ OIIO_SKIP=false
|
|||||||
LLVM_VERSION="12.0.0"
|
LLVM_VERSION="12.0.0"
|
||||||
LLVM_VERSION_SHORT="12.0"
|
LLVM_VERSION_SHORT="12.0"
|
||||||
LLVM_VERSION_MIN="11.0"
|
LLVM_VERSION_MIN="11.0"
|
||||||
LLVM_VERSION_MAX="13.0"
|
LLVM_VERSION_MEX="13.0"
|
||||||
LLVM_VERSION_FOUND=""
|
LLVM_VERSION_FOUND=""
|
||||||
LLVM_FORCE_BUILD=false
|
LLVM_FORCE_BUILD=false
|
||||||
LLVM_FORCE_REBUILD=false
|
LLVM_FORCE_REBUILD=false
|
||||||
@@ -495,7 +502,7 @@ LLVM_SKIP=false
|
|||||||
OSL_VERSION="1.11.14.1"
|
OSL_VERSION="1.11.14.1"
|
||||||
OSL_VERSION_SHORT="1.11"
|
OSL_VERSION_SHORT="1.11"
|
||||||
OSL_VERSION_MIN="1.11"
|
OSL_VERSION_MIN="1.11"
|
||||||
OSL_VERSION_MAX="2.0"
|
OSL_VERSION_MEX="2.0"
|
||||||
OSL_FORCE_BUILD=false
|
OSL_FORCE_BUILD=false
|
||||||
OSL_FORCE_REBUILD=false
|
OSL_FORCE_REBUILD=false
|
||||||
OSL_SKIP=false
|
OSL_SKIP=false
|
||||||
@@ -504,7 +511,7 @@ OSL_SKIP=false
|
|||||||
OSD_VERSION="3.4.3"
|
OSD_VERSION="3.4.3"
|
||||||
OSD_VERSION_SHORT="3.4"
|
OSD_VERSION_SHORT="3.4"
|
||||||
OSD_VERSION_MIN="3.4"
|
OSD_VERSION_MIN="3.4"
|
||||||
OSD_VERSION_MAX="4.0"
|
OSD_VERSION_MEX="4.0"
|
||||||
OSD_FORCE_BUILD=false
|
OSD_FORCE_BUILD=false
|
||||||
OSD_FORCE_REBUILD=false
|
OSD_FORCE_REBUILD=false
|
||||||
OSD_SKIP=false
|
OSD_SKIP=false
|
||||||
@@ -515,7 +522,7 @@ OPENVDB_BLOSC_VERSION="1.5.0"
|
|||||||
OPENVDB_VERSION="8.0.1"
|
OPENVDB_VERSION="8.0.1"
|
||||||
OPENVDB_VERSION_SHORT="8.0"
|
OPENVDB_VERSION_SHORT="8.0"
|
||||||
OPENVDB_VERSION_MIN="8.0"
|
OPENVDB_VERSION_MIN="8.0"
|
||||||
OPENVDB_VERSION_MAX="8.1"
|
OPENVDB_VERSION_MEX="8.1"
|
||||||
OPENVDB_FORCE_BUILD=false
|
OPENVDB_FORCE_BUILD=false
|
||||||
OPENVDB_FORCE_REBUILD=false
|
OPENVDB_FORCE_REBUILD=false
|
||||||
OPENVDB_SKIP=false
|
OPENVDB_SKIP=false
|
||||||
@@ -524,7 +531,7 @@ OPENVDB_SKIP=false
|
|||||||
ALEMBIC_VERSION="1.7.16"
|
ALEMBIC_VERSION="1.7.16"
|
||||||
ALEMBIC_VERSION_SHORT="1.7"
|
ALEMBIC_VERSION_SHORT="1.7"
|
||||||
ALEMBIC_VERSION_MIN="1.7"
|
ALEMBIC_VERSION_MIN="1.7"
|
||||||
ALEMBIC_VERSION_MAX="2.0"
|
ALEMBIC_VERSION_MEX="2.0"
|
||||||
ALEMBIC_FORCE_BUILD=false
|
ALEMBIC_FORCE_BUILD=false
|
||||||
ALEMBIC_FORCE_REBUILD=false
|
ALEMBIC_FORCE_REBUILD=false
|
||||||
ALEMBIC_SKIP=false
|
ALEMBIC_SKIP=false
|
||||||
@@ -532,7 +539,7 @@ ALEMBIC_SKIP=false
|
|||||||
USD_VERSION="21.02"
|
USD_VERSION="21.02"
|
||||||
USD_VERSION_SHORT="21.02"
|
USD_VERSION_SHORT="21.02"
|
||||||
USD_VERSION_MIN="20.05"
|
USD_VERSION_MIN="20.05"
|
||||||
USD_VERSION_MAX="22.00"
|
USD_VERSION_MEX="22.00"
|
||||||
USD_FORCE_BUILD=false
|
USD_FORCE_BUILD=false
|
||||||
USD_FORCE_REBUILD=false
|
USD_FORCE_REBUILD=false
|
||||||
USD_SKIP=false
|
USD_SKIP=false
|
||||||
@@ -540,7 +547,7 @@ USD_SKIP=false
|
|||||||
OPENCOLLADA_VERSION="1.6.68"
|
OPENCOLLADA_VERSION="1.6.68"
|
||||||
OPENCOLLADA_VERSION_SHORT="1.6"
|
OPENCOLLADA_VERSION_SHORT="1.6"
|
||||||
OPENCOLLADA_VERSION_MIN="1.6.68"
|
OPENCOLLADA_VERSION_MIN="1.6.68"
|
||||||
OPENCOLLADA_VERSION_MAX="1.7"
|
OPENCOLLADA_VERSION_MEX="1.7"
|
||||||
OPENCOLLADA_FORCE_BUILD=false
|
OPENCOLLADA_FORCE_BUILD=false
|
||||||
OPENCOLLADA_FORCE_REBUILD=false
|
OPENCOLLADA_FORCE_REBUILD=false
|
||||||
OPENCOLLADA_SKIP=false
|
OPENCOLLADA_SKIP=false
|
||||||
@@ -548,7 +555,7 @@ OPENCOLLADA_SKIP=false
|
|||||||
EMBREE_VERSION="3.10.0"
|
EMBREE_VERSION="3.10.0"
|
||||||
EMBREE_VERSION_SHORT="3.10"
|
EMBREE_VERSION_SHORT="3.10"
|
||||||
EMBREE_VERSION_MIN="3.10"
|
EMBREE_VERSION_MIN="3.10"
|
||||||
EMBREE_VERSION_MAX="4.0"
|
EMBREE_VERSION_MEX="4.0"
|
||||||
EMBREE_FORCE_BUILD=false
|
EMBREE_FORCE_BUILD=false
|
||||||
EMBREE_FORCE_REBUILD=false
|
EMBREE_FORCE_REBUILD=false
|
||||||
EMBREE_SKIP=false
|
EMBREE_SKIP=false
|
||||||
@@ -556,7 +563,7 @@ EMBREE_SKIP=false
|
|||||||
OIDN_VERSION="1.4.1"
|
OIDN_VERSION="1.4.1"
|
||||||
OIDN_VERSION_SHORT="1.4"
|
OIDN_VERSION_SHORT="1.4"
|
||||||
OIDN_VERSION_MIN="1.4.0"
|
OIDN_VERSION_MIN="1.4.0"
|
||||||
OIDN_VERSION_MAX="1.5"
|
OIDN_VERSION_MEX="1.5"
|
||||||
OIDN_FORCE_BUILD=false
|
OIDN_FORCE_BUILD=false
|
||||||
OIDN_FORCE_REBUILD=false
|
OIDN_FORCE_REBUILD=false
|
||||||
OIDN_SKIP=false
|
OIDN_SKIP=false
|
||||||
@@ -566,7 +573,7 @@ ISPC_VERSION="1.16.0"
|
|||||||
FFMPEG_VERSION="4.4"
|
FFMPEG_VERSION="4.4"
|
||||||
FFMPEG_VERSION_SHORT="4.4"
|
FFMPEG_VERSION_SHORT="4.4"
|
||||||
FFMPEG_VERSION_MIN="3.0"
|
FFMPEG_VERSION_MIN="3.0"
|
||||||
FFMPEG_VERSION_MAX="5.0"
|
FFMPEG_VERSION_MEX="5.0"
|
||||||
FFMPEG_FORCE_BUILD=false
|
FFMPEG_FORCE_BUILD=false
|
||||||
FFMPEG_FORCE_REBUILD=false
|
FFMPEG_FORCE_REBUILD=false
|
||||||
FFMPEG_SKIP=false
|
FFMPEG_SKIP=false
|
||||||
@@ -575,7 +582,7 @@ _ffmpeg_list_sep=";"
|
|||||||
XR_OPENXR_VERSION="1.0.17"
|
XR_OPENXR_VERSION="1.0.17"
|
||||||
XR_OPENXR_VERSION_SHORT="1.0"
|
XR_OPENXR_VERSION_SHORT="1.0"
|
||||||
XR_OPENXR_VERSION_MIN="1.0.8"
|
XR_OPENXR_VERSION_MIN="1.0.8"
|
||||||
XR_OPENXR_VERSION_MAX="2.0"
|
XR_OPENXR_VERSION_MEX="2.0"
|
||||||
XR_OPENXR_FORCE_BUILD=false
|
XR_OPENXR_FORCE_BUILD=false
|
||||||
XR_OPENXR_FORCE_REBUILD=false
|
XR_OPENXR_FORCE_REBUILD=false
|
||||||
XR_OPENXR_SKIP=false
|
XR_OPENXR_SKIP=false
|
||||||
@@ -1141,10 +1148,11 @@ You may also want to build them yourself (optional ones are [between brackets]):
|
|||||||
|
|
||||||
* Python $PYTHON_VERSION (from $PYTHON_SOURCE).
|
* Python $PYTHON_VERSION (from $PYTHON_SOURCE).
|
||||||
** [IDNA $PYTHON_IDNA_VERSION] (use pip).
|
** [IDNA $PYTHON_IDNA_VERSION] (use pip).
|
||||||
** [Chardet $PYTHON_CHARDET_VERSION] (use pip).
|
** [Charset Normalizer $PYTHON_CHARSET_NORMALIZER_VERSION] (use pip).
|
||||||
** [Urllib3 $PYTHON_URLLIB3_VERSION] (use pip).
|
** [Urllib3 $PYTHON_URLLIB3_VERSION] (use pip).
|
||||||
** [Certifi $PYTHON_CERTIFI_VERSION] (use pip).
|
** [Certifi $PYTHON_CERTIFI_VERSION] (use pip).
|
||||||
** [Requests $PYTHON_REQUESTS_VERSION] (use pip).
|
** [Requests $PYTHON_REQUESTS_VERSION] (use pip).
|
||||||
|
** [ZStandard $PYTHON_ZSTANDARD_VERSION] (use pip).
|
||||||
** [NumPy $PYTHON_NUMPY_VERSION] (use pip).
|
** [NumPy $PYTHON_NUMPY_VERSION] (use pip).
|
||||||
* Boost $BOOST_VERSION (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
|
* Boost $BOOST_VERSION (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
|
||||||
* TBB $TBB_VERSION (from $TBB_SOURCE).
|
* TBB $TBB_VERSION (from $TBB_SOURCE).
|
||||||
@@ -2013,7 +2021,7 @@ compile_OIIO() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# To be changed each time we make edits that would modify the compiled result!
|
# To be changed each time we make edits that would modify the compiled result!
|
||||||
oiio_magic=17
|
oiio_magic=18
|
||||||
_init_oiio
|
_init_oiio
|
||||||
|
|
||||||
# Force having own builds for the dependencies.
|
# Force having own builds for the dependencies.
|
||||||
@@ -2088,6 +2096,7 @@ compile_OIIO() {
|
|||||||
cmake_d="$cmake_d -D USE_PYTHON=OFF"
|
cmake_d="$cmake_d -D USE_PYTHON=OFF"
|
||||||
cmake_d="$cmake_d -D USE_FFMPEG=OFF"
|
cmake_d="$cmake_d -D USE_FFMPEG=OFF"
|
||||||
cmake_d="$cmake_d -D USE_OPENCV=OFF"
|
cmake_d="$cmake_d -D USE_OPENCV=OFF"
|
||||||
|
cmake_d="$cmake_d -D USE_OPENVDB=OFF"
|
||||||
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
|
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
|
||||||
cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
|
cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
|
||||||
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
|
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
|
||||||
@@ -4027,7 +4036,7 @@ install_DEB() {
|
|||||||
INFO "Forced Python building, as requested..."
|
INFO "Forced Python building, as requested..."
|
||||||
_do_compile_python=true
|
_do_compile_python=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB python3-dev $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
|
check_package_version_ge_lt_DEB python3-dev $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
@@ -4040,8 +4049,8 @@ install_DEB() {
|
|||||||
module=($module)
|
module=($module)
|
||||||
package="python3-${module[0]}"
|
package="python3-${module[0]}"
|
||||||
package_vmin=${module[1]}
|
package_vmin=${module[1]}
|
||||||
package_vmax=${module[2]}
|
package_vmex=${module[2]}
|
||||||
check_package_version_ge_lt_DEB "$package" $package_vmin $package_vmax
|
check_package_version_ge_lt_DEB "$package" $package_vmin $package_vmex
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB "$package"
|
install_packages_DEB "$package"
|
||||||
else
|
else
|
||||||
@@ -4067,7 +4076,7 @@ install_DEB() {
|
|||||||
INFO "Forced Boost building, as requested..."
|
INFO "Forced Boost building, as requested..."
|
||||||
compile_Boost
|
compile_Boost
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libboost-dev $BOOST_VERSION_MIN $BOOST_VERSION_MAX
|
check_package_version_ge_lt_DEB libboost-dev $BOOST_VERSION_MIN $BOOST_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libboost-dev
|
install_packages_DEB libboost-dev
|
||||||
|
|
||||||
@@ -4088,7 +4097,7 @@ install_DEB() {
|
|||||||
INFO "Forced TBB building, as requested..."
|
INFO "Forced TBB building, as requested..."
|
||||||
compile_TBB
|
compile_TBB
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libtbb-dev $TBB_VERSION_MIN $TBB_VERSION_MAX
|
check_package_version_ge_lt_DEB libtbb-dev $TBB_VERSION_MIN $TBB_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libtbb-dev
|
install_packages_DEB libtbb-dev
|
||||||
clean_TBB
|
clean_TBB
|
||||||
@@ -4105,7 +4114,7 @@ install_DEB() {
|
|||||||
INFO "Forced OpenColorIO building, as requested..."
|
INFO "Forced OpenColorIO building, as requested..."
|
||||||
compile_OCIO
|
compile_OCIO
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libopencolorio-dev $OCIO_VERSION_MIN $OCIO_VERSION_MAX
|
check_package_version_ge_lt_DEB libopencolorio-dev $OCIO_VERSION_MIN $OCIO_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libopencolorio-dev
|
install_packages_DEB libopencolorio-dev
|
||||||
clean_OCIO
|
clean_OCIO
|
||||||
@@ -4122,7 +4131,7 @@ install_DEB() {
|
|||||||
INFO "Forced ILMBase/OpenEXR building, as requested..."
|
INFO "Forced ILMBase/OpenEXR building, as requested..."
|
||||||
compile_OPENEXR
|
compile_OPENEXR
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libopenexr-dev $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
|
check_package_version_ge_lt_DEB libopenexr-dev $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libopenexr-dev
|
install_packages_DEB libopenexr-dev
|
||||||
OPENEXR_VERSION=`get_package_version_DEB libopenexr-dev`
|
OPENEXR_VERSION=`get_package_version_DEB libopenexr-dev`
|
||||||
@@ -4143,7 +4152,7 @@ install_DEB() {
|
|||||||
INFO "Forced OpenImageIO building, as requested..."
|
INFO "Forced OpenImageIO building, as requested..."
|
||||||
compile_OIIO
|
compile_OIIO
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
|
check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MEX
|
||||||
if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
|
if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
|
||||||
install_packages_DEB libopenimageio-dev openimageio-tools
|
install_packages_DEB libopenimageio-dev openimageio-tools
|
||||||
clean_OIIO
|
clean_OIIO
|
||||||
@@ -4163,7 +4172,7 @@ install_DEB() {
|
|||||||
INFO "Forced LLVM building, as requested..."
|
INFO "Forced LLVM building, as requested..."
|
||||||
_do_compile_llvm=true
|
_do_compile_llvm=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB llvm-dev $LLVM_VERSION_MIN $LLVM_VERSION_MAX
|
check_package_version_ge_lt_DEB llvm-dev $LLVM_VERSION_MIN $LLVM_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB llvm-dev clang libclang-dev
|
install_packages_DEB llvm-dev clang libclang-dev
|
||||||
have_llvm=true
|
have_llvm=true
|
||||||
@@ -4194,7 +4203,7 @@ install_DEB() {
|
|||||||
INFO "Forced OpenShadingLanguage building, as requested..."
|
INFO "Forced OpenShadingLanguage building, as requested..."
|
||||||
_do_compile_osl=true
|
_do_compile_osl=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libopenshadinglanguage-dev $OSL_VERSION_MIN $OSL_VERSION_MAX
|
check_package_version_ge_lt_DEB libopenshadinglanguage-dev $OSL_VERSION_MIN $OSL_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libopenshadinglanguage-dev
|
install_packages_DEB libopenshadinglanguage-dev
|
||||||
clean_OSL
|
clean_OSL
|
||||||
@@ -4232,7 +4241,7 @@ install_DEB() {
|
|||||||
INFO "Forced OpenVDB building, as requested..."
|
INFO "Forced OpenVDB building, as requested..."
|
||||||
compile_OPENVDB
|
compile_OPENVDB
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_DEB libopenvdb-dev $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MAX
|
check_package_version_ge_lt_DEB libopenvdb-dev $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libopenvdb-dev libblosc-dev
|
install_packages_DEB libopenvdb-dev libblosc-dev
|
||||||
clean_OPENVDB
|
clean_OPENVDB
|
||||||
@@ -4294,7 +4303,7 @@ install_DEB() {
|
|||||||
_do_compile_embree=true
|
_do_compile_embree=true
|
||||||
else
|
else
|
||||||
# There is a package, but it does not provide everything that Blender needs...
|
# There is a package, but it does not provide everything that Blender needs...
|
||||||
#~ check_package_version_ge_lt_DEB libembree-dev $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
|
#~ check_package_version_ge_lt_DEB libembree-dev $EMBREE_VERSION_MIN $EMBREE_VERSION_MEX
|
||||||
#~ if [ $? -eq 0 ]; then
|
#~ if [ $? -eq 0 ]; then
|
||||||
#~ install_packages_DEB libembree-dev
|
#~ install_packages_DEB libembree-dev
|
||||||
#~ clean_Embree
|
#~ clean_Embree
|
||||||
@@ -4336,7 +4345,7 @@ install_DEB() {
|
|||||||
# XXX Debian Testing / Ubuntu 16.04 finally includes FFmpeg, so check as usual
|
# XXX Debian Testing / Ubuntu 16.04 finally includes FFmpeg, so check as usual
|
||||||
check_package_DEB ffmpeg
|
check_package_DEB ffmpeg
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
check_package_version_ge_lt_DEB ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
|
check_package_version_ge_lt_DEB ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB libavdevice-dev
|
install_packages_DEB libavdevice-dev
|
||||||
clean_FFmpeg
|
clean_FFmpeg
|
||||||
@@ -4670,7 +4679,7 @@ install_RPM() {
|
|||||||
INFO "Forced Python building, as requested..."
|
INFO "Forced Python building, as requested..."
|
||||||
_do_compile_python=true
|
_do_compile_python=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM python3-devel $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
|
check_package_version_ge_lt_RPM python3-devel $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
@@ -4682,8 +4691,8 @@ install_RPM() {
|
|||||||
module=($module)
|
module=($module)
|
||||||
package="python3-${module[0]}"
|
package="python3-${module[0]}"
|
||||||
package_vmin=${module[1]}
|
package_vmin=${module[1]}
|
||||||
package_vmax=${module[2]}
|
package_vmex=${module[2]}
|
||||||
check_package_version_ge_lt_RPM "$package" $package_vmin $package_vmax
|
check_package_version_ge_lt_RPM "$package" $package_vmin $package_vmex
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM "$package"
|
install_packages_RPM "$package"
|
||||||
else
|
else
|
||||||
@@ -4710,7 +4719,7 @@ install_RPM() {
|
|||||||
INFO "Forced Boost building, as requested..."
|
INFO "Forced Boost building, as requested..."
|
||||||
_do_compile_boost=true
|
_do_compile_boost=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM boost-devel $BOOST_VERSION_MIN $BOOST_VERSION_MAX
|
check_package_version_ge_lt_RPM boost-devel $BOOST_VERSION_MIN $BOOST_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM boost-devel
|
install_packages_RPM boost-devel
|
||||||
clean_Boost
|
clean_Boost
|
||||||
@@ -4737,7 +4746,7 @@ install_RPM() {
|
|||||||
INFO "Forced TBB building, as requested..."
|
INFO "Forced TBB building, as requested..."
|
||||||
compile_TBB
|
compile_TBB
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM tbb-devel $TBB_VERSION_MIN $TBB_VERSION_MAX
|
check_package_version_ge_lt_RPM tbb-devel $TBB_VERSION_MIN $TBB_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM tbb-devel
|
install_packages_RPM tbb-devel
|
||||||
clean_TBB
|
clean_TBB
|
||||||
@@ -4755,7 +4764,7 @@ install_RPM() {
|
|||||||
compile_OCIO
|
compile_OCIO
|
||||||
else
|
else
|
||||||
if [ "$RPM" = "SUSE" ]; then
|
if [ "$RPM" = "SUSE" ]; then
|
||||||
check_package_version_ge_lt_RPM OpenColorIO-devel $OCIO_VERSION_MIN $OCIO_VERSION_MAX
|
check_package_version_ge_lt_RPM OpenColorIO-devel $OCIO_VERSION_MIN $OCIO_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM OpenColorIO-devel
|
install_packages_RPM OpenColorIO-devel
|
||||||
clean_OCIO
|
clean_OCIO
|
||||||
@@ -4775,7 +4784,7 @@ install_RPM() {
|
|||||||
INFO "Forced ILMBase/OpenEXR building, as requested..."
|
INFO "Forced ILMBase/OpenEXR building, as requested..."
|
||||||
compile_OPENEXR
|
compile_OPENEXR
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM openexr-devel $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
|
check_package_version_ge_lt_RPM openexr-devel $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM openexr-devel
|
install_packages_RPM openexr-devel
|
||||||
OPENEXR_VERSION=`get_package_version_RPM openexr-devel`
|
OPENEXR_VERSION=`get_package_version_RPM openexr-devel`
|
||||||
@@ -4793,7 +4802,7 @@ install_RPM() {
|
|||||||
INFO "Forced OpenImageIO building, as requested..."
|
INFO "Forced OpenImageIO building, as requested..."
|
||||||
compile_OIIO
|
compile_OIIO
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
|
check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MEX
|
||||||
if [ $? -eq 0 -a $_with_built_openexr == false ]; then
|
if [ $? -eq 0 -a $_with_built_openexr == false ]; then
|
||||||
install_packages_RPM OpenImageIO-devel OpenImageIO-utils
|
install_packages_RPM OpenImageIO-devel OpenImageIO-utils
|
||||||
clean_OIIO
|
clean_OIIO
|
||||||
@@ -4818,7 +4827,7 @@ install_RPM() {
|
|||||||
else
|
else
|
||||||
CLANG_DEV="clang-devel"
|
CLANG_DEV="clang-devel"
|
||||||
fi
|
fi
|
||||||
check_package_version_ge_lt_RPM llvm-devel $LLVM_VERSION_MIN $LLVM_VERSION_MAX
|
check_package_version_ge_lt_RPM llvm-devel $LLVM_VERSION_MIN $LLVM_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM llvm-devel $CLANG_DEV
|
install_packages_RPM llvm-devel $CLANG_DEV
|
||||||
have_llvm=true
|
have_llvm=true
|
||||||
@@ -4854,7 +4863,7 @@ install_RPM() {
|
|||||||
else
|
else
|
||||||
OSL_DEV="openshadinglanguage-devel"
|
OSL_DEV="openshadinglanguage-devel"
|
||||||
fi
|
fi
|
||||||
check_package_version_ge_lt_RPM $OSL_DEV $OSL_VERSION_MIN $OSL_VERSION_MAX
|
check_package_version_ge_lt_RPM $OSL_DEV $OSL_VERSION_MIN $OSL_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM $OSL_DEV
|
install_packages_RPM $OSL_DEV
|
||||||
clean_OSL
|
clean_OSL
|
||||||
@@ -4949,7 +4958,7 @@ install_RPM() {
|
|||||||
_do_compile_embree=true
|
_do_compile_embree=true
|
||||||
else
|
else
|
||||||
# There is a package, but it does not provide everything that Blender needs...
|
# There is a package, but it does not provide everything that Blender needs...
|
||||||
#~ check_package_version_ge_lt_RPM embree-devel $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
|
#~ check_package_version_ge_lt_RPM embree-devel $EMBREE_VERSION_MIN $EMBREE_VERSION_MEX
|
||||||
#~ if [ $? -eq 0 ]; then
|
#~ if [ $? -eq 0 ]; then
|
||||||
#~ install_packages_RPM embree-devel
|
#~ install_packages_RPM embree-devel
|
||||||
#~ clean_Embree
|
#~ clean_Embree
|
||||||
@@ -4988,7 +4997,7 @@ install_RPM() {
|
|||||||
INFO "Forced FFMpeg building, as requested..."
|
INFO "Forced FFMpeg building, as requested..."
|
||||||
compile_FFmpeg
|
compile_FFmpeg
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM ffmpeg-devel $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
|
check_package_version_ge_lt_RPM ffmpeg-devel $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_RPM ffmpeg ffmpeg-devel
|
install_packages_RPM ffmpeg ffmpeg-devel
|
||||||
clean_FFmpeg
|
clean_FFmpeg
|
||||||
@@ -5213,7 +5222,7 @@ install_ARCH() {
|
|||||||
INFO "Forced Python building, as requested..."
|
INFO "Forced Python building, as requested..."
|
||||||
_do_compile_python=true
|
_do_compile_python=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH python $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
|
check_package_version_ge_lt_ARCH python $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
@@ -5226,8 +5235,8 @@ install_ARCH() {
|
|||||||
module=($module)
|
module=($module)
|
||||||
package="python-${module[0]}"
|
package="python-${module[0]}"
|
||||||
package_vmin=${module[1]}
|
package_vmin=${module[1]}
|
||||||
package_vmax=${module[2]}
|
package_vmex=${module[2]}
|
||||||
check_package_version_ge_lt_ARCH "$package" $package_vmin $package_vmax
|
check_package_version_ge_lt_ARCH "$package" $package_vmin $package_vmex
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH "$package"
|
install_packages_ARCH "$package"
|
||||||
else
|
else
|
||||||
@@ -5253,7 +5262,7 @@ install_ARCH() {
|
|||||||
INFO "Forced Boost building, as requested..."
|
INFO "Forced Boost building, as requested..."
|
||||||
compile_Boost
|
compile_Boost
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH boost $BOOST_VERSION_MIN $BOOST_VERSION_MAX
|
check_package_version_ge_lt_ARCH boost $BOOST_VERSION_MIN $BOOST_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH boost
|
install_packages_ARCH boost
|
||||||
clean_Boost
|
clean_Boost
|
||||||
@@ -5270,7 +5279,7 @@ install_ARCH() {
|
|||||||
INFO "Forced TBB building, as requested..."
|
INFO "Forced TBB building, as requested..."
|
||||||
compile_TBB
|
compile_TBB
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH intel-tbb $TBB_VERSION_MIN $TBB_VERSION_MAX
|
check_package_version_ge_lt_ARCH intel-tbb $TBB_VERSION_MIN $TBB_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH intel-tbb
|
install_packages_ARCH intel-tbb
|
||||||
clean_TBB
|
clean_TBB
|
||||||
@@ -5287,7 +5296,7 @@ install_ARCH() {
|
|||||||
INFO "Forced OpenColorIO building, as requested..."
|
INFO "Forced OpenColorIO building, as requested..."
|
||||||
compile_OCIO
|
compile_OCIO
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH opencolorio $OCIO_VERSION_MIN $OCIO_VERSION_MAX
|
check_package_version_ge_lt_ARCH opencolorio $OCIO_VERSION_MIN $OCIO_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH opencolorio
|
install_packages_ARCH opencolorio
|
||||||
clean_OCIO
|
clean_OCIO
|
||||||
@@ -5304,7 +5313,7 @@ install_ARCH() {
|
|||||||
INFO "Forced ILMBase/OpenEXR building, as requested..."
|
INFO "Forced ILMBase/OpenEXR building, as requested..."
|
||||||
compile_OPENEXR
|
compile_OPENEXR
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH openexr $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
|
check_package_version_ge_lt_ARCH openexr $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH openexr
|
install_packages_ARCH openexr
|
||||||
OPENEXR_VERSION=`get_package_version_ARCH openexr`
|
OPENEXR_VERSION=`get_package_version_ARCH openexr`
|
||||||
@@ -5323,7 +5332,7 @@ install_ARCH() {
|
|||||||
INFO "Forced OpenImageIO building, as requested..."
|
INFO "Forced OpenImageIO building, as requested..."
|
||||||
compile_OIIO
|
compile_OIIO
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH openimageio $OIIO_VERSION_MIN $OIIO_VERSION_MAX
|
check_package_version_ge_lt_ARCH openimageio $OIIO_VERSION_MIN $OIIO_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH openimageio
|
install_packages_ARCH openimageio
|
||||||
clean_OIIO
|
clean_OIIO
|
||||||
@@ -5343,7 +5352,7 @@ install_ARCH() {
|
|||||||
INFO "Forced LLVM building, as requested..."
|
INFO "Forced LLVM building, as requested..."
|
||||||
_do_compile_llvm=true
|
_do_compile_llvm=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH llvm $LLVM_VERSION_MIN $LLVM_VERSION_MAX
|
check_package_version_ge_lt_ARCH llvm $LLVM_VERSION_MIN $LLVM_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH llvm clang
|
install_packages_ARCH llvm clang
|
||||||
have_llvm=true
|
have_llvm=true
|
||||||
@@ -5374,7 +5383,7 @@ install_ARCH() {
|
|||||||
INFO "Forced OpenShadingLanguage building, as requested..."
|
INFO "Forced OpenShadingLanguage building, as requested..."
|
||||||
_do_compile_osl=true
|
_do_compile_osl=true
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH openshadinglanguage $OSL_VERSION_MIN $OSL_VERSION_MAX
|
check_package_version_ge_lt_ARCH openshadinglanguage $OSL_VERSION_MIN $OSL_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH openshadinglanguage
|
install_packages_ARCH openshadinglanguage
|
||||||
clean_OSL
|
clean_OSL
|
||||||
@@ -5400,7 +5409,7 @@ install_ARCH() {
|
|||||||
INFO "Forced OpenSubdiv building, as requested..."
|
INFO "Forced OpenSubdiv building, as requested..."
|
||||||
compile_OSD
|
compile_OSD
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH opensubdiv $OSD_VERSION_MIN $OSD_VERSION_MAX
|
check_package_version_ge_lt_ARCH opensubdiv $OSD_VERSION_MIN $OSD_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH opensubdiv
|
install_packages_ARCH opensubdiv
|
||||||
clean_OSD
|
clean_OSD
|
||||||
@@ -5417,7 +5426,7 @@ install_ARCH() {
|
|||||||
INFO "Forced OpenVDB building, as requested..."
|
INFO "Forced OpenVDB building, as requested..."
|
||||||
compile_OPENVDB
|
compile_OPENVDB
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH openvdb $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MAX
|
check_package_version_ge_lt_ARCH openvdb $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH openvdb
|
install_packages_ARCH openvdb
|
||||||
clean_OPENVDB
|
clean_OPENVDB
|
||||||
@@ -5483,7 +5492,7 @@ install_ARCH() {
|
|||||||
_do_compile_embree=true
|
_do_compile_embree=true
|
||||||
else
|
else
|
||||||
# There is a package, but it does not provide everything that Blender needs...
|
# There is a package, but it does not provide everything that Blender needs...
|
||||||
#~ check_package_version_ge_lt_ARCH embree $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
|
#~ check_package_version_ge_lt_ARCH embree $EMBREE_VERSION_MIN $EMBREE_VERSION_MEX
|
||||||
#~ if [ $? -eq 0 ]; then
|
#~ if [ $? -eq 0 ]; then
|
||||||
#~ install_packages_ARCH embree
|
#~ install_packages_ARCH embree
|
||||||
#~ clean_Embree
|
#~ clean_Embree
|
||||||
@@ -5522,7 +5531,7 @@ install_ARCH() {
|
|||||||
INFO "Forced FFMpeg building, as requested..."
|
INFO "Forced FFMpeg building, as requested..."
|
||||||
compile_FFmpeg
|
compile_FFmpeg
|
||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
|
check_package_version_ge_lt_ARCH ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MEX
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_ARCH ffmpeg
|
install_packages_ARCH ffmpeg
|
||||||
clean_FFmpeg
|
clean_FFmpeg
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
|
|
||||||
index ba2b1f4..b10f7df 100644
|
|
||||||
--- a/numpy/distutils/system_info.py
|
|
||||||
+++ b/numpy/distutils/system_info.py
|
|
||||||
@@ -2164,8 +2164,8 @@ class accelerate_info(system_info):
|
|
||||||
'accelerate' in libraries):
|
|
||||||
if intel:
|
|
||||||
args.extend(['-msse3'])
|
|
||||||
- else:
|
|
||||||
- args.extend(['-faltivec'])
|
|
||||||
+# else:
|
|
||||||
+# args.extend(['-faltivec'])
|
|
||||||
args.extend([
|
|
||||||
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
|
|
||||||
link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
|
|
||||||
@@ -2174,8 +2174,8 @@ class accelerate_info(system_info):
|
|
||||||
'veclib' in libraries):
|
|
||||||
if intel:
|
|
||||||
args.extend(['-msse3'])
|
|
||||||
- else:
|
|
||||||
- args.extend(['-faltivec'])
|
|
||||||
+# else:
|
|
||||||
+# args.extend(['-faltivec'])
|
|
||||||
args.extend([
|
|
||||||
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
|
|
||||||
link_args.extend(['-Wl,-framework', '-Wl,vecLib'])
|
|
||||||
|
|
@@ -79,6 +79,9 @@ set STAGING=%BUILD_DIR%\S
|
|||||||
rem for python module build
|
rem for python module build
|
||||||
set MSSdk=1
|
set MSSdk=1
|
||||||
set DISTUTILS_USE_SDK=1
|
set DISTUTILS_USE_SDK=1
|
||||||
|
rem if you let pip pick its own build dirs, it'll stick it somewhere deep inside the user profile
|
||||||
|
rem and cython will refuse to link due to a path that gets too long.
|
||||||
|
set TMPDIR=c:\t\
|
||||||
rem for python externals source to be shared between the various archs and compilers
|
rem for python externals source to be shared between the various archs and compilers
|
||||||
mkdir %BUILD_DIR%\downloads\externals
|
mkdir %BUILD_DIR%\downloads\externals
|
||||||
|
|
||||||
|
81
build_files/cmake/Modules/FindHIP.cmake
Normal file
81
build_files/cmake/Modules/FindHIP.cmake
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# - Find HIP compiler
|
||||||
|
#
|
||||||
|
# This module defines
|
||||||
|
# HIP_HIPCC_EXECUTABLE, the full path to the hipcc executable
|
||||||
|
# HIP_VERSION, the HIP compiler version
|
||||||
|
#
|
||||||
|
# HIP_FOUND, if the HIP toolkit is found.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2021 Blender Foundation.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||||
|
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
# If HIP_ROOT_DIR was defined in the environment, use it.
|
||||||
|
if(NOT HIP_ROOT_DIR AND NOT $ENV{HIP_ROOT_DIR} STREQUAL "")
|
||||||
|
set(HIP_ROOT_DIR $ENV{HIP_ROOT_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(_hip_SEARCH_DIRS
|
||||||
|
${HIP_ROOT_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_program(HIP_HIPCC_EXECUTABLE
|
||||||
|
NAMES
|
||||||
|
hipcc
|
||||||
|
HINTS
|
||||||
|
${_hip_SEARCH_DIRS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
bin
|
||||||
|
)
|
||||||
|
|
||||||
|
if(HIP_HIPCC_EXECUTABLE AND NOT EXISTS ${HIP_HIPCC_EXECUTABLE})
|
||||||
|
message(WARNING "Cached or directly specified hipcc executable does not exist.")
|
||||||
|
set(HIP_FOUND FALSE)
|
||||||
|
elseif(HIP_HIPCC_EXECUTABLE)
|
||||||
|
set(HIP_FOUND TRUE)
|
||||||
|
|
||||||
|
set(HIP_VERSION_MAJOR 0)
|
||||||
|
set(HIP_VERSION_MINOR 0)
|
||||||
|
set(HIP_VERSION_PATCH 0)
|
||||||
|
|
||||||
|
# Get version from the output.
|
||||||
|
execute_process(COMMAND ${HIP_HIPCC_EXECUTABLE} --version
|
||||||
|
OUTPUT_VARIABLE HIP_VERSION_RAW
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
# Parse parts.
|
||||||
|
if(HIP_VERSION_RAW MATCHES "HIP version: .*")
|
||||||
|
# Strip the HIP prefix and get list of individual version components.
|
||||||
|
string(REGEX REPLACE
|
||||||
|
".*HIP version: ([.0-9]+).*" "\\1"
|
||||||
|
HIP_SEMANTIC_VERSION "${HIP_VERSION_RAW}")
|
||||||
|
string(REPLACE "." ";" HIP_VERSION_PARTS "${HIP_SEMANTIC_VERSION}")
|
||||||
|
list(LENGTH HIP_VERSION_PARTS NUM_HIP_VERSION_PARTS)
|
||||||
|
|
||||||
|
# Extract components into corresponding variables.
|
||||||
|
if(NUM_HIP_VERSION_PARTS GREATER 0)
|
||||||
|
list(GET HIP_VERSION_PARTS 0 HIP_VERSION_MAJOR)
|
||||||
|
endif()
|
||||||
|
if(NUM_HIP_VERSION_PARTS GREATER 1)
|
||||||
|
list(GET HIP_VERSION_PARTS 1 HIP_VERSION_MINOR)
|
||||||
|
endif()
|
||||||
|
if(NUM_HIP_VERSION_PARTS GREATER 2)
|
||||||
|
list(GET HIP_VERSION_PARTS 2 HIP_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Unset temp variables.
|
||||||
|
unset(NUM_HIP_VERSION_PARTS)
|
||||||
|
unset(HIP_SEMANTIC_VERSION)
|
||||||
|
unset(HIP_VERSION_PARTS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Construct full semantic version.
|
||||||
|
set(HIP_VERSION "${HIP_VERSION_MAJOR}.${HIP_VERSION_MINOR}.${HIP_VERSION_PATCH}")
|
||||||
|
unset(HIP_VERSION_RAW)
|
||||||
|
else()
|
||||||
|
set(HIP_FOUND FALSE)
|
||||||
|
endif()
|
@@ -168,7 +168,7 @@ def function_parm_wash_tokens(parm):
|
|||||||
# if tokens[-1].kind == To
|
# if tokens[-1].kind == To
|
||||||
# remove trailing char
|
# remove trailing char
|
||||||
if tokens[-1].kind == TokenKind.PUNCTUATION:
|
if tokens[-1].kind == TokenKind.PUNCTUATION:
|
||||||
if tokens[-1].spelling in (",", ")", ";"):
|
if tokens[-1].spelling in {",", ")", ";"}:
|
||||||
tokens.pop()
|
tokens.pop()
|
||||||
# else:
|
# else:
|
||||||
# print(tokens[-1].spelling)
|
# print(tokens[-1].spelling)
|
||||||
@@ -179,7 +179,7 @@ def function_parm_wash_tokens(parm):
|
|||||||
t_spelling = t.spelling
|
t_spelling = t.spelling
|
||||||
ok = True
|
ok = True
|
||||||
if t_kind == TokenKind.KEYWORD:
|
if t_kind == TokenKind.KEYWORD:
|
||||||
if t_spelling in ("const", "restrict", "volatile"):
|
if t_spelling in {"const", "restrict", "volatile"}:
|
||||||
ok = False
|
ok = False
|
||||||
elif t_spelling.startswith("__"):
|
elif t_spelling.startswith("__"):
|
||||||
ok = False # __restrict
|
ok = False # __restrict
|
||||||
|
@@ -24,6 +24,7 @@ import project_source_info
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
@@ -35,7 +36,6 @@ USE_QUIET = (os.environ.get("QUIET", None) is not None)
|
|||||||
|
|
||||||
CHECKER_IGNORE_PREFIX = [
|
CHECKER_IGNORE_PREFIX = [
|
||||||
"extern",
|
"extern",
|
||||||
"intern/moto",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
CHECKER_BIN = "cppcheck"
|
CHECKER_BIN = "cppcheck"
|
||||||
@@ -47,13 +47,19 @@ CHECKER_ARGS = [
|
|||||||
"--max-configs=1", # speeds up execution
|
"--max-configs=1", # speeds up execution
|
||||||
# "--check-config", # when includes are missing
|
# "--check-config", # when includes are missing
|
||||||
"--enable=all", # if you want sixty hundred pedantic suggestions
|
"--enable=all", # if you want sixty hundred pedantic suggestions
|
||||||
|
|
||||||
|
# Quiet output, otherwise all defines/includes are printed (overly verbose).
|
||||||
|
# Only enable this for troubleshooting (if defines are not set as expected for example).
|
||||||
|
"--quiet",
|
||||||
|
|
||||||
|
# NOTE: `--cppcheck-build-dir=<dir>` is added later as a temporary directory.
|
||||||
]
|
]
|
||||||
|
|
||||||
if USE_QUIET:
|
if USE_QUIET:
|
||||||
CHECKER_ARGS.append("--quiet")
|
CHECKER_ARGS.append("--quiet")
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def cppcheck() -> None:
|
||||||
source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
|
source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
|
||||||
source_defines = project_source_info.build_defines_as_args()
|
source_defines = project_source_info.build_defines_as_args()
|
||||||
|
|
||||||
@@ -78,7 +84,10 @@ def main() -> None:
|
|||||||
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
||||||
|
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sys.stdout.write("%s " % percent_str)
|
sys.stdout.write("%s %s\n" % (
|
||||||
|
percent_str,
|
||||||
|
os.path.relpath(c, project_source_info.SOURCE_DIR)
|
||||||
|
))
|
||||||
|
|
||||||
return subprocess.Popen(cmd)
|
return subprocess.Popen(cmd)
|
||||||
|
|
||||||
@@ -90,5 +99,11 @@ def main() -> None:
|
|||||||
print("Finished!")
|
print("Finished!")
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
|
CHECKER_ARGS.append("--cppcheck-build-dir=" + temp_dir)
|
||||||
|
cppcheck()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@@ -9,6 +9,7 @@ set(WITH_INSTALL_PORTABLE ON CACHE BOOL "" FORCE)
|
|||||||
|
|
||||||
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
|
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_BLENDER_THUMBNAILER OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_BOOST OFF CACHE BOOL "" FORCE)
|
set(WITH_BOOST OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
|
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
|
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
|
||||||
|
@@ -27,7 +27,7 @@ if(NOT MSVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
set(MSVC_CLANG On)
|
set(MSVC_CLANG ON)
|
||||||
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
|
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
|
||||||
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
|
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
|
||||||
if(DEFINED MSVC_REDIST_DIR)
|
if(DEFINED MSVC_REDIST_DIR)
|
||||||
@@ -53,7 +53,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|||||||
endif()
|
endif()
|
||||||
if(WITH_WINDOWS_STRIPPED_PDB)
|
if(WITH_WINDOWS_STRIPPED_PDB)
|
||||||
message(WARNING "stripped pdb not supported with clang, disabling..")
|
message(WARNING "stripped pdb not supported with clang, disabling..")
|
||||||
set(WITH_WINDOWS_STRIPPED_PDB Off)
|
set(WITH_WINDOWS_STRIPPED_PDB OFF)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ endif()
|
|||||||
if(WITH_COMPILER_ASAN AND MSVC AND NOT MSVC_CLANG)
|
if(WITH_COMPILER_ASAN AND MSVC AND NOT MSVC_CLANG)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28.29828)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28.29828)
|
||||||
#set a flag so we don't have to do this comparison all the time
|
#set a flag so we don't have to do this comparison all the time
|
||||||
SET(MSVC_ASAN On)
|
SET(MSVC_ASAN ON)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address")
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /INCREMENTAL:NO")
|
string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /INCREMENTAL:NO")
|
||||||
@@ -179,22 +179,22 @@ endif()
|
|||||||
|
|
||||||
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
|
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
|
||||||
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
|
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
|
||||||
set(WITH_WINDOWS_SCCACHE Off)
|
set(WITH_WINDOWS_SCCACHE OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Debug Symbol format
|
# Debug Symbol format
|
||||||
# sccache # MSVC_ASAN # format # why
|
# sccache # MSVC_ASAN # format # why
|
||||||
# On # On # Z7 # sccache will only play nice with Z7
|
# ON # ON # Z7 # sccache will only play nice with Z7
|
||||||
# On # Off # Z7 # sccache will only play nice with Z7
|
# ON # OFF # Z7 # sccache will only play nice with Z7
|
||||||
# Off # On # Zi # Asan will not play nice with Edit and Continue
|
# OFF # ON # Zi # Asan will not play nice with Edit and Continue
|
||||||
# Off # Off # ZI # Neither asan nor sscache is enabled Edit and Continue is available
|
# OFF # OFF # ZI # Neither asan nor sscache is enabled Edit and Continue is available
|
||||||
|
|
||||||
# Release Symbol format
|
# Release Symbol format
|
||||||
# sccache # MSVC_ASAN # format # why
|
# sccache # MSVC_ASAN # format # why
|
||||||
# On # On # Z7 # sccache will only play nice with Z7
|
# ON # ON # Z7 # sccache will only play nice with Z7
|
||||||
# On # Off # Z7 # sccache will only play nice with Z7
|
# ON # OFF # Z7 # sccache will only play nice with Z7
|
||||||
# Off # On # Zi # Asan will not play nice with Edit and Continue
|
# OFF # ON # Zi # Asan will not play nice with Edit and Continue
|
||||||
# Off # Off # Zi # Edit and Continue disables some optimizations
|
# OFF # OFF # Zi # Edit and Continue disables some optimizations
|
||||||
|
|
||||||
|
|
||||||
if(WITH_WINDOWS_SCCACHE)
|
if(WITH_WINDOWS_SCCACHE)
|
||||||
@@ -288,7 +288,7 @@ if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND # Only supported in the VS IDE
|
|||||||
"EnableMicrosoftCodeAnalysis=false"
|
"EnableMicrosoftCodeAnalysis=false"
|
||||||
"EnableClangTidyCodeAnalysis=true"
|
"EnableClangTidyCodeAnalysis=true"
|
||||||
)
|
)
|
||||||
set(VS_CLANG_TIDY On)
|
set(VS_CLANG_TIDY ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
||||||
@@ -469,7 +469,7 @@ if(WITH_PYTHON)
|
|||||||
|
|
||||||
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include)
|
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include)
|
||||||
set(PYTHON_NUMPY_INCLUDE_DIRS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include)
|
set(PYTHON_NUMPY_INCLUDE_DIRS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include)
|
||||||
set(NUMPY_FOUND On)
|
set(NUMPY_FOUND ON)
|
||||||
unset(_PYTHON_VERSION_NO_DOTS)
|
unset(_PYTHON_VERSION_NO_DOTS)
|
||||||
# uncached vars
|
# uncached vars
|
||||||
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
||||||
@@ -853,18 +853,18 @@ if(WITH_GMP)
|
|||||||
set(GMP_INCLUDE_DIRS ${LIBDIR}/gmp/include)
|
set(GMP_INCLUDE_DIRS ${LIBDIR}/gmp/include)
|
||||||
set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/libgmp-10.lib optimized ${LIBDIR}/gmp/lib/libgmpxx.lib debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib)
|
set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/libgmp-10.lib optimized ${LIBDIR}/gmp/lib/libgmpxx.lib debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib)
|
||||||
set(GMP_ROOT_DIR ${LIBDIR}/gmp)
|
set(GMP_ROOT_DIR ${LIBDIR}/gmp)
|
||||||
set(GMP_FOUND On)
|
set(GMP_FOUND ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_POTRACE)
|
if(WITH_POTRACE)
|
||||||
set(POTRACE_INCLUDE_DIRS ${LIBDIR}/potrace/include)
|
set(POTRACE_INCLUDE_DIRS ${LIBDIR}/potrace/include)
|
||||||
set(POTRACE_LIBRARIES ${LIBDIR}/potrace/lib/potrace.lib)
|
set(POTRACE_LIBRARIES ${LIBDIR}/potrace/lib/potrace.lib)
|
||||||
set(POTRACE_FOUND On)
|
set(POTRACE_FOUND ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_HARU)
|
if(WITH_HARU)
|
||||||
if(EXISTS ${LIBDIR}/haru)
|
if(EXISTS ${LIBDIR}/haru)
|
||||||
set(HARU_FOUND On)
|
set(HARU_FOUND ON)
|
||||||
set(HARU_ROOT_DIR ${LIBDIR}/haru)
|
set(HARU_ROOT_DIR ${LIBDIR}/haru)
|
||||||
set(HARU_INCLUDE_DIRS ${HARU_ROOT_DIR}/include)
|
set(HARU_INCLUDE_DIRS ${HARU_ROOT_DIR}/include)
|
||||||
set(HARU_LIBRARIES ${HARU_ROOT_DIR}/lib/libhpdfs.lib)
|
set(HARU_LIBRARIES ${HARU_ROOT_DIR}/lib/libhpdfs.lib)
|
||||||
|
@@ -243,7 +243,9 @@ def build_defines_as_args() -> List[str]:
|
|||||||
# use this module.
|
# use this module.
|
||||||
def queue_processes(
|
def queue_processes(
|
||||||
process_funcs: Sequence[Tuple[Callable[..., subprocess.Popen[Any]], Tuple[Any, ...]]],
|
process_funcs: Sequence[Tuple[Callable[..., subprocess.Popen[Any]], Tuple[Any, ...]]],
|
||||||
|
*,
|
||||||
job_total: int =-1,
|
job_total: int =-1,
|
||||||
|
sleep: float = 0.1,
|
||||||
) -> None:
|
) -> None:
|
||||||
""" Takes a list of function arg pairs, each function must return a process
|
""" Takes a list of function arg pairs, each function must return a process
|
||||||
"""
|
"""
|
||||||
@@ -271,14 +273,20 @@ def queue_processes(
|
|||||||
|
|
||||||
if len(processes) <= job_total:
|
if len(processes) <= job_total:
|
||||||
break
|
break
|
||||||
else:
|
time.sleep(sleep)
|
||||||
time.sleep(0.1)
|
|
||||||
|
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
|
|
||||||
processes.append(func(*args))
|
processes.append(func(*args))
|
||||||
|
|
||||||
|
# Don't return until all jobs have finished.
|
||||||
|
while 1:
|
||||||
|
processes[:] = [p for p in processes if p.poll() is None]
|
||||||
|
if not processes:
|
||||||
|
break
|
||||||
|
time.sleep(sleep)
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
if not os.path.exists(join(CMAKE_DIR, "CMakeCache.txt")):
|
if not os.path.exists(join(CMAKE_DIR, "CMakeCache.txt")):
|
||||||
|
@@ -3,7 +3,7 @@ for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
|
|||||||
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
||||||
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
|
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
|
||||||
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\37\bin\python.exe
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
||||||
if NOT "%verbose%" == "" (
|
if NOT "%verbose%" == "" (
|
||||||
echo svn : "%SVN%"
|
echo svn : "%SVN%"
|
||||||
echo cmake : "%CMAKE%"
|
echo cmake : "%CMAKE%"
|
||||||
|
@@ -10,7 +10,7 @@ exit /b 1
|
|||||||
echo found clang-format in %CF_PATH%
|
echo found clang-format in %CF_PATH%
|
||||||
|
|
||||||
if EXIST %PYTHON% (
|
if EXIST %PYTHON% (
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\37\bin\python.exe
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
||||||
goto detect_python_done
|
goto detect_python_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -116,6 +116,9 @@ if NOT "%1" == "" (
|
|||||||
) else if "%1" == "doc_py" (
|
) else if "%1" == "doc_py" (
|
||||||
set DOC_PY=1
|
set DOC_PY=1
|
||||||
goto EOF
|
goto EOF
|
||||||
|
) else if "%1" == "svnfix" (
|
||||||
|
set SVN_FIX=1
|
||||||
|
goto EOF
|
||||||
) else (
|
) else (
|
||||||
echo Command "%1" unknown, aborting!
|
echo Command "%1" unknown, aborting!
|
||||||
goto ERR
|
goto ERR
|
||||||
|
26
build_files/windows/svn_fix.cmd
Normal file
26
build_files/windows/svn_fix.cmd
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
|
||||||
|
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
||||||
|
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
||||||
|
|
||||||
|
echo Starting cleanup in %BUILD_VS_LIBDIR%.
|
||||||
|
cd %BUILD_VS_LIBDIR%
|
||||||
|
:RETRY
|
||||||
|
"%SVN%" cleanup
|
||||||
|
"%SVN%" update
|
||||||
|
if errorlevel 1 (
|
||||||
|
set /p LibRetry= "Error during update, retry? y/n"
|
||||||
|
if /I "!LibRetry!"=="Y" (
|
||||||
|
goto RETRY
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
echo Error: Download of external libraries failed.
|
||||||
|
echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
|
||||||
|
echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successful blender build
|
||||||
|
echo.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
echo Cleanup complete
|
||||||
|
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = V3.0
|
PROJECT_NUMBER = V3.1
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
|
@@ -0,0 +1,40 @@
|
|||||||
|
"""
|
||||||
|
This method enables conversions between Local and Pose space for bones in
|
||||||
|
the middle of updating the armature without having to update dependencies
|
||||||
|
after each change, by manually carrying updated matrices in a recursive walk.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def set_pose_matrices(obj, matrix_map):
|
||||||
|
"Assign pose space matrices of all bones at once, ignoring constraints."
|
||||||
|
|
||||||
|
def rec(pbone, parent_matrix):
|
||||||
|
matrix = matrix_map[pbone.name]
|
||||||
|
|
||||||
|
## Instead of:
|
||||||
|
# pbone.matrix = matrix
|
||||||
|
# bpy.context.view_layer.update()
|
||||||
|
|
||||||
|
# Compute and assign local matrix, using the new parent matrix
|
||||||
|
if pbone.parent:
|
||||||
|
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
|
||||||
|
matrix,
|
||||||
|
pbone.bone.matrix_local,
|
||||||
|
parent_matrix=parent_matrix,
|
||||||
|
parent_matrix_local=pbone.parent.bone.matrix_local,
|
||||||
|
invert=True
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
|
||||||
|
matrix,
|
||||||
|
pbone.bone.matrix_local,
|
||||||
|
invert=True
|
||||||
|
)
|
||||||
|
|
||||||
|
# Recursively process children, passing the new matrix through
|
||||||
|
for child in pbone.children:
|
||||||
|
rec(child, matrix)
|
||||||
|
|
||||||
|
# Scan all bone trees from their roots
|
||||||
|
for pbone in obj.pose.bones:
|
||||||
|
if not pbone.parent:
|
||||||
|
rec(pbone, None)
|
@@ -32,7 +32,7 @@ def draw():
|
|||||||
context.region,
|
context.region,
|
||||||
view_matrix,
|
view_matrix,
|
||||||
projection_matrix,
|
projection_matrix,
|
||||||
True)
|
do_color_management=True)
|
||||||
|
|
||||||
gpu.state.depth_mask_set(False)
|
gpu.state.depth_mask_set(False)
|
||||||
draw_texture_2d(offscreen.texture_color, (10, 10), WIDTH, HEIGHT)
|
draw_texture_2d(offscreen.texture_color, (10, 10), WIDTH, HEIGHT)
|
||||||
|
@@ -1101,14 +1101,18 @@ context_type_map = {
|
|||||||
"scene": ("Scene", False),
|
"scene": ("Scene", False),
|
||||||
"sculpt_object": ("Object", False),
|
"sculpt_object": ("Object", False),
|
||||||
"selectable_objects": ("Object", True),
|
"selectable_objects": ("Object", True),
|
||||||
|
"selected_asset_files": ("FileSelectEntry", True),
|
||||||
"selected_bones": ("EditBone", True),
|
"selected_bones": ("EditBone", True),
|
||||||
"selected_editable_bones": ("EditBone", True),
|
"selected_editable_bones": ("EditBone", True),
|
||||||
"selected_editable_fcurves": ("FCurve", True),
|
"selected_editable_fcurves": ("FCurve", True),
|
||||||
"selected_editable_keyframes": ("Keyframe", True),
|
"selected_editable_keyframes": ("Keyframe", True),
|
||||||
"selected_editable_objects": ("Object", True),
|
"selected_editable_objects": ("Object", True),
|
||||||
"selected_editable_sequences": ("Sequence", True),
|
"selected_editable_sequences": ("Sequence", True),
|
||||||
|
"selected_ids": ("ID", True),
|
||||||
"selected_files": ("FileSelectEntry", True),
|
"selected_files": ("FileSelectEntry", True),
|
||||||
|
"selected_ids": ("ID", True),
|
||||||
"selected_nla_strips": ("NlaStrip", True),
|
"selected_nla_strips": ("NlaStrip", True),
|
||||||
|
"selected_movieclip_tracks": ("MovieTrackingTrack", True),
|
||||||
"selected_nodes": ("Node", True),
|
"selected_nodes": ("Node", True),
|
||||||
"selected_objects": ("Object", True),
|
"selected_objects": ("Object", True),
|
||||||
"selected_pose_bones": ("PoseBone", True),
|
"selected_pose_bones": ("PoseBone", True),
|
||||||
@@ -1220,7 +1224,10 @@ def pycontext2sphinx(basepath):
|
|||||||
while char_array[i] is not None:
|
while char_array[i] is not None:
|
||||||
member = ctypes.string_at(char_array[i]).decode(encoding="ascii")
|
member = ctypes.string_at(char_array[i]).decode(encoding="ascii")
|
||||||
fw(".. data:: %s\n\n" % member)
|
fw(".. data:: %s\n\n" % member)
|
||||||
member_type, is_seq = context_type_map[member]
|
try:
|
||||||
|
member_type, is_seq = context_type_map[member]
|
||||||
|
except KeyError:
|
||||||
|
raise SystemExit("Error: context key %r not found in context_type_map; update %s" % (member, __file__)) from None
|
||||||
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
|
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
|
||||||
unique.add(member)
|
unique.add(member)
|
||||||
i += 1
|
i += 1
|
||||||
@@ -2247,7 +2254,7 @@ def main():
|
|||||||
# First monkey patch to load in fake members.
|
# First monkey patch to load in fake members.
|
||||||
setup_monkey_patch()
|
setup_monkey_patch()
|
||||||
|
|
||||||
# Perform changes to Blender it's self.
|
# Perform changes to Blender itself.
|
||||||
setup_data = setup_blender()
|
setup_data = setup_blender()
|
||||||
|
|
||||||
# eventually, create the dirs
|
# eventually, create the dirs
|
||||||
|
5
extern/CMakeLists.txt
vendored
5
extern/CMakeLists.txt
vendored
@@ -67,9 +67,12 @@ endif()
|
|||||||
|
|
||||||
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
||||||
add_subdirectory(clew)
|
add_subdirectory(clew)
|
||||||
if(WITH_CUDA_DYNLOAD)
|
if((WITH_CYCLES_DEVICE_CUDA OR WITH_CYCLES_DEVICE_OPTIX) AND WITH_CUDA_DYNLOAD)
|
||||||
add_subdirectory(cuew)
|
add_subdirectory(cuew)
|
||||||
endif()
|
endif()
|
||||||
|
if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD)
|
||||||
|
add_subdirectory(hipew)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_GHOST_X11 AND WITH_GHOST_XDND)
|
if(WITH_GHOST_X11 AND WITH_GHOST_XDND)
|
||||||
|
2
extern/audaspace/bindings/python/PySound.cpp
vendored
2
extern/audaspace/bindings/python/PySound.cpp
vendored
@@ -290,7 +290,7 @@ PyDoc_STRVAR(M_aud_Sound_buffer_doc,
|
|||||||
".. classmethod:: buffer(data, rate)\n\n"
|
".. classmethod:: buffer(data, rate)\n\n"
|
||||||
" Creates a sound from a data buffer.\n\n"
|
" Creates a sound from a data buffer.\n\n"
|
||||||
" :arg data: The data as two dimensional numpy array.\n"
|
" :arg data: The data as two dimensional numpy array.\n"
|
||||||
" :type data: numpy.ndarray\n"
|
" :type data: :class:`numpy.ndarray`\n"
|
||||||
" :arg rate: The sample rate.\n"
|
" :arg rate: The sample rate.\n"
|
||||||
" :type rate: double\n"
|
" :type rate: double\n"
|
||||||
" :return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
|
1
extern/cuew/include/cuew.h
vendored
1
extern/cuew/include/cuew.h
vendored
@@ -609,6 +609,7 @@ typedef enum cudaError_enum {
|
|||||||
CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219,
|
CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219,
|
||||||
CUDA_ERROR_NVLINK_UNCORRECTABLE = 220,
|
CUDA_ERROR_NVLINK_UNCORRECTABLE = 220,
|
||||||
CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221,
|
CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221,
|
||||||
|
CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 222,
|
||||||
CUDA_ERROR_INVALID_SOURCE = 300,
|
CUDA_ERROR_INVALID_SOURCE = 300,
|
||||||
CUDA_ERROR_FILE_NOT_FOUND = 301,
|
CUDA_ERROR_FILE_NOT_FOUND = 301,
|
||||||
CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302,
|
CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302,
|
||||||
|
1
extern/cuew/src/cuew.c
vendored
1
extern/cuew/src/cuew.c
vendored
@@ -736,6 +736,7 @@ const char *cuewErrorString(CUresult result) {
|
|||||||
case CUDA_ERROR_INVALID_GRAPHICS_CONTEXT: return "Invalid graphics context";
|
case CUDA_ERROR_INVALID_GRAPHICS_CONTEXT: return "Invalid graphics context";
|
||||||
case CUDA_ERROR_NVLINK_UNCORRECTABLE: return "Nvlink uncorrectable";
|
case CUDA_ERROR_NVLINK_UNCORRECTABLE: return "Nvlink uncorrectable";
|
||||||
case CUDA_ERROR_JIT_COMPILER_NOT_FOUND: return "Jit compiler not found";
|
case CUDA_ERROR_JIT_COMPILER_NOT_FOUND: return "Jit compiler not found";
|
||||||
|
case CUDA_ERROR_UNSUPPORTED_PTX_VERSION: return "Unsupported PTX version";
|
||||||
case CUDA_ERROR_INVALID_SOURCE: return "Invalid source";
|
case CUDA_ERROR_INVALID_SOURCE: return "Invalid source";
|
||||||
case CUDA_ERROR_FILE_NOT_FOUND: return "File not found";
|
case CUDA_ERROR_FILE_NOT_FOUND: return "File not found";
|
||||||
case CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND: return "Link to a shared object failed to resolve";
|
case CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND: return "Link to a shared object failed to resolve";
|
||||||
|
39
extern/hipew/CMakeLists.txt
vendored
Normal file
39
extern/hipew/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2021, Blender Foundation
|
||||||
|
# All rights reserved.
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
|
set(INC
|
||||||
|
.
|
||||||
|
include
|
||||||
|
)
|
||||||
|
|
||||||
|
set(INC_SYS
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
set(SRC
|
||||||
|
src/hipew.c
|
||||||
|
|
||||||
|
include/hipew.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(LIB
|
||||||
|
)
|
||||||
|
|
||||||
|
blender_add_lib(extern_hipew "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
1352
extern/hipew/include/hipew.h
vendored
Normal file
1352
extern/hipew/include/hipew.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
556
extern/hipew/src/hipew.c
vendored
Normal file
556
extern/hipew/src/hipew.c
vendored
Normal file
@@ -0,0 +1,556 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011-2021 Blender Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License
|
||||||
|
*/
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# if _MSC_VER < 1900
|
||||||
|
# define snprintf _snprintf
|
||||||
|
# endif
|
||||||
|
# define popen _popen
|
||||||
|
# define pclose _pclose
|
||||||
|
# define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <hipew.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# define VC_EXTRALEAN
|
||||||
|
# include <windows.h>
|
||||||
|
|
||||||
|
/* Utility macros. */
|
||||||
|
|
||||||
|
typedef HMODULE DynamicLibrary;
|
||||||
|
|
||||||
|
# define dynamic_library_open(path) LoadLibraryA(path)
|
||||||
|
# define dynamic_library_close(lib) FreeLibrary(lib)
|
||||||
|
# define dynamic_library_find(lib, symbol) GetProcAddress(lib, symbol)
|
||||||
|
#else
|
||||||
|
# include <dlfcn.h>
|
||||||
|
|
||||||
|
typedef void* DynamicLibrary;
|
||||||
|
|
||||||
|
# define dynamic_library_open(path) dlopen(path, RTLD_NOW)
|
||||||
|
# define dynamic_library_close(lib) dlclose(lib)
|
||||||
|
# define dynamic_library_find(lib, symbol) dlsym(lib, symbol)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define _LIBRARY_FIND_CHECKED(lib, name) \
|
||||||
|
name = (t##name *)dynamic_library_find(lib, #name); \
|
||||||
|
assert(name);
|
||||||
|
|
||||||
|
#define _LIBRARY_FIND(lib, name) \
|
||||||
|
name = (t##name *)dynamic_library_find(lib, #name);
|
||||||
|
|
||||||
|
#define HIP_LIBRARY_FIND_CHECKED(name) \
|
||||||
|
_LIBRARY_FIND_CHECKED(hip_lib, name)
|
||||||
|
#define HIP_LIBRARY_FIND(name) _LIBRARY_FIND(hip_lib, name)
|
||||||
|
|
||||||
|
|
||||||
|
static DynamicLibrary hip_lib;
|
||||||
|
|
||||||
|
/* Function definitions. */
|
||||||
|
thipGetErrorName *hipGetErrorName;
|
||||||
|
thipInit *hipInit;
|
||||||
|
thipDriverGetVersion *hipDriverGetVersion;
|
||||||
|
thipGetDevice *hipGetDevice;
|
||||||
|
thipGetDeviceCount *hipGetDeviceCount;
|
||||||
|
thipGetDeviceProperties *hipGetDeviceProperties;
|
||||||
|
thipDeviceGetName *hipDeviceGetName;
|
||||||
|
thipDeviceGetAttribute *hipDeviceGetAttribute;
|
||||||
|
thipDeviceComputeCapability *hipDeviceComputeCapability;
|
||||||
|
thipDevicePrimaryCtxRetain *hipDevicePrimaryCtxRetain;
|
||||||
|
thipDevicePrimaryCtxRelease *hipDevicePrimaryCtxRelease;
|
||||||
|
thipDevicePrimaryCtxSetFlags *hipDevicePrimaryCtxSetFlags;
|
||||||
|
thipDevicePrimaryCtxGetState *hipDevicePrimaryCtxGetState;
|
||||||
|
thipDevicePrimaryCtxReset *hipDevicePrimaryCtxReset;
|
||||||
|
thipCtxCreate *hipCtxCreate;
|
||||||
|
thipCtxDestroy *hipCtxDestroy;
|
||||||
|
thipCtxPushCurrent *hipCtxPushCurrent;
|
||||||
|
thipCtxPopCurrent *hipCtxPopCurrent;
|
||||||
|
thipCtxSetCurrent *hipCtxSetCurrent;
|
||||||
|
thipCtxGetCurrent *hipCtxGetCurrent;
|
||||||
|
thipCtxGetDevice *hipCtxGetDevice;
|
||||||
|
thipCtxGetFlags *hipCtxGetFlags;
|
||||||
|
thipCtxSynchronize *hipCtxSynchronize;
|
||||||
|
thipDeviceSynchronize *hipDeviceSynchronize;
|
||||||
|
thipCtxGetCacheConfig *hipCtxGetCacheConfig;
|
||||||
|
thipCtxSetCacheConfig *hipCtxSetCacheConfig;
|
||||||
|
thipCtxGetSharedMemConfig *hipCtxGetSharedMemConfig;
|
||||||
|
thipCtxSetSharedMemConfig *hipCtxSetSharedMemConfig;
|
||||||
|
thipCtxGetApiVersion *hipCtxGetApiVersion;
|
||||||
|
thipModuleLoad *hipModuleLoad;
|
||||||
|
thipModuleLoadData *hipModuleLoadData;
|
||||||
|
thipModuleLoadDataEx *hipModuleLoadDataEx;
|
||||||
|
thipModuleUnload *hipModuleUnload;
|
||||||
|
thipModuleGetFunction *hipModuleGetFunction;
|
||||||
|
thipModuleGetGlobal *hipModuleGetGlobal;
|
||||||
|
thipModuleGetTexRef *hipModuleGetTexRef;
|
||||||
|
thipMemGetInfo *hipMemGetInfo;
|
||||||
|
thipMalloc *hipMalloc;
|
||||||
|
thipMemAllocPitch *hipMemAllocPitch;
|
||||||
|
thipFree *hipFree;
|
||||||
|
thipMemGetAddressRange *hipMemGetAddressRange;
|
||||||
|
thipHostMalloc *hipHostMalloc;
|
||||||
|
thipHostFree *hipHostFree;
|
||||||
|
thipHostGetDevicePointer *hipHostGetDevicePointer;
|
||||||
|
thipHostGetFlags *hipHostGetFlags;
|
||||||
|
thipMallocManaged *hipMallocManaged;
|
||||||
|
thipDeviceGetByPCIBusId *hipDeviceGetByPCIBusId;
|
||||||
|
thipDeviceGetPCIBusId *hipDeviceGetPCIBusId;
|
||||||
|
thipMemcpyPeer *hipMemcpyPeer;
|
||||||
|
thipMemcpyHtoD *hipMemcpyHtoD;
|
||||||
|
thipMemcpyDtoH *hipMemcpyDtoH;
|
||||||
|
thipMemcpyDtoD *hipMemcpyDtoD;
|
||||||
|
thipDrvMemcpy2DUnaligned *hipDrvMemcpy2DUnaligned;
|
||||||
|
thipMemcpyParam2D *hipMemcpyParam2D;
|
||||||
|
thipDrvMemcpy3D *hipDrvMemcpy3D;
|
||||||
|
thipMemcpyHtoDAsync *hipMemcpyHtoDAsync;
|
||||||
|
thipMemcpyDtoHAsync *hipMemcpyDtoHAsync;
|
||||||
|
thipMemcpyParam2DAsync *hipMemcpyParam2DAsync;
|
||||||
|
thipDrvMemcpy3DAsync *hipDrvMemcpy3DAsync;
|
||||||
|
thipMemsetD8 *hipMemsetD8;
|
||||||
|
thipMemsetD16 *hipMemsetD16;
|
||||||
|
thipMemsetD32 *hipMemsetD32;
|
||||||
|
thipMemsetD8Async *hipMemsetD8Async;
|
||||||
|
thipMemsetD16Async *hipMemsetD16Async;
|
||||||
|
thipMemsetD32Async *hipMemsetD32Async;
|
||||||
|
thipArrayCreate *hipArrayCreate;
|
||||||
|
thipArrayDestroy *hipArrayDestroy;
|
||||||
|
thipArray3DCreate *hipArray3DCreate;
|
||||||
|
thipStreamCreateWithFlags *hipStreamCreateWithFlags;
|
||||||
|
thipStreamCreateWithPriority *hipStreamCreateWithPriority;
|
||||||
|
thipStreamGetPriority *hipStreamGetPriority;
|
||||||
|
thipStreamGetFlags *hipStreamGetFlags;
|
||||||
|
thipStreamWaitEvent *hipStreamWaitEvent;
|
||||||
|
thipStreamAddCallback *hipStreamAddCallback;
|
||||||
|
thipStreamQuery *hipStreamQuery;
|
||||||
|
thipStreamSynchronize *hipStreamSynchronize;
|
||||||
|
thipStreamDestroy *hipStreamDestroy;
|
||||||
|
thipEventCreateWithFlags *hipEventCreateWithFlags;
|
||||||
|
thipEventRecord *hipEventRecord;
|
||||||
|
thipEventQuery *hipEventQuery;
|
||||||
|
thipEventSynchronize *hipEventSynchronize;
|
||||||
|
thipEventDestroy *hipEventDestroy;
|
||||||
|
thipEventElapsedTime *hipEventElapsedTime;
|
||||||
|
thipFuncGetAttribute *hipFuncGetAttribute;
|
||||||
|
thipFuncSetCacheConfig *hipFuncSetCacheConfig;
|
||||||
|
thipModuleLaunchKernel *hipModuleLaunchKernel;
|
||||||
|
thipDrvOccupancyMaxActiveBlocksPerMultiprocessor *hipDrvOccupancyMaxActiveBlocksPerMultiprocessor;
|
||||||
|
thipDrvOccupancyMaxActiveBlocksPerMultiprocessorWithFlags *hipDrvOccupancyMaxActiveBlocksPerMultiprocessorWithFlags;
|
||||||
|
thipModuleOccupancyMaxPotentialBlockSize *hipModuleOccupancyMaxPotentialBlockSize;
|
||||||
|
thipTexRefSetArray *hipTexRefSetArray;
|
||||||
|
thipTexRefSetAddress *hipTexRefSetAddress;
|
||||||
|
thipTexRefSetAddress2D *hipTexRefSetAddress2D;
|
||||||
|
thipTexRefSetFormat *hipTexRefSetFormat;
|
||||||
|
thipTexRefSetAddressMode *hipTexRefSetAddressMode;
|
||||||
|
thipTexRefSetFilterMode *hipTexRefSetFilterMode;
|
||||||
|
thipTexRefSetFlags *hipTexRefSetFlags;
|
||||||
|
thipTexRefGetAddress *hipTexRefGetAddress;
|
||||||
|
thipTexRefGetArray *hipTexRefGetArray;
|
||||||
|
thipTexRefGetAddressMode *hipTexRefGetAddressMode;
|
||||||
|
thipTexObjectCreate *hipTexObjectCreate;
|
||||||
|
thipTexObjectDestroy *hipTexObjectDestroy;
|
||||||
|
thipDeviceCanAccessPeer *hipDeviceCanAccessPeer;
|
||||||
|
|
||||||
|
thipCtxEnablePeerAccess *hipCtxEnablePeerAccess;
|
||||||
|
thipCtxDisablePeerAccess *hipCtxDisablePeerAccess;
|
||||||
|
thipDeviceGetP2PAttribute *hipDeviceGetP2PAttribute;
|
||||||
|
thipGraphicsUnregisterResource *hipGraphicsUnregisterResource;
|
||||||
|
thipGraphicsMapResources *hipGraphicsMapResources;
|
||||||
|
thipGraphicsUnmapResources *hipGraphicsUnmapResources;
|
||||||
|
thipGraphicsResourceGetMappedPointer *hipGraphicsResourceGetMappedPointer;
|
||||||
|
|
||||||
|
thipGraphicsGLRegisterBuffer *hipGraphicsGLRegisterBuffer;
|
||||||
|
thipGLGetDevices *hipGLGetDevices;
|
||||||
|
|
||||||
|
thiprtcGetErrorString* hiprtcGetErrorString;
|
||||||
|
thiprtcAddNameExpression* hiprtcAddNameExpression;
|
||||||
|
thiprtcCompileProgram* hiprtcCompileProgram;
|
||||||
|
thiprtcCreateProgram* hiprtcCreateProgram;
|
||||||
|
thiprtcDestroyProgram* hiprtcDestroyProgram;
|
||||||
|
thiprtcGetLoweredName* hiprtcGetLoweredName;
|
||||||
|
thiprtcGetProgramLog* hiprtcGetProgramLog;
|
||||||
|
thiprtcGetProgramLogSize* hiprtcGetProgramLogSize;
|
||||||
|
thiprtcGetCode* hiprtcGetCode;
|
||||||
|
thiprtcGetCodeSize* hiprtcGetCodeSize;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static DynamicLibrary dynamic_library_open_find(const char **paths) {
|
||||||
|
int i = 0;
|
||||||
|
while (paths[i] != NULL) {
|
||||||
|
DynamicLibrary lib = dynamic_library_open(paths[i]);
|
||||||
|
if (lib != NULL) {
|
||||||
|
return lib;
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Implementation function. */
|
||||||
|
static void hipewHipExit(void) {
|
||||||
|
if (hip_lib != NULL) {
|
||||||
|
/* Ignore errors. */
|
||||||
|
dynamic_library_close(hip_lib);
|
||||||
|
hip_lib = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int hipewHipInit(void) {
|
||||||
|
/* Library paths. */
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* Expected in c:/windows/system or similar, no path needed. */
|
||||||
|
const char *hip_paths[] = {"amdhip64.dll", NULL};
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
/* Default installation path. */
|
||||||
|
const char *hip_paths[] = {"", NULL};
|
||||||
|
#else
|
||||||
|
const char *hip_paths[] = {"/opt/rocm/hip/lib/libamdhip64.so", NULL};
|
||||||
|
#endif
|
||||||
|
static int initialized = 0;
|
||||||
|
static int result = 0;
|
||||||
|
int error, driver_version;
|
||||||
|
|
||||||
|
if (initialized) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
initialized = 1;
|
||||||
|
|
||||||
|
error = atexit(hipewHipExit);
|
||||||
|
if (error) {
|
||||||
|
result = HIPEW_ERROR_ATEXIT_FAILED;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Load library. */
|
||||||
|
hip_lib = dynamic_library_open_find(hip_paths);
|
||||||
|
|
||||||
|
if (hip_lib == NULL) {
|
||||||
|
result = HIPEW_ERROR_OPEN_FAILED;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fetch all function pointers. */
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGetErrorName);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipInit);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDriverGetVersion);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGetDevice);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceCount);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceProperties);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetName);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetAttribute);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceComputeCapability);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDevicePrimaryCtxRetain);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDevicePrimaryCtxRelease);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDevicePrimaryCtxSetFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDevicePrimaryCtxGetState);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDevicePrimaryCtxReset);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxCreate);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxDestroy);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxPushCurrent);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxPopCurrent);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxSetCurrent);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxGetCurrent);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxGetDevice);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxGetFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxSynchronize);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceSynchronize);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxGetCacheConfig);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxSetCacheConfig);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxGetSharedMemConfig);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxSetSharedMemConfig);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxGetApiVersion);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleLoad);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleLoadData);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleLoadDataEx);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleUnload);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleGetFunction);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleGetGlobal);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleGetTexRef);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemGetInfo);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMalloc);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemAllocPitch);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipFree);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemGetAddressRange);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipHostMalloc);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipHostFree);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipHostGetDevicePointer);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipHostGetFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMallocManaged);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetByPCIBusId);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetPCIBusId);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyPeer);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyHtoD);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyDtoH);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyDtoD);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyParam2D);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDrvMemcpy3D);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyHtoDAsync);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyDtoHAsync);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDrvMemcpy2DUnaligned);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemcpyParam2DAsync);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDrvMemcpy3DAsync);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemsetD8);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemsetD16);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemsetD32);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemsetD8Async);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemsetD16Async);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipMemsetD32Async);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipArrayCreate);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipArrayDestroy);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipArray3DCreate);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamCreateWithFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamCreateWithPriority);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamGetPriority);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamGetFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamWaitEvent);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamAddCallback);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamQuery);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamSynchronize);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipStreamDestroy);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipEventCreateWithFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipEventRecord);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipEventQuery);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipEventSynchronize);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipEventDestroy);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipEventElapsedTime);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipFuncGetAttribute);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipFuncSetCacheConfig);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleLaunchKernel);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipModuleOccupancyMaxPotentialBlockSize);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetArray);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetAddress);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetAddress2D);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetFormat);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetAddressMode);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetFilterMode);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefSetFlags);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefGetAddress);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexRefGetAddressMode);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexObjectCreate);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipTexObjectDestroy);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceCanAccessPeer);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxEnablePeerAccess);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipCtxDisablePeerAccess);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetP2PAttribute);
|
||||||
|
#ifdef _WIN32
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGraphicsUnregisterResource);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGraphicsMapResources);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGraphicsUnmapResources);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGraphicsResourceGetMappedPointer);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGraphicsGLRegisterBuffer);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hipGLGetDevices);
|
||||||
|
#endif
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcGetErrorString);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcAddNameExpression);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcCompileProgram);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcCreateProgram);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcDestroyProgram);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcGetLoweredName);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcGetProgramLog);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcGetProgramLogSize);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcGetCode);
|
||||||
|
HIP_LIBRARY_FIND_CHECKED(hiprtcGetCodeSize);
|
||||||
|
result = HIPEW_SUCCESS;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int hipewInit(hipuint32_t flags) {
|
||||||
|
int result = HIPEW_SUCCESS;
|
||||||
|
|
||||||
|
if (flags & HIPEW_INIT_HIP) {
|
||||||
|
result = hipewHipInit();
|
||||||
|
if (result != HIPEW_SUCCESS) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char *hipewErrorString(hipError_t result) {
|
||||||
|
switch (result) {
|
||||||
|
case hipSuccess: return "No errors";
|
||||||
|
case hipErrorInvalidValue: return "Invalid value";
|
||||||
|
case hipErrorOutOfMemory: return "Out of memory";
|
||||||
|
case hipErrorNotInitialized: return "Driver not initialized";
|
||||||
|
case hipErrorDeinitialized: return "Driver deinitialized";
|
||||||
|
case hipErrorProfilerDisabled: return "Profiler disabled";
|
||||||
|
case hipErrorProfilerNotInitialized: return "Profiler not initialized";
|
||||||
|
case hipErrorProfilerAlreadyStarted: return "Profiler already started";
|
||||||
|
case hipErrorProfilerAlreadyStopped: return "Profiler already stopped";
|
||||||
|
case hipErrorNoDevice: return "No HIP-capable device available";
|
||||||
|
case hipErrorInvalidDevice: return "Invalid device";
|
||||||
|
case hipErrorInvalidImage: return "Invalid kernel image";
|
||||||
|
case hipErrorInvalidContext: return "Invalid context";
|
||||||
|
case hipErrorContextAlreadyCurrent: return "Context already current";
|
||||||
|
case hipErrorMapFailed: return "Map failed";
|
||||||
|
case hipErrorUnmapFailed: return "Unmap failed";
|
||||||
|
case hipErrorArrayIsMapped: return "Array is mapped";
|
||||||
|
case hipErrorAlreadyMapped: return "Already mapped";
|
||||||
|
case hipErrorNoBinaryForGpu: return "No binary for GPU";
|
||||||
|
case hipErrorAlreadyAcquired: return "Already acquired";
|
||||||
|
case hipErrorNotMapped: return "Not mapped";
|
||||||
|
case hipErrorNotMappedAsArray: return "Mapped resource not available for access as an array";
|
||||||
|
case hipErrorNotMappedAsPointer: return "Mapped resource not available for access as a pointer";
|
||||||
|
case hipErrorECCNotCorrectable: return "Uncorrectable ECC error detected";
|
||||||
|
case hipErrorUnsupportedLimit: return "hipLimit_t not supported by device";
|
||||||
|
case hipErrorContextAlreadyInUse: return "Context already in use";
|
||||||
|
case hipErrorPeerAccessUnsupported: return "Peer access unsupported";
|
||||||
|
case hipErrorInvalidKernelFile: return "Invalid ptx";
|
||||||
|
case hipErrorInvalidGraphicsContext: return "Invalid graphics context";
|
||||||
|
case hipErrorInvalidSource: return "Invalid source";
|
||||||
|
case hipErrorFileNotFound: return "File not found";
|
||||||
|
case hipErrorSharedObjectSymbolNotFound: return "Link to a shared object failed to resolve";
|
||||||
|
case hipErrorSharedObjectInitFailed: return "Shared object initialization failed";
|
||||||
|
case hipErrorOperatingSystem: return "Operating system";
|
||||||
|
case hipErrorInvalidHandle: return "Invalid handle";
|
||||||
|
case hipErrorNotFound: return "Not found";
|
||||||
|
case hipErrorNotReady: return "HIP not ready";
|
||||||
|
case hipErrorIllegalAddress: return "Illegal address";
|
||||||
|
case hipErrorLaunchOutOfResources: return "Launch exceeded resources";
|
||||||
|
case hipErrorLaunchTimeOut: return "Launch exceeded timeout";
|
||||||
|
case hipErrorPeerAccessAlreadyEnabled: return "Peer access already enabled";
|
||||||
|
case hipErrorPeerAccessNotEnabled: return "Peer access not enabled";
|
||||||
|
case hipErrorSetOnActiveProcess: return "Primary context active";
|
||||||
|
case hipErrorAssert: return "Assert";
|
||||||
|
case hipErrorHostMemoryAlreadyRegistered: return "Host memory already registered";
|
||||||
|
case hipErrorHostMemoryNotRegistered: return "Host memory not registered";
|
||||||
|
case hipErrorLaunchFailure: return "Launch failed";
|
||||||
|
case hipErrorCooperativeLaunchTooLarge: return "Cooperative launch too large";
|
||||||
|
case hipErrorNotSupported: return "Not supported";
|
||||||
|
case hipErrorUnknown: return "Unknown error";
|
||||||
|
default: return "Unknown HIP error value";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void path_join(const char *path1,
|
||||||
|
const char *path2,
|
||||||
|
int maxlen,
|
||||||
|
char *result) {
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
const char separator = '\\';
|
||||||
|
#else
|
||||||
|
const char separator = '/';
|
||||||
|
#endif
|
||||||
|
int n = snprintf(result, maxlen, "%s%c%s", path1, separator, path2);
|
||||||
|
if (n != -1 && n < maxlen) {
|
||||||
|
result[n] = '\0';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result[maxlen - 1] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int path_exists(const char *path) {
|
||||||
|
struct stat st;
|
||||||
|
if (stat(path, &st)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *hipewCompilerPath(void) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
const char *hipPath = getenv("HIP_ROCCLR_HOME");
|
||||||
|
const char *windowsCommand = "perl ";
|
||||||
|
const char *executable = "bin/hipcc";
|
||||||
|
|
||||||
|
static char hipcc[65536];
|
||||||
|
static char finalCommand[65536];
|
||||||
|
if(hipPath) {
|
||||||
|
path_join(hipPath, executable, sizeof(hipcc), hipcc);
|
||||||
|
if(path_exists(hipcc)) {
|
||||||
|
snprintf(finalCommand, sizeof(hipcc), "%s %s", windowsCommand, hipcc);
|
||||||
|
return finalCommand;
|
||||||
|
} else {
|
||||||
|
printf("Could not find hipcc. Make sure HIP_ROCCLR_HOME points to the directory holding /bin/hipcc");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
const char *hipPath = "opt/rocm/hip/bin";
|
||||||
|
const char *executable = "hipcc";
|
||||||
|
|
||||||
|
static char hipcc[65536];
|
||||||
|
if(hipPath) {
|
||||||
|
path_join(hipPath, executable, sizeof(hipcc), hipcc);
|
||||||
|
if(path_exists(hipcc)){
|
||||||
|
return hipcc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
FILE *handle = popen("where hipcc", "r");
|
||||||
|
#else
|
||||||
|
FILE *handle = popen("which hipcc", "r");
|
||||||
|
#endif
|
||||||
|
if (handle) {
|
||||||
|
char buffer[4096] = {0};
|
||||||
|
int len = fread(buffer, 1, sizeof(buffer) - 1, handle);
|
||||||
|
buffer[len] = '\0';
|
||||||
|
pclose(handle);
|
||||||
|
if (buffer[0]) {
|
||||||
|
return "hipcc";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int hipewCompilerVersion(void) {
|
||||||
|
const char *path = hipewCompilerPath();
|
||||||
|
const char *marker = "Hip compilation tools, release ";
|
||||||
|
FILE *pipe;
|
||||||
|
int major, minor;
|
||||||
|
char *versionstr;
|
||||||
|
char buf[128];
|
||||||
|
char output[65536] = "\0";
|
||||||
|
char command[65536] = "\0";
|
||||||
|
|
||||||
|
if (path == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get --version output */
|
||||||
|
strcat(command, "\"");
|
||||||
|
strncat(command, path, sizeof(command) - 1);
|
||||||
|
strncat(command, "\" --version", sizeof(command) - strlen(path) - 1);
|
||||||
|
pipe = popen(command, "r");
|
||||||
|
if (!pipe) {
|
||||||
|
fprintf(stderr, "HIP: failed to run compiler to retrieve version");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!feof(pipe)) {
|
||||||
|
if (fgets(buf, sizeof(buf), pipe) != NULL) {
|
||||||
|
strncat(output, buf, sizeof(output) - strlen(output) - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pclose(pipe);
|
||||||
|
return 40;
|
||||||
|
}
|
2
extern/smaa_areatex/smaa_areatex.cpp
vendored
2
extern/smaa_areatex/smaa_areatex.cpp
vendored
@@ -574,6 +574,8 @@ Dbl2 AreaDiag::area(Dbl2 p1, Dbl2 p2, int left)
|
|||||||
Dbl2 d = p2 - p1;
|
Dbl2 d = p2 - p1;
|
||||||
if (d.x == 0.0)
|
if (d.x == 0.0)
|
||||||
return Dbl2(0.0, 1.0);
|
return Dbl2(0.0, 1.0);
|
||||||
|
if (d.y == 0.0)
|
||||||
|
return Dbl2(1.0, 0.0);
|
||||||
|
|
||||||
double x1 = (double)(1 + left);
|
double x1 = (double)(1 + left);
|
||||||
double x2 = x1 + 1.0;
|
double x2 = x1 + 1.0;
|
||||||
|
BIN
extern/tinygltf/patches/TinyGLTF.diff
vendored
Normal file
BIN
extern/tinygltf/patches/TinyGLTF.diff
vendored
Normal file
Binary file not shown.
@@ -295,12 +295,6 @@ if(WITH_OPENIMAGEDENOISE)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_STANDALONE)
|
|
||||||
set(WITH_CYCLES_DEVICE_CUDA TRUE)
|
|
||||||
endif()
|
|
||||||
# TODO(sergey): Consider removing it, only causes confusion in interface.
|
|
||||||
set(WITH_CYCLES_DEVICE_MULTI TRUE)
|
|
||||||
|
|
||||||
# Logging capabilities using GLog library.
|
# Logging capabilities using GLog library.
|
||||||
if(WITH_CYCLES_LOGGING)
|
if(WITH_CYCLES_LOGGING)
|
||||||
add_definitions(-DWITH_CYCLES_LOGGING)
|
add_definitions(-DWITH_CYCLES_LOGGING)
|
||||||
@@ -399,7 +393,8 @@ add_subdirectory(doc)
|
|||||||
add_subdirectory(graph)
|
add_subdirectory(graph)
|
||||||
add_subdirectory(integrator)
|
add_subdirectory(integrator)
|
||||||
add_subdirectory(kernel)
|
add_subdirectory(kernel)
|
||||||
add_subdirectory(render)
|
add_subdirectory(scene)
|
||||||
|
add_subdirectory(session)
|
||||||
add_subdirectory(subd)
|
add_subdirectory(subd)
|
||||||
add_subdirectory(util)
|
add_subdirectory(util)
|
||||||
|
|
||||||
|
@@ -25,7 +25,8 @@ set(INC_SYS
|
|||||||
set(LIBRARIES
|
set(LIBRARIES
|
||||||
cycles_device
|
cycles_device
|
||||||
cycles_kernel
|
cycles_kernel
|
||||||
cycles_render
|
cycles_scene
|
||||||
|
cycles_session
|
||||||
cycles_bvh
|
cycles_bvh
|
||||||
cycles_subd
|
cycles_subd
|
||||||
cycles_graph
|
cycles_graph
|
||||||
@@ -64,6 +65,8 @@ if(WITH_CYCLES_STANDALONE)
|
|||||||
cycles_standalone.cpp
|
cycles_standalone.cpp
|
||||||
cycles_xml.cpp
|
cycles_xml.cpp
|
||||||
cycles_xml.h
|
cycles_xml.h
|
||||||
|
oiio_output_driver.cpp
|
||||||
|
oiio_output_driver.h
|
||||||
)
|
)
|
||||||
add_executable(cycles ${SRC} ${INC} ${INC_SYS})
|
add_executable(cycles ${SRC} ${INC} ${INC_SYS})
|
||||||
unset(SRC)
|
unset(SRC)
|
||||||
@@ -73,7 +76,7 @@ if(WITH_CYCLES_STANDALONE)
|
|||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
if(WITH_OPENCOLORIO)
|
if(WITH_OPENCOLORIO)
|
||||||
set_property(TARGET cycles APPEND_STRING PROPERTY LINK_FLAGS " -framework IOKit")
|
set_property(TARGET cycles APPEND_STRING PROPERTY LINK_FLAGS " -framework IOKit -framework Carbon")
|
||||||
endif()
|
endif()
|
||||||
if(WITH_OPENIMAGEDENOISE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
if(WITH_OPENIMAGEDENOISE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
||||||
# OpenImageDenoise uses BNNS from the Accelerate framework.
|
# OpenImageDenoise uses BNNS from the Accelerate framework.
|
||||||
|
@@ -18,13 +18,13 @@
|
|||||||
|
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
|
|
||||||
#include "util/util_args.h"
|
#include "util/args.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_path.h"
|
#include "util/path.h"
|
||||||
#include "util/util_stats.h"
|
#include "util/stats.h"
|
||||||
#include "util/util_string.h"
|
#include "util/string.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
|
|
||||||
using namespace ccl;
|
using namespace ccl;
|
||||||
|
|
||||||
|
@@ -17,27 +17,30 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
#include "render/buffers.h"
|
#include "scene/camera.h"
|
||||||
#include "render/camera.h"
|
#include "scene/integrator.h"
|
||||||
#include "render/integrator.h"
|
#include "scene/scene.h"
|
||||||
#include "render/scene.h"
|
#include "session/buffers.h"
|
||||||
#include "render/session.h"
|
#include "session/session.h"
|
||||||
|
|
||||||
#include "util/util_args.h"
|
#include "util/args.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_function.h"
|
#include "util/function.h"
|
||||||
#include "util/util_image.h"
|
#include "util/image.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_path.h"
|
#include "util/path.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/progress.h"
|
||||||
#include "util/util_string.h"
|
#include "util/string.h"
|
||||||
#include "util/util_time.h"
|
#include "util/time.h"
|
||||||
#include "util/util_transform.h"
|
#include "util/transform.h"
|
||||||
#include "util/util_unique_ptr.h"
|
#include "util/unique_ptr.h"
|
||||||
#include "util/util_version.h"
|
#include "util/version.h"
|
||||||
|
|
||||||
|
#include "app/cycles_xml.h"
|
||||||
|
#include "app/oiio_output_driver.h"
|
||||||
|
|
||||||
#ifdef WITH_CYCLES_STANDALONE_GUI
|
#ifdef WITH_CYCLES_STANDALONE_GUI
|
||||||
# include "util/util_view.h"
|
# include "util/view.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "app/cycles_xml.h"
|
#include "app/cycles_xml.h"
|
||||||
@@ -54,6 +57,7 @@ struct Options {
|
|||||||
bool quiet;
|
bool quiet;
|
||||||
bool show_help, interactive, pause;
|
bool show_help, interactive, pause;
|
||||||
string output_filepath;
|
string output_filepath;
|
||||||
|
string output_pass;
|
||||||
} options;
|
} options;
|
||||||
|
|
||||||
static void session_print(const string &str)
|
static void session_print(const string &str)
|
||||||
@@ -89,30 +93,6 @@ static void session_print_status()
|
|||||||
session_print(status);
|
session_print(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool write_render(const uchar *pixels, int w, int h, int channels)
|
|
||||||
{
|
|
||||||
string msg = string_printf("Writing image %s", options.output_path.c_str());
|
|
||||||
session_print(msg);
|
|
||||||
|
|
||||||
unique_ptr<ImageOutput> out = unique_ptr<ImageOutput>(ImageOutput::create(options.output_path));
|
|
||||||
if (!out) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageSpec spec(w, h, channels, TypeDesc::UINT8);
|
|
||||||
if (!out->open(options.output_path, spec)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* conversion for different top/bottom convention */
|
|
||||||
out->write_image(
|
|
||||||
TypeDesc::UINT8, pixels + (h - 1) * w * channels, AutoStride, -w * channels, AutoStride);
|
|
||||||
|
|
||||||
out->close();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BufferParams &session_buffer_params()
|
static BufferParams &session_buffer_params()
|
||||||
{
|
{
|
||||||
static BufferParams buffer_params;
|
static BufferParams buffer_params;
|
||||||
@@ -147,9 +127,14 @@ static void scene_init()
|
|||||||
|
|
||||||
static void session_init()
|
static void session_init()
|
||||||
{
|
{
|
||||||
options.session_params.write_render_cb = write_render;
|
options.output_pass = "combined";
|
||||||
options.session = new Session(options.session_params, options.scene_params);
|
options.session = new Session(options.session_params, options.scene_params);
|
||||||
|
|
||||||
|
if (!options.output_filepath.empty()) {
|
||||||
|
options.session->set_output_driver(make_unique<OIIOOutputDriver>(
|
||||||
|
options.output_filepath, options.output_pass, session_print));
|
||||||
|
}
|
||||||
|
|
||||||
if (options.session_params.background && !options.quiet)
|
if (options.session_params.background && !options.quiet)
|
||||||
options.session->progress.set_update_callback(function_bind(&session_print_status));
|
options.session->progress.set_update_callback(function_bind(&session_print_status));
|
||||||
#ifdef WITH_CYCLES_STANDALONE_GUI
|
#ifdef WITH_CYCLES_STANDALONE_GUI
|
||||||
@@ -160,6 +145,11 @@ static void session_init()
|
|||||||
/* load scene */
|
/* load scene */
|
||||||
scene_init();
|
scene_init();
|
||||||
|
|
||||||
|
/* add pass for output. */
|
||||||
|
Pass *pass = options.scene->create_node<Pass>();
|
||||||
|
pass->set_name(ustring(options.output_pass.c_str()));
|
||||||
|
pass->set_type(PASS_COMBINED);
|
||||||
|
|
||||||
options.session->reset(options.session_params, session_buffer_params());
|
options.session->reset(options.session_params, session_buffer_params());
|
||||||
options.session->start();
|
options.session->start();
|
||||||
}
|
}
|
||||||
|
@@ -22,27 +22,27 @@
|
|||||||
|
|
||||||
#include "graph/node_xml.h"
|
#include "graph/node_xml.h"
|
||||||
|
|
||||||
#include "render/background.h"
|
#include "scene/background.h"
|
||||||
#include "render/camera.h"
|
#include "scene/camera.h"
|
||||||
#include "render/film.h"
|
#include "scene/film.h"
|
||||||
#include "render/graph.h"
|
#include "scene/integrator.h"
|
||||||
#include "render/integrator.h"
|
#include "scene/light.h"
|
||||||
#include "render/light.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/object.h"
|
||||||
#include "render/nodes.h"
|
#include "scene/osl.h"
|
||||||
#include "render/object.h"
|
#include "scene/scene.h"
|
||||||
#include "render/osl.h"
|
#include "scene/shader.h"
|
||||||
#include "render/scene.h"
|
#include "scene/shader_graph.h"
|
||||||
#include "render/shader.h"
|
#include "scene/shader_nodes.h"
|
||||||
|
|
||||||
#include "subd/subd_patch.h"
|
#include "subd/patch.h"
|
||||||
#include "subd/subd_split.h"
|
#include "subd/split.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_path.h"
|
#include "util/path.h"
|
||||||
#include "util/util_projection.h"
|
#include "util/projection.h"
|
||||||
#include "util/util_transform.h"
|
#include "util/transform.h"
|
||||||
#include "util/util_xml.h"
|
#include "util/xml.h"
|
||||||
|
|
||||||
#include "app/cycles_xml.h"
|
#include "app/cycles_xml.h"
|
||||||
|
|
||||||
@@ -333,6 +333,7 @@ static void xml_read_shader_graph(XMLReadState &state, Shader *shader, xml_node
|
|||||||
}
|
}
|
||||||
|
|
||||||
snode = (ShaderNode *)node_type->create(node_type);
|
snode = (ShaderNode *)node_type->create(node_type);
|
||||||
|
snode->set_owner(graph);
|
||||||
}
|
}
|
||||||
|
|
||||||
xml_read_node(graph_reader, snode, node);
|
xml_read_node(graph_reader, snode, node);
|
||||||
|
71
intern/cycles/app/oiio_output_driver.cpp
Normal file
71
intern/cycles/app/oiio_output_driver.cpp
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Blender Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "app/oiio_output_driver.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
OIIOOutputDriver::OIIOOutputDriver(const string_view filepath,
|
||||||
|
const string_view pass,
|
||||||
|
LogFunction log)
|
||||||
|
: filepath_(filepath), pass_(pass), log_(log)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
OIIOOutputDriver::~OIIOOutputDriver()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void OIIOOutputDriver::write_render_tile(const Tile &tile)
|
||||||
|
{
|
||||||
|
/* Only write the full buffer, no intermediate tiles. */
|
||||||
|
if (!(tile.size == tile.full_size)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
log_(string_printf("Writing image %s", filepath_.c_str()));
|
||||||
|
|
||||||
|
unique_ptr<ImageOutput> image_output(ImageOutput::create(filepath_));
|
||||||
|
if (image_output == nullptr) {
|
||||||
|
log_("Failed to create image file");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int width = tile.size.x;
|
||||||
|
const int height = tile.size.y;
|
||||||
|
|
||||||
|
ImageSpec spec(width, height, 4, TypeDesc::FLOAT);
|
||||||
|
if (!image_output->open(filepath_, spec)) {
|
||||||
|
log_("Failed to create image file");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<float> pixels(width * height * 4);
|
||||||
|
if (!tile.get_pass_pixels(pass_, 4, pixels.data())) {
|
||||||
|
log_("Failed to read render pass pixels");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Manipulate offset and stride to convert from bottom-up to top-down convention. */
|
||||||
|
image_output->write_image(TypeDesc::FLOAT,
|
||||||
|
pixels.data() + (height - 1) * width * 4,
|
||||||
|
AutoStride,
|
||||||
|
-width * 4 * sizeof(float),
|
||||||
|
AutoStride);
|
||||||
|
image_output->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
42
intern/cycles/app/oiio_output_driver.h
Normal file
42
intern/cycles/app/oiio_output_driver.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Blender Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "session/output_driver.h"
|
||||||
|
|
||||||
|
#include "util/function.h"
|
||||||
|
#include "util/image.h"
|
||||||
|
#include "util/string.h"
|
||||||
|
#include "util/unique_ptr.h"
|
||||||
|
#include "util/vector.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
class OIIOOutputDriver : public OutputDriver {
|
||||||
|
public:
|
||||||
|
typedef function<void(const string &)> LogFunction;
|
||||||
|
|
||||||
|
OIIOOutputDriver(const string_view filepath, const string_view pass, LogFunction log);
|
||||||
|
virtual ~OIIOOutputDriver();
|
||||||
|
|
||||||
|
void write_render_tile(const Tile &tile) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
string filepath_;
|
||||||
|
string pass_;
|
||||||
|
LogFunction log_;
|
||||||
|
};
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
@@ -29,37 +29,39 @@ set(INC_SYS
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(SRC
|
set(SRC
|
||||||
blender_camera.cpp
|
camera.cpp
|
||||||
blender_device.cpp
|
device.cpp
|
||||||
blender_image.cpp
|
display_driver.cpp
|
||||||
blender_geometry.cpp
|
image.cpp
|
||||||
blender_gpu_display.cpp
|
geometry.cpp
|
||||||
blender_light.cpp
|
light.cpp
|
||||||
blender_mesh.cpp
|
mesh.cpp
|
||||||
blender_object.cpp
|
object.cpp
|
||||||
blender_object_cull.cpp
|
object_cull.cpp
|
||||||
blender_particles.cpp
|
output_driver.cpp
|
||||||
blender_curves.cpp
|
particles.cpp
|
||||||
blender_logging.cpp
|
curves.cpp
|
||||||
blender_python.cpp
|
logging.cpp
|
||||||
blender_session.cpp
|
python.cpp
|
||||||
blender_shader.cpp
|
session.cpp
|
||||||
blender_sync.cpp
|
shader.cpp
|
||||||
blender_texture.cpp
|
sync.cpp
|
||||||
blender_viewport.cpp
|
texture.cpp
|
||||||
blender_volume.cpp
|
viewport.cpp
|
||||||
|
volume.cpp
|
||||||
|
|
||||||
CCL_api.h
|
CCL_api.h
|
||||||
blender_device.h
|
device.h
|
||||||
blender_gpu_display.h
|
display_driver.h
|
||||||
blender_id_map.h
|
id_map.h
|
||||||
blender_image.h
|
image.h
|
||||||
blender_object_cull.h
|
object_cull.h
|
||||||
blender_sync.h
|
output_driver.h
|
||||||
blender_session.h
|
sync.h
|
||||||
blender_texture.h
|
session.h
|
||||||
blender_util.h
|
texture.h
|
||||||
blender_viewport.h
|
util.h
|
||||||
|
viewport.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIB
|
set(LIB
|
||||||
@@ -67,7 +69,8 @@ set(LIB
|
|||||||
cycles_device
|
cycles_device
|
||||||
cycles_graph
|
cycles_graph
|
||||||
cycles_kernel
|
cycles_kernel
|
||||||
cycles_render
|
cycles_scene
|
||||||
|
cycles_session
|
||||||
cycles_subd
|
cycles_subd
|
||||||
cycles_util
|
cycles_util
|
||||||
|
|
||||||
@@ -95,6 +98,9 @@ set(ADDON_FILES
|
|||||||
|
|
||||||
add_definitions(${GL_DEFINITIONS})
|
add_definitions(${GL_DEFINITIONS})
|
||||||
|
|
||||||
|
if(WITH_CYCLES_DEVICE_HIP)
|
||||||
|
add_definitions(-DWITH_HIP)
|
||||||
|
endif()
|
||||||
if(WITH_MOD_FLUID)
|
if(WITH_MOD_FLUID)
|
||||||
add_definitions(-DWITH_FLUID)
|
add_definitions(-DWITH_FLUID)
|
||||||
endif()
|
endif()
|
||||||
@@ -132,11 +138,6 @@ endif()
|
|||||||
|
|
||||||
blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||||
|
|
||||||
# avoid link failure with clang 3.4 debug
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
|
|
||||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -gline-tables-only")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_dependencies(bf_intern_cycles bf_rna)
|
add_dependencies(bf_intern_cycles bf_rna)
|
||||||
|
|
||||||
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH})
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH})
|
||||||
|
@@ -28,7 +28,7 @@ def _configure_argument_parser():
|
|||||||
action='store_true')
|
action='store_true')
|
||||||
parser.add_argument("--cycles-device",
|
parser.add_argument("--cycles-device",
|
||||||
help="Set the device to use for Cycles, overriding user preferences and the scene setting."
|
help="Set the device to use for Cycles, overriding user preferences and the scene setting."
|
||||||
"Valid options are 'CPU', 'CUDA' or 'OPTIX'."
|
"Valid options are 'CPU', 'CUDA', 'OPTIX', or 'HIP'"
|
||||||
"Additionally, you can append '+CPU' to any GPU type for hybrid rendering.",
|
"Additionally, you can append '+CPU' to any GPU type for hybrid rendering.",
|
||||||
default=None)
|
default=None)
|
||||||
return parser
|
return parser
|
||||||
@@ -211,7 +211,6 @@ def list_render_passes(scene, srl):
|
|||||||
if crl.use_pass_shadow_catcher: yield ("Shadow Catcher", "RGB", 'COLOR')
|
if crl.use_pass_shadow_catcher: yield ("Shadow Catcher", "RGB", 'COLOR')
|
||||||
|
|
||||||
# Debug passes.
|
# Debug passes.
|
||||||
if crl.pass_debug_render_time: yield ("Debug Render Time", "X", 'VALUE')
|
|
||||||
if crl.pass_debug_sample_count: yield ("Debug Sample Count", "X", 'VALUE')
|
if crl.pass_debug_sample_count: yield ("Debug Sample Count", "X", 'VALUE')
|
||||||
|
|
||||||
# Cryptomatte passes.
|
# Cryptomatte passes.
|
||||||
@@ -234,6 +233,7 @@ def list_render_passes(scene, srl):
|
|||||||
if crl.denoising_store_passes:
|
if crl.denoising_store_passes:
|
||||||
yield ("Denoising Normal", "XYZ", 'VECTOR')
|
yield ("Denoising Normal", "XYZ", 'VECTOR')
|
||||||
yield ("Denoising Albedo", "RGB", 'COLOR')
|
yield ("Denoising Albedo", "RGB", 'COLOR')
|
||||||
|
yield ("Denoising Depth", "Z", 'VALUE')
|
||||||
|
|
||||||
# Custom AOV passes.
|
# Custom AOV passes.
|
||||||
for aov in srl.aovs:
|
for aov in srl.aovs:
|
||||||
|
@@ -40,10 +40,10 @@ class AddPresetIntegrator(AddPresetBase, Operator):
|
|||||||
"cycles.transparent_max_bounces",
|
"cycles.transparent_max_bounces",
|
||||||
"cycles.caustics_reflective",
|
"cycles.caustics_reflective",
|
||||||
"cycles.caustics_refractive",
|
"cycles.caustics_refractive",
|
||||||
"cycles.blur_glossy"
|
"cycles.blur_glossy",
|
||||||
"cycles.use_fast_gi"
|
"cycles.use_fast_gi",
|
||||||
"cycles.ao_bounces"
|
"cycles.ao_bounces",
|
||||||
"cycles.ao_bounces_render"
|
"cycles.ao_bounces_render",
|
||||||
]
|
]
|
||||||
|
|
||||||
preset_subdir = "cycles/integrator"
|
preset_subdir = "cycles/integrator"
|
||||||
|
@@ -86,8 +86,8 @@ enum_use_layer_samples = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
enum_sampling_pattern = (
|
enum_sampling_pattern = (
|
||||||
('SOBOL', "Sobol", "Use Sobol random sampling pattern"),
|
('SOBOL', "Sobol", "Use Sobol random sampling pattern", 0),
|
||||||
('PROGRESSIVE_MUTI_JITTER', "Progressive Multi-Jitter", "Use Progressive Multi-Jitter random sampling pattern"),
|
('PROGRESSIVE_MULTI_JITTER', "Progressive Multi-Jitter", "Use Progressive Multi-Jitter random sampling pattern", 1),
|
||||||
)
|
)
|
||||||
|
|
||||||
enum_volume_sampling = (
|
enum_volume_sampling = (
|
||||||
@@ -111,6 +111,7 @@ enum_device_type = (
|
|||||||
('CPU', "CPU", "CPU", 0),
|
('CPU', "CPU", "CPU", 0),
|
||||||
('CUDA', "CUDA", "CUDA", 1),
|
('CUDA', "CUDA", "CUDA", 1),
|
||||||
('OPTIX', "OptiX", "OptiX", 3),
|
('OPTIX', "OptiX", "OptiX", 3),
|
||||||
|
("HIP", "HIP", "HIP", 4)
|
||||||
)
|
)
|
||||||
|
|
||||||
enum_texture_limit = (
|
enum_texture_limit = (
|
||||||
@@ -123,7 +124,12 @@ enum_texture_limit = (
|
|||||||
('4096', "4096", "Limit texture size to 4096 pixels", 6),
|
('4096', "4096", "Limit texture size to 4096 pixels", 6),
|
||||||
('8192', "8192", "Limit texture size to 8192 pixels", 7),
|
('8192', "8192", "Limit texture size to 8192 pixels", 7),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
enum_fast_gi_method = (
|
||||||
|
('REPLACE', "Replace", "Replace global illumination with ambient occlusion after a specified number of bounces"),
|
||||||
|
('ADD', "Add", "Add ambient occlusion to diffuse surfaces"),
|
||||||
|
)
|
||||||
|
|
||||||
# NOTE: Identifiers are expected to be an upper case version of identifiers from `Pass::get_type_enum()`
|
# NOTE: Identifiers are expected to be an upper case version of identifiers from `Pass::get_type_enum()`
|
||||||
enum_view3d_shading_render_pass = (
|
enum_view3d_shading_render_pass = (
|
||||||
('', "General", ""),
|
('', "General", ""),
|
||||||
@@ -331,9 +337,27 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
|
|
||||||
sampling_pattern: EnumProperty(
|
sampling_pattern: EnumProperty(
|
||||||
name="Sampling Pattern",
|
name="Sampling Pattern",
|
||||||
description="Random sampling pattern used by the integrator",
|
description="Random sampling pattern used by the integrator. When adaptive sampling is enabled, Progressive Multi-Jitter is always used instead of Sobol",
|
||||||
items=enum_sampling_pattern,
|
items=enum_sampling_pattern,
|
||||||
default='PROGRESSIVE_MUTI_JITTER',
|
default='PROGRESSIVE_MULTI_JITTER',
|
||||||
|
)
|
||||||
|
|
||||||
|
scrambling_distance: FloatProperty(
|
||||||
|
name="Scrambling Distance",
|
||||||
|
default=1.0,
|
||||||
|
min=0.0, max=1.0,
|
||||||
|
description="Lower values give faster rendering with GPU rendering and less noise with all devices at the cost of possible artifacts if set too low. Only works when not using adaptive sampling",
|
||||||
|
)
|
||||||
|
preview_scrambling_distance: BoolProperty(
|
||||||
|
name="Scrambling Distance viewport",
|
||||||
|
default=False,
|
||||||
|
description="Uses the Scrambling Distance value for the viewport. Faster but may flicker",
|
||||||
|
)
|
||||||
|
|
||||||
|
adaptive_scrambling_distance: BoolProperty(
|
||||||
|
name="Adaptive Scrambling Distance",
|
||||||
|
default=False,
|
||||||
|
description="Uses a formula to adapt the scrambling distance strength based on the sample count",
|
||||||
)
|
)
|
||||||
|
|
||||||
use_layer_samples: EnumProperty(
|
use_layer_samples: EnumProperty(
|
||||||
@@ -723,6 +747,14 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
description="Approximate diffuse indirect light with background tinted ambient occlusion. This provides fast alternative to full global illumination, for interactive viewport rendering or final renders with reduced quality",
|
description="Approximate diffuse indirect light with background tinted ambient occlusion. This provides fast alternative to full global illumination, for interactive viewport rendering or final renders with reduced quality",
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fast_gi_method: EnumProperty(
|
||||||
|
name="Fast GI Method",
|
||||||
|
default='REPLACE',
|
||||||
|
description="Fast GI approximation method",
|
||||||
|
items=enum_fast_gi_method
|
||||||
|
)
|
||||||
|
|
||||||
ao_bounces: IntProperty(
|
ao_bounces: IntProperty(
|
||||||
name="AO Bounces",
|
name="AO Bounces",
|
||||||
default=1,
|
default=1,
|
||||||
@@ -1196,12 +1228,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
|||||||
|
|
||||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||||
|
|
||||||
pass_debug_render_time: BoolProperty(
|
|
||||||
name="Debug Render Time",
|
|
||||||
description="Render time in milliseconds per sample and pixel",
|
|
||||||
default=False,
|
|
||||||
update=update_render_passes,
|
|
||||||
)
|
|
||||||
pass_debug_sample_count: BoolProperty(
|
pass_debug_sample_count: BoolProperty(
|
||||||
name="Debug Sample Count",
|
name="Debug Sample Count",
|
||||||
description="Number of samples/camera rays per pixel",
|
description="Number of samples/camera rays per pixel",
|
||||||
@@ -1266,12 +1292,16 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
|
|
||||||
def get_device_types(self, context):
|
def get_device_types(self, context):
|
||||||
import _cycles
|
import _cycles
|
||||||
has_cuda, has_optix = _cycles.get_device_types()
|
has_cuda, has_optix, has_hip = _cycles.get_device_types()
|
||||||
|
|
||||||
list = [('NONE', "None", "Don't use compute device", 0)]
|
list = [('NONE', "None", "Don't use compute device", 0)]
|
||||||
if has_cuda:
|
if has_cuda:
|
||||||
list.append(('CUDA', "CUDA", "Use CUDA for GPU acceleration", 1))
|
list.append(('CUDA', "CUDA", "Use CUDA for GPU acceleration", 1))
|
||||||
if has_optix:
|
if has_optix:
|
||||||
list.append(('OPTIX', "OptiX", "Use OptiX for GPU acceleration", 3))
|
list.append(('OPTIX', "OptiX", "Use OptiX for GPU acceleration", 3))
|
||||||
|
if has_hip:
|
||||||
|
list.append(('HIP', "HIP", "Use HIP for GPU acceleration", 4))
|
||||||
|
|
||||||
return list
|
return list
|
||||||
|
|
||||||
compute_device_type: EnumProperty(
|
compute_device_type: EnumProperty(
|
||||||
@@ -1296,7 +1326,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
|
|
||||||
def update_device_entries(self, device_list):
|
def update_device_entries(self, device_list):
|
||||||
for device in device_list:
|
for device in device_list:
|
||||||
if not device[1] in {'CUDA', 'OPTIX', 'CPU'}:
|
if not device[1] in {'CUDA', 'OPTIX', 'CPU', 'HIP'}:
|
||||||
continue
|
continue
|
||||||
# Try to find existing Device entry
|
# Try to find existing Device entry
|
||||||
entry = self.find_existing_device_entry(device)
|
entry = self.find_existing_device_entry(device)
|
||||||
@@ -1330,7 +1360,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
elif entry.type == 'CPU':
|
elif entry.type == 'CPU':
|
||||||
cpu_devices.append(entry)
|
cpu_devices.append(entry)
|
||||||
# Extend all GPU devices with CPU.
|
# Extend all GPU devices with CPU.
|
||||||
if compute_device_type != 'CPU':
|
if len(devices) and compute_device_type != 'CPU':
|
||||||
devices.extend(cpu_devices)
|
devices.extend(cpu_devices)
|
||||||
return devices
|
return devices
|
||||||
|
|
||||||
@@ -1340,7 +1370,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
import _cycles
|
import _cycles
|
||||||
# Ensure `self.devices` is not re-allocated when the second call to
|
# Ensure `self.devices` is not re-allocated when the second call to
|
||||||
# get_devices_for_type is made, freeing items from the first list.
|
# get_devices_for_type is made, freeing items from the first list.
|
||||||
for device_type in ('CUDA', 'OPTIX', 'OPENCL'):
|
for device_type in ('CUDA', 'OPTIX', 'HIP'):
|
||||||
self.update_device_entries(_cycles.available_devices(device_type))
|
self.update_device_entries(_cycles.available_devices(device_type))
|
||||||
|
|
||||||
# Deprecated: use refresh_devices instead.
|
# Deprecated: use refresh_devices instead.
|
||||||
@@ -1348,12 +1378,18 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
self.refresh_devices()
|
self.refresh_devices()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def get_compute_device_type(self):
|
||||||
|
if self.compute_device_type == '':
|
||||||
|
return 'NONE'
|
||||||
|
return self.compute_device_type
|
||||||
|
|
||||||
def get_num_gpu_devices(self):
|
def get_num_gpu_devices(self):
|
||||||
import _cycles
|
import _cycles
|
||||||
device_list = _cycles.available_devices(self.compute_device_type)
|
compute_device_type = self.get_compute_device_type()
|
||||||
|
device_list = _cycles.available_devices(compute_device_type)
|
||||||
num = 0
|
num = 0
|
||||||
for device in device_list:
|
for device in device_list:
|
||||||
if device[1] != self.compute_device_type:
|
if device[1] != compute_device_type:
|
||||||
continue
|
continue
|
||||||
for dev in self.devices:
|
for dev in self.devices:
|
||||||
if dev.use and dev.id == device[2]:
|
if dev.use and dev.id == device[2]:
|
||||||
@@ -1374,8 +1410,18 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
|
|
||||||
if not found_device:
|
if not found_device:
|
||||||
col = box.column(align=True)
|
col = box.column(align=True)
|
||||||
col.label(text="No compatible GPUs found for path tracing", icon='INFO')
|
col.label(text="No compatible GPUs found for Cycles", icon='INFO')
|
||||||
col.label(text="Cycles will render on the CPU", icon='BLANK1')
|
|
||||||
|
if device_type == 'CUDA':
|
||||||
|
col.label(text="Requires NVIDIA GPU with compute capability 3.0", icon='BLANK1')
|
||||||
|
elif device_type == 'OPTIX':
|
||||||
|
col.label(text="Requires NVIDIA GPU with compute capability 5.0", icon='BLANK1')
|
||||||
|
col.label(text="and NVIDIA driver version 470 or newer", icon='BLANK1')
|
||||||
|
elif device_type == 'HIP':
|
||||||
|
import sys
|
||||||
|
col.label(text="Requires discrete AMD GPU with RDNA architecture", icon='BLANK1')
|
||||||
|
if sys.platform[:3] == "win":
|
||||||
|
col.label(text="and AMD Radeon Pro 21.Q4 driver or newer", icon='BLANK1')
|
||||||
return
|
return
|
||||||
|
|
||||||
for device in devices:
|
for device in devices:
|
||||||
@@ -1385,15 +1431,16 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(self, "compute_device_type", expand=True)
|
row.prop(self, "compute_device_type", expand=True)
|
||||||
|
|
||||||
if self.compute_device_type == 'NONE':
|
compute_device_type = self.get_compute_device_type()
|
||||||
|
if compute_device_type == 'NONE':
|
||||||
return
|
return
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
devices = self.get_devices_for_type(self.compute_device_type)
|
devices = self.get_devices_for_type(compute_device_type)
|
||||||
self._draw_devices(row, self.compute_device_type, devices)
|
self._draw_devices(row, compute_device_type, devices)
|
||||||
|
|
||||||
import _cycles
|
import _cycles
|
||||||
has_peer_memory = 0
|
has_peer_memory = 0
|
||||||
for device in _cycles.available_devices(self.compute_device_type):
|
for device in _cycles.available_devices(compute_device_type):
|
||||||
if device[3] and self.find_existing_device_entry(device).use:
|
if device[3] and self.find_existing_device_entry(device).use:
|
||||||
has_peer_memory += 1
|
has_peer_memory += 1
|
||||||
if has_peer_memory > 1:
|
if has_peer_memory > 1:
|
||||||
|
@@ -26,27 +26,31 @@ from bpy.types import Panel
|
|||||||
from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
|
from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
|
||||||
from bl_ui.properties_view_layer import ViewLayerCryptomattePanel, ViewLayerAOVPanel
|
from bl_ui.properties_view_layer import ViewLayerCryptomattePanel, ViewLayerAOVPanel
|
||||||
|
|
||||||
|
class CyclesPresetPanel(PresetPanel, Panel):
|
||||||
|
COMPAT_ENGINES = {'CYCLES'}
|
||||||
|
preset_operator = "script.execute_preset"
|
||||||
|
|
||||||
class CYCLES_PT_sampling_presets(PresetPanel, Panel):
|
@staticmethod
|
||||||
|
def post_cb(context):
|
||||||
|
# Modify an arbitrary built-in scene property to force a depsgraph
|
||||||
|
# update, because add-on properties don't. (see T62325)
|
||||||
|
render = context.scene.render
|
||||||
|
render.filter_size = render.filter_size
|
||||||
|
|
||||||
|
class CYCLES_PT_sampling_presets(CyclesPresetPanel):
|
||||||
bl_label = "Sampling Presets"
|
bl_label = "Sampling Presets"
|
||||||
preset_subdir = "cycles/sampling"
|
preset_subdir = "cycles/sampling"
|
||||||
preset_operator = "script.execute_preset"
|
|
||||||
preset_add_operator = "render.cycles_sampling_preset_add"
|
preset_add_operator = "render.cycles_sampling_preset_add"
|
||||||
COMPAT_ENGINES = {'CYCLES'}
|
|
||||||
|
|
||||||
class CYCLES_PT_viewport_sampling_presets(PresetPanel, Panel):
|
class CYCLES_PT_viewport_sampling_presets(CyclesPresetPanel):
|
||||||
bl_label = "Viewport Sampling Presets"
|
bl_label = "Viewport Sampling Presets"
|
||||||
preset_subdir = "cycles/viewport_sampling"
|
preset_subdir = "cycles/viewport_sampling"
|
||||||
preset_operator = "script.execute_preset"
|
|
||||||
preset_add_operator = "render.cycles_viewport_sampling_preset_add"
|
preset_add_operator = "render.cycles_viewport_sampling_preset_add"
|
||||||
COMPAT_ENGINES = {'CYCLES'}
|
|
||||||
|
|
||||||
class CYCLES_PT_integrator_presets(PresetPanel, Panel):
|
class CYCLES_PT_integrator_presets(CyclesPresetPanel):
|
||||||
bl_label = "Integrator Presets"
|
bl_label = "Integrator Presets"
|
||||||
preset_subdir = "cycles/integrator"
|
preset_subdir = "cycles/integrator"
|
||||||
preset_operator = "script.execute_preset"
|
|
||||||
preset_add_operator = "render.cycles_integrator_preset_add"
|
preset_add_operator = "render.cycles_integrator_preset_add"
|
||||||
COMPAT_ENGINES = {'CYCLES'}
|
|
||||||
|
|
||||||
|
|
||||||
class CyclesButtonsPanel:
|
class CyclesButtonsPanel:
|
||||||
@@ -99,6 +103,11 @@ def use_cuda(context):
|
|||||||
return (get_device_type(context) == 'CUDA' and cscene.device == 'GPU')
|
return (get_device_type(context) == 'CUDA' and cscene.device == 'GPU')
|
||||||
|
|
||||||
|
|
||||||
|
def use_hip(context):
|
||||||
|
cscene = context.scene.cycles
|
||||||
|
|
||||||
|
return (get_device_type(context) == 'HIP' and cscene.device == 'GPU')
|
||||||
|
|
||||||
def use_optix(context):
|
def use_optix(context):
|
||||||
cscene = context.scene.cycles
|
cscene = context.scene.cycles
|
||||||
|
|
||||||
@@ -278,11 +287,21 @@ class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
|
|||||||
row.prop(cscene, "use_animated_seed", text="", icon='TIME')
|
row.prop(cscene, "use_animated_seed", text="", icon='TIME')
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
col.active = not(cscene.use_adaptive_sampling)
|
col.active = not (cscene.use_adaptive_sampling and cscene.use_preview_adaptive_sampling)
|
||||||
col.prop(cscene, "sampling_pattern", text="Pattern")
|
col.prop(cscene, "sampling_pattern", text="Pattern")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
col = layout.column(align=True)
|
||||||
|
col.active = not (cscene.use_adaptive_sampling and cscene.use_preview_adaptive_sampling)
|
||||||
|
col.prop(cscene, "scrambling_distance", text="Scrambling Distance")
|
||||||
|
col.prop(cscene, "adaptive_scrambling_distance", text="Adaptive")
|
||||||
|
sub = col.row(align=True)
|
||||||
|
sub.active = not cscene.use_preview_adaptive_sampling
|
||||||
|
sub.prop(cscene, "preview_scrambling_distance", text="Viewport")
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
col.prop(cscene, "min_light_bounces")
|
col.prop(cscene, "min_light_bounces")
|
||||||
col.prop(cscene, "min_transparent_bounces")
|
col.prop(cscene, "min_transparent_bounces")
|
||||||
@@ -456,8 +475,7 @@ class CYCLES_RENDER_PT_light_paths_fast_gi(CyclesButtonsPanel, Panel):
|
|||||||
layout.active = cscene.use_fast_gi
|
layout.active = cscene.use_fast_gi
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
col.prop(cscene, "ao_bounces", text="Viewport Bounces")
|
col.prop(cscene, "fast_gi_method", text="Method")
|
||||||
col.prop(cscene, "ao_bounces_render", text="Render Bounces")
|
|
||||||
|
|
||||||
if world:
|
if world:
|
||||||
light = world.light_settings
|
light = world.light_settings
|
||||||
@@ -465,6 +483,11 @@ class CYCLES_RENDER_PT_light_paths_fast_gi(CyclesButtonsPanel, Panel):
|
|||||||
col.prop(light, "ao_factor", text="AO Factor")
|
col.prop(light, "ao_factor", text="AO Factor")
|
||||||
col.prop(light, "distance", text="AO Distance")
|
col.prop(light, "distance", text="AO Distance")
|
||||||
|
|
||||||
|
if cscene.fast_gi_method == 'REPLACE':
|
||||||
|
col = layout.column(align=True)
|
||||||
|
col.prop(cscene, "ao_bounces", text="Viewport Bounces")
|
||||||
|
col.prop(cscene, "ao_bounces_render", text="Render Bounces")
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||||
bl_label = "Motion Blur"
|
bl_label = "Motion Blur"
|
||||||
@@ -787,7 +810,6 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, Panel):
|
|||||||
col.prop(view_layer, "use_pass_material_index")
|
col.prop(view_layer, "use_pass_material_index")
|
||||||
|
|
||||||
col = layout.column(heading="Debug", align=True)
|
col = layout.column(heading="Debug", align=True)
|
||||||
col.prop(cycles_view_layer, "pass_debug_render_time", text="Render Time")
|
|
||||||
col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample Count")
|
col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample Count")
|
||||||
|
|
||||||
layout.prop(view_layer, "pass_alpha_threshold")
|
layout.prop(view_layer, "pass_alpha_threshold")
|
||||||
@@ -977,8 +999,8 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
|
|||||||
row.prop(slot, "link", text="", icon=icon_link, icon_only=True)
|
row.prop(slot, "link", text="", icon=icon_link, icon_only=True)
|
||||||
|
|
||||||
elif mat:
|
elif mat:
|
||||||
split.template_ID(space, "pin_id")
|
layout.template_ID(space, "pin_id")
|
||||||
split.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
|
class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||||
|
@@ -86,7 +86,7 @@ def do_versions(self):
|
|||||||
# Device might not currently be available so this can fail
|
# Device might not currently be available so this can fail
|
||||||
try:
|
try:
|
||||||
if system.legacy_compute_device_type == 1:
|
if system.legacy_compute_device_type == 1:
|
||||||
prop.compute_device_type = 'OPENCL'
|
prop.compute_device_type = 'NONE' # Was OpenCL
|
||||||
elif system.legacy_compute_device_type == 2:
|
elif system.legacy_compute_device_type == 2:
|
||||||
prop.compute_device_type = 'CUDA'
|
prop.compute_device_type = 'CUDA'
|
||||||
else:
|
else:
|
||||||
@@ -97,6 +97,12 @@ def do_versions(self):
|
|||||||
# Init device list for UI
|
# Init device list for UI
|
||||||
prop.get_devices(prop.compute_device_type)
|
prop.get_devices(prop.compute_device_type)
|
||||||
|
|
||||||
|
if bpy.context.preferences.version <= (3, 0, 40):
|
||||||
|
# Disable OpenCL device
|
||||||
|
prop = bpy.context.preferences.addons[__package__].preferences
|
||||||
|
if prop.is_property_set("compute_device_type") and prop['compute_device_type'] == 4:
|
||||||
|
prop.compute_device_type = 'NONE'
|
||||||
|
|
||||||
# We don't modify startup file because it assumes to
|
# We don't modify startup file because it assumes to
|
||||||
# have all the default values only.
|
# have all the default values only.
|
||||||
if not bpy.data.is_saved:
|
if not bpy.data.is_saved:
|
||||||
@@ -235,8 +241,9 @@ def do_versions(self):
|
|||||||
cscene.use_denoising = False
|
cscene.use_denoising = False
|
||||||
if not cscene.is_property_set("use_preview_denoising"):
|
if not cscene.is_property_set("use_preview_denoising"):
|
||||||
cscene.use_preview_denoising = False
|
cscene.use_preview_denoising = False
|
||||||
if not cscene.is_property_set("sampling_pattern"):
|
if not cscene.is_property_set("sampling_pattern") or \
|
||||||
cscene.sampling_pattern = 'PROGRESSIVE_MUTI_JITTER'
|
cscene.get('sampling_pattern') >= 2:
|
||||||
|
cscene.sampling_pattern = 'PROGRESSIVE_MULTI_JITTER'
|
||||||
|
|
||||||
# Removal of square samples.
|
# Removal of square samples.
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
|
@@ -14,13 +14,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/camera.h"
|
#include "scene/camera.h"
|
||||||
#include "render/scene.h"
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -80,8 +80,9 @@ struct BlenderCamera {
|
|||||||
int render_height;
|
int render_height;
|
||||||
|
|
||||||
BoundBox2D border;
|
BoundBox2D border;
|
||||||
BoundBox2D pano_viewplane;
|
|
||||||
BoundBox2D viewport_camera_border;
|
BoundBox2D viewport_camera_border;
|
||||||
|
BoundBox2D pano_viewplane;
|
||||||
|
float pano_aspectratio;
|
||||||
|
|
||||||
float passepartout_alpha;
|
float passepartout_alpha;
|
||||||
|
|
||||||
@@ -123,10 +124,11 @@ static void blender_camera_init(BlenderCamera *bcam, BL::RenderSettings &b_rende
|
|||||||
bcam->motion_position = Camera::MOTION_POSITION_CENTER;
|
bcam->motion_position = Camera::MOTION_POSITION_CENTER;
|
||||||
bcam->border.right = 1.0f;
|
bcam->border.right = 1.0f;
|
||||||
bcam->border.top = 1.0f;
|
bcam->border.top = 1.0f;
|
||||||
bcam->pano_viewplane.right = 1.0f;
|
|
||||||
bcam->pano_viewplane.top = 1.0f;
|
|
||||||
bcam->viewport_camera_border.right = 1.0f;
|
bcam->viewport_camera_border.right = 1.0f;
|
||||||
bcam->viewport_camera_border.top = 1.0f;
|
bcam->viewport_camera_border.top = 1.0f;
|
||||||
|
bcam->pano_viewplane.right = 1.0f;
|
||||||
|
bcam->pano_viewplane.top = 1.0f;
|
||||||
|
bcam->pano_aspectratio = 0.0f;
|
||||||
bcam->passepartout_alpha = 0.5f;
|
bcam->passepartout_alpha = 0.5f;
|
||||||
bcam->offscreen_dicing_scale = 1.0f;
|
bcam->offscreen_dicing_scale = 1.0f;
|
||||||
bcam->matrix = transform_identity();
|
bcam->matrix = transform_identity();
|
||||||
@@ -358,9 +360,21 @@ static void blender_camera_viewplane(BlenderCamera *bcam,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bcam->type == CAMERA_PANORAMA) {
|
if (bcam->type == CAMERA_PANORAMA) {
|
||||||
/* set viewplane */
|
/* Set viewplane for panoramic camera. */
|
||||||
if (viewplane != NULL) {
|
if (viewplane != NULL) {
|
||||||
*viewplane = bcam->pano_viewplane;
|
*viewplane = bcam->pano_viewplane;
|
||||||
|
|
||||||
|
/* Modify viewplane for camera shift. */
|
||||||
|
const float shift_factor = (bcam->pano_aspectratio == 0.0f) ?
|
||||||
|
1.0f :
|
||||||
|
*aspectratio / bcam->pano_aspectratio;
|
||||||
|
const float dx = bcam->shift.x * shift_factor;
|
||||||
|
const float dy = bcam->shift.y * shift_factor;
|
||||||
|
|
||||||
|
viewplane->left += dx;
|
||||||
|
viewplane->right += dx;
|
||||||
|
viewplane->bottom += dy;
|
||||||
|
viewplane->top += dy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -375,8 +389,8 @@ static void blender_camera_viewplane(BlenderCamera *bcam,
|
|||||||
*viewplane = (*viewplane) * bcam->zoom;
|
*viewplane = (*viewplane) * bcam->zoom;
|
||||||
|
|
||||||
/* modify viewplane with camera shift and 3d camera view offset */
|
/* modify viewplane with camera shift and 3d camera view offset */
|
||||||
float dx = 2.0f * (*aspectratio * bcam->shift.x + bcam->offset.x * xaspect * 2.0f);
|
const float dx = 2.0f * (*aspectratio * bcam->shift.x + bcam->offset.x * xaspect * 2.0f);
|
||||||
float dy = 2.0f * (*aspectratio * bcam->shift.y + bcam->offset.y * yaspect * 2.0f);
|
const float dy = 2.0f * (*aspectratio * bcam->shift.y + bcam->offset.y * yaspect * 2.0f);
|
||||||
|
|
||||||
viewplane->left += dx;
|
viewplane->left += dx;
|
||||||
viewplane->right += dx;
|
viewplane->right += dx;
|
||||||
@@ -625,7 +639,7 @@ void BlenderSync::sync_camera_motion(
|
|||||||
/* TODO(sergey): De-duplicate calculation with camera sync. */
|
/* TODO(sergey): De-duplicate calculation with camera sync. */
|
||||||
float fov = 2.0f * atanf((0.5f * sensor_size) / bcam.lens / aspectratio);
|
float fov = 2.0f * atanf((0.5f * sensor_size) / bcam.lens / aspectratio);
|
||||||
if (fov != cam->get_fov()) {
|
if (fov != cam->get_fov()) {
|
||||||
VLOG(1) << "Camera " << b_ob.name() << " FOV change detected.";
|
VLOG(3) << "Camera " << b_ob.name() << " FOV change detected.";
|
||||||
if (motion_time == 0.0f) {
|
if (motion_time == 0.0f) {
|
||||||
cam->set_fov(fov);
|
cam->set_fov(fov);
|
||||||
}
|
}
|
||||||
@@ -652,7 +666,8 @@ static void blender_camera_view_subset(BL::RenderEngine &b_engine,
|
|||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
BoundBox2D *view_box,
|
BoundBox2D *view_box,
|
||||||
BoundBox2D *cam_box);
|
BoundBox2D *cam_box,
|
||||||
|
float *view_aspect);
|
||||||
|
|
||||||
static void blender_camera_from_view(BlenderCamera *bcam,
|
static void blender_camera_from_view(BlenderCamera *bcam,
|
||||||
BL::RenderEngine &b_engine,
|
BL::RenderEngine &b_engine,
|
||||||
@@ -682,6 +697,7 @@ static void blender_camera_from_view(BlenderCamera *bcam,
|
|||||||
if (!skip_panorama && bcam->type == CAMERA_PANORAMA) {
|
if (!skip_panorama && bcam->type == CAMERA_PANORAMA) {
|
||||||
/* in panorama camera view, we map viewplane to camera border */
|
/* in panorama camera view, we map viewplane to camera border */
|
||||||
BoundBox2D view_box, cam_box;
|
BoundBox2D view_box, cam_box;
|
||||||
|
float view_aspect;
|
||||||
|
|
||||||
BL::RenderSettings b_render_settings(b_scene.render());
|
BL::RenderSettings b_render_settings(b_scene.render());
|
||||||
blender_camera_view_subset(b_engine,
|
blender_camera_view_subset(b_engine,
|
||||||
@@ -693,9 +709,11 @@ static void blender_camera_from_view(BlenderCamera *bcam,
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
&view_box,
|
&view_box,
|
||||||
&cam_box);
|
&cam_box,
|
||||||
|
&view_aspect);
|
||||||
|
|
||||||
bcam->pano_viewplane = view_box.make_relative_to(cam_box);
|
bcam->pano_viewplane = view_box.make_relative_to(cam_box);
|
||||||
|
bcam->pano_aspectratio = view_aspect;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* magic zoom formula */
|
/* magic zoom formula */
|
||||||
@@ -743,17 +761,18 @@ static void blender_camera_view_subset(BL::RenderEngine &b_engine,
|
|||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
BoundBox2D *view_box,
|
BoundBox2D *view_box,
|
||||||
BoundBox2D *cam_box)
|
BoundBox2D *cam_box,
|
||||||
|
float *view_aspect)
|
||||||
{
|
{
|
||||||
BoundBox2D cam, view;
|
BoundBox2D cam, view;
|
||||||
float view_aspect, cam_aspect, sensor_size;
|
float cam_aspect, sensor_size;
|
||||||
|
|
||||||
/* Get viewport viewplane. */
|
/* Get viewport viewplane. */
|
||||||
BlenderCamera view_bcam;
|
BlenderCamera view_bcam;
|
||||||
blender_camera_init(&view_bcam, b_render);
|
blender_camera_init(&view_bcam, b_render);
|
||||||
blender_camera_from_view(&view_bcam, b_engine, b_scene, b_v3d, b_rv3d, width, height, true);
|
blender_camera_from_view(&view_bcam, b_engine, b_scene, b_v3d, b_rv3d, width, height, true);
|
||||||
|
|
||||||
blender_camera_viewplane(&view_bcam, width, height, &view, &view_aspect, &sensor_size);
|
blender_camera_viewplane(&view_bcam, width, height, &view, view_aspect, &sensor_size);
|
||||||
|
|
||||||
/* Get camera viewplane. */
|
/* Get camera viewplane. */
|
||||||
BlenderCamera cam_bcam;
|
BlenderCamera cam_bcam;
|
||||||
@@ -768,7 +787,7 @@ static void blender_camera_view_subset(BL::RenderEngine &b_engine,
|
|||||||
&cam_bcam, cam_bcam.full_width, cam_bcam.full_height, &cam, &cam_aspect, &sensor_size);
|
&cam_bcam, cam_bcam.full_width, cam_bcam.full_height, &cam, &cam_aspect, &sensor_size);
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
*view_box = view * (1.0f / view_aspect);
|
*view_box = view * (1.0f / *view_aspect);
|
||||||
*cam_box = cam * (1.0f / cam_aspect);
|
*cam_box = cam * (1.0f / cam_aspect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -785,8 +804,18 @@ static void blender_camera_border_subset(BL::RenderEngine &b_engine,
|
|||||||
{
|
{
|
||||||
/* Determine camera viewport subset. */
|
/* Determine camera viewport subset. */
|
||||||
BoundBox2D view_box, cam_box;
|
BoundBox2D view_box, cam_box;
|
||||||
blender_camera_view_subset(
|
float view_aspect;
|
||||||
b_engine, b_render, b_scene, b_ob, b_v3d, b_rv3d, width, height, &view_box, &cam_box);
|
blender_camera_view_subset(b_engine,
|
||||||
|
b_render,
|
||||||
|
b_scene,
|
||||||
|
b_ob,
|
||||||
|
b_v3d,
|
||||||
|
b_rv3d,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
&view_box,
|
||||||
|
&cam_box,
|
||||||
|
&view_aspect);
|
||||||
|
|
||||||
/* Determine viewport subset matching given border. */
|
/* Determine viewport subset matching given border. */
|
||||||
cam_box = cam_box.make_relative_to(view_box);
|
cam_box = cam_box.make_relative_to(view_box);
|
||||||
@@ -927,6 +956,9 @@ BufferParams BlenderSync::get_buffer_params(
|
|||||||
params.height = height;
|
params.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params.window_width = params.width;
|
||||||
|
params.window_height = params.height;
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
@@ -14,19 +14,20 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/attribute.h"
|
#include "blender/sync.h"
|
||||||
#include "render/camera.h"
|
#include "blender/util.h"
|
||||||
#include "render/curves.h"
|
|
||||||
#include "render/hair.h"
|
|
||||||
#include "render/object.h"
|
|
||||||
#include "render/scene.h"
|
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "scene/attribute.h"
|
||||||
#include "blender/blender_util.h"
|
#include "scene/camera.h"
|
||||||
|
#include "scene/curves.h"
|
||||||
|
#include "scene/hair.h"
|
||||||
|
#include "scene/object.h"
|
||||||
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/color.h"
|
||||||
#include "util/util_hash.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/hash.h"
|
||||||
|
#include "util/log.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -303,10 +304,6 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_curves > 0) {
|
|
||||||
VLOG(1) << "Exporting curve segments for mesh " << hair->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
hair->reserve_curves(hair->num_curves() + num_curves, hair->get_curve_keys().size() + num_keys);
|
hair->reserve_curves(hair->num_curves() + num_curves, hair->get_curve_keys().size() + num_keys);
|
||||||
|
|
||||||
num_keys = 0;
|
num_keys = 0;
|
||||||
@@ -355,7 +352,7 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa
|
|||||||
|
|
||||||
/* check allocation */
|
/* check allocation */
|
||||||
if ((hair->get_curve_keys().size() != num_keys) || (hair->num_curves() != num_curves)) {
|
if ((hair->get_curve_keys().size() != num_keys) || (hair->num_curves() != num_curves)) {
|
||||||
VLOG(1) << "Allocation failed, clearing data";
|
VLOG(1) << "Hair memory allocation failed, clearing data.";
|
||||||
hair->clear(true);
|
hair->clear(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,16 +408,11 @@ static void export_hair_motion_validate_attribute(Hair *hair,
|
|||||||
if (num_motion_keys != num_keys || !have_motion) {
|
if (num_motion_keys != num_keys || !have_motion) {
|
||||||
/* No motion or hair "topology" changed, remove attributes again. */
|
/* No motion or hair "topology" changed, remove attributes again. */
|
||||||
if (num_motion_keys != num_keys) {
|
if (num_motion_keys != num_keys) {
|
||||||
VLOG(1) << "Hair topology changed, removing attribute.";
|
VLOG(1) << "Hair topology changed, removing motion attribute.";
|
||||||
}
|
|
||||||
else {
|
|
||||||
VLOG(1) << "No motion, removing attribute.";
|
|
||||||
}
|
}
|
||||||
hair->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
|
hair->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
}
|
}
|
||||||
else if (motion_step > 0) {
|
else if (motion_step > 0) {
|
||||||
VLOG(1) << "Filling in new motion vertex position for motion_step " << motion_step;
|
|
||||||
|
|
||||||
/* Motion, fill up previous steps that we might have skipped because
|
/* Motion, fill up previous steps that we might have skipped because
|
||||||
* they had no motion, but we need them anyway now. */
|
* they had no motion, but we need them anyway now. */
|
||||||
for (int step = 0; step < motion_step; step++) {
|
for (int step = 0; step < motion_step; step++) {
|
||||||
@@ -436,16 +428,12 @@ static void export_hair_motion_validate_attribute(Hair *hair,
|
|||||||
|
|
||||||
static void ExportCurveSegmentsMotion(Hair *hair, ParticleCurveData *CData, int motion_step)
|
static void ExportCurveSegmentsMotion(Hair *hair, ParticleCurveData *CData, int motion_step)
|
||||||
{
|
{
|
||||||
VLOG(1) << "Exporting curve motion segments for hair " << hair->name << ", motion step "
|
|
||||||
<< motion_step;
|
|
||||||
|
|
||||||
/* find attribute */
|
/* find attribute */
|
||||||
Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
bool new_attribute = false;
|
bool new_attribute = false;
|
||||||
|
|
||||||
/* add new attribute if it doesn't exist already */
|
/* add new attribute if it doesn't exist already */
|
||||||
if (!attr_mP) {
|
if (!attr_mP) {
|
||||||
VLOG(1) << "Creating new motion vertex position attribute";
|
|
||||||
attr_mP = hair->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
attr_mP = hair->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
new_attribute = true;
|
new_attribute = true;
|
||||||
}
|
}
|
||||||
@@ -681,10 +669,6 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
|
|||||||
const int num_keys = b_hair.points.length();
|
const int num_keys = b_hair.points.length();
|
||||||
const int num_curves = b_hair.curves.length();
|
const int num_curves = b_hair.curves.length();
|
||||||
|
|
||||||
if (num_curves > 0) {
|
|
||||||
VLOG(1) << "Exporting curve segments for hair " << hair->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
hair->reserve_curves(num_curves, num_keys);
|
hair->reserve_curves(num_curves, num_keys);
|
||||||
|
|
||||||
/* Export curves and points. */
|
/* Export curves and points. */
|
||||||
@@ -742,15 +726,11 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
|
|||||||
|
|
||||||
static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_step)
|
static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_step)
|
||||||
{
|
{
|
||||||
VLOG(1) << "Exporting curve motion segments for hair " << hair->name << ", motion step "
|
|
||||||
<< motion_step;
|
|
||||||
|
|
||||||
/* Find or add attribute. */
|
/* Find or add attribute. */
|
||||||
Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
bool new_attribute = false;
|
bool new_attribute = false;
|
||||||
|
|
||||||
if (!attr_mP) {
|
if (!attr_mP) {
|
||||||
VLOG(1) << "Creating new motion vertex position attribute";
|
|
||||||
attr_mP = hair->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
attr_mP = hair->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
new_attribute = true;
|
new_attribute = true;
|
||||||
}
|
}
|
@@ -14,11 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blender/blender_device.h"
|
#include "blender/device.h"
|
||||||
#include "blender/blender_session.h"
|
#include "blender/session.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -26,6 +26,7 @@ enum ComputeDevice {
|
|||||||
COMPUTE_DEVICE_CPU = 0,
|
COMPUTE_DEVICE_CPU = 0,
|
||||||
COMPUTE_DEVICE_CUDA = 1,
|
COMPUTE_DEVICE_CUDA = 1,
|
||||||
COMPUTE_DEVICE_OPTIX = 3,
|
COMPUTE_DEVICE_OPTIX = 3,
|
||||||
|
COMPUTE_DEVICE_HIP = 4,
|
||||||
|
|
||||||
COMPUTE_DEVICE_NUM
|
COMPUTE_DEVICE_NUM
|
||||||
};
|
};
|
||||||
@@ -81,6 +82,9 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scen
|
|||||||
else if (compute_device == COMPUTE_DEVICE_OPTIX) {
|
else if (compute_device == COMPUTE_DEVICE_OPTIX) {
|
||||||
mask |= DEVICE_MASK_OPTIX;
|
mask |= DEVICE_MASK_OPTIX;
|
||||||
}
|
}
|
||||||
|
else if (compute_device == COMPUTE_DEVICE_HIP) {
|
||||||
|
mask |= DEVICE_MASK_HIP;
|
||||||
|
}
|
||||||
vector<DeviceInfo> devices = Device::available_devices(mask);
|
vector<DeviceInfo> devices = Device::available_devices(mask);
|
||||||
|
|
||||||
/* Match device preferences and available devices. */
|
/* Match device preferences and available devices. */
|
@@ -14,11 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blender/blender_gpu_display.h"
|
#include "blender/display_driver.h"
|
||||||
|
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_opengl.h"
|
#include "util/opengl.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
struct RenderEngine;
|
struct RenderEngine;
|
||||||
@@ -273,17 +273,17 @@ uint BlenderDisplaySpaceShader::get_shader_program()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------
|
/* --------------------------------------------------------------------
|
||||||
* BlenderGPUDisplay.
|
* BlenderDisplayDriver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BlenderGPUDisplay::BlenderGPUDisplay(BL::RenderEngine &b_engine, BL::Scene &b_scene)
|
BlenderDisplayDriver::BlenderDisplayDriver(BL::RenderEngine &b_engine, BL::Scene &b_scene)
|
||||||
: b_engine_(b_engine), display_shader_(BlenderDisplayShader::create(b_engine, b_scene))
|
: b_engine_(b_engine), display_shader_(BlenderDisplayShader::create(b_engine, b_scene))
|
||||||
{
|
{
|
||||||
/* Create context while on the main thread. */
|
/* Create context while on the main thread. */
|
||||||
gl_context_create();
|
gl_context_create();
|
||||||
}
|
}
|
||||||
|
|
||||||
BlenderGPUDisplay::~BlenderGPUDisplay()
|
BlenderDisplayDriver::~BlenderDisplayDriver()
|
||||||
{
|
{
|
||||||
gl_resources_destroy();
|
gl_resources_destroy();
|
||||||
}
|
}
|
||||||
@@ -292,19 +292,18 @@ BlenderGPUDisplay::~BlenderGPUDisplay()
|
|||||||
* Update procedure.
|
* Update procedure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool BlenderGPUDisplay::do_update_begin(const GPUDisplayParams ¶ms,
|
bool BlenderDisplayDriver::update_begin(const Params ¶ms,
|
||||||
int texture_width,
|
int texture_width,
|
||||||
int texture_height)
|
int texture_height)
|
||||||
{
|
{
|
||||||
/* Note that it's the responsibility of BlenderGPUDisplay to ensure updating and drawing
|
/* Note that it's the responsibility of BlenderDisplayDriver to ensure updating and drawing
|
||||||
* the texture does not happen at the same time. This is achieved indirectly.
|
* the texture does not happen at the same time. This is achieved indirectly.
|
||||||
*
|
*
|
||||||
* When enabling the OpenGL context, it uses an internal mutex lock DST.gl_context_lock.
|
* When enabling the OpenGL context, it uses an internal mutex lock DST.gl_context_lock.
|
||||||
* This same lock is also held when do_draw() is called, which together ensure mutual
|
* This same lock is also held when do_draw() is called, which together ensure mutual
|
||||||
* exclusion.
|
* exclusion.
|
||||||
*
|
*
|
||||||
* This locking is not performed at the GPU display level, because that would cause lock
|
* This locking is not performed on the Cycles side, because that would cause lock inversion. */
|
||||||
* inversion. */
|
|
||||||
if (!gl_context_enable()) {
|
if (!gl_context_enable()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -358,10 +357,12 @@ bool BlenderGPUDisplay::do_update_begin(const GPUDisplayParams ¶ms,
|
|||||||
* centralized place. */
|
* centralized place. */
|
||||||
texture_.need_update = true;
|
texture_.need_update = true;
|
||||||
|
|
||||||
|
texture_.params = params;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::do_update_end()
|
void BlenderDisplayDriver::update_end()
|
||||||
{
|
{
|
||||||
gl_upload_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
gl_upload_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
glFlush();
|
glFlush();
|
||||||
@@ -369,54 +370,18 @@ void BlenderGPUDisplay::do_update_end()
|
|||||||
gl_context_disable();
|
gl_context_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------
|
|
||||||
* Texture update from CPU buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void BlenderGPUDisplay::do_copy_pixels_to_texture(
|
|
||||||
const half4 *rgba_pixels, int texture_x, int texture_y, int pixels_width, int pixels_height)
|
|
||||||
{
|
|
||||||
/* This call copies pixels to a Pixel Buffer Object (PBO) which is much cheaper from CPU time
|
|
||||||
* point of view than to copy data directly to the OpenGL texture.
|
|
||||||
*
|
|
||||||
* The possible downside of this approach is that it might require a higher peak memory when
|
|
||||||
* doing partial updates of the texture (although, in practice even partial updates might peak
|
|
||||||
* with a full-frame buffer stored on the CPU if the GPU is currently occupied). */
|
|
||||||
|
|
||||||
half4 *mapped_rgba_pixels = map_texture_buffer();
|
|
||||||
if (!mapped_rgba_pixels) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture_x == 0 && texture_y == 0 && pixels_width == texture_.width &&
|
|
||||||
pixels_height == texture_.height) {
|
|
||||||
const size_t size_in_bytes = sizeof(half4) * texture_.width * texture_.height;
|
|
||||||
memcpy(mapped_rgba_pixels, rgba_pixels, size_in_bytes);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const half4 *rgba_row = rgba_pixels;
|
|
||||||
half4 *mapped_rgba_row = mapped_rgba_pixels + texture_y * texture_.width + texture_x;
|
|
||||||
for (int y = 0; y < pixels_height;
|
|
||||||
++y, rgba_row += pixels_width, mapped_rgba_row += texture_.width) {
|
|
||||||
memcpy(mapped_rgba_row, rgba_row, sizeof(half4) * pixels_width);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unmap_texture_buffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------
|
/* --------------------------------------------------------------------
|
||||||
* Texture buffer mapping.
|
* Texture buffer mapping.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
half4 *BlenderGPUDisplay::do_map_texture_buffer()
|
half4 *BlenderDisplayDriver::map_texture_buffer()
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture_.gl_pbo_id);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture_.gl_pbo_id);
|
||||||
|
|
||||||
half4 *mapped_rgba_pixels = reinterpret_cast<half4 *>(
|
half4 *mapped_rgba_pixels = reinterpret_cast<half4 *>(
|
||||||
glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY));
|
glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY));
|
||||||
if (!mapped_rgba_pixels) {
|
if (!mapped_rgba_pixels) {
|
||||||
LOG(ERROR) << "Error mapping BlenderGPUDisplay pixel buffer object.";
|
LOG(ERROR) << "Error mapping BlenderDisplayDriver pixel buffer object.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_.need_clear) {
|
if (texture_.need_clear) {
|
||||||
@@ -431,7 +396,7 @@ half4 *BlenderGPUDisplay::do_map_texture_buffer()
|
|||||||
return mapped_rgba_pixels;
|
return mapped_rgba_pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::do_unmap_texture_buffer()
|
void BlenderDisplayDriver::unmap_texture_buffer()
|
||||||
{
|
{
|
||||||
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||||
|
|
||||||
@@ -442,9 +407,9 @@ void BlenderGPUDisplay::do_unmap_texture_buffer()
|
|||||||
* Graphics interoperability.
|
* Graphics interoperability.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeviceGraphicsInteropDestination BlenderGPUDisplay::do_graphics_interop_get()
|
BlenderDisplayDriver::GraphicsInterop BlenderDisplayDriver::graphics_interop_get()
|
||||||
{
|
{
|
||||||
DeviceGraphicsInteropDestination interop_dst;
|
GraphicsInterop interop_dst;
|
||||||
|
|
||||||
interop_dst.buffer_width = texture_.buffer_width;
|
interop_dst.buffer_width = texture_.buffer_width;
|
||||||
interop_dst.buffer_height = texture_.buffer_height;
|
interop_dst.buffer_height = texture_.buffer_height;
|
||||||
@@ -456,12 +421,12 @@ DeviceGraphicsInteropDestination BlenderGPUDisplay::do_graphics_interop_get()
|
|||||||
return interop_dst;
|
return interop_dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::graphics_interop_activate()
|
void BlenderDisplayDriver::graphics_interop_activate()
|
||||||
{
|
{
|
||||||
gl_context_enable();
|
gl_context_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::graphics_interop_deactivate()
|
void BlenderDisplayDriver::graphics_interop_deactivate()
|
||||||
{
|
{
|
||||||
gl_context_disable();
|
gl_context_disable();
|
||||||
}
|
}
|
||||||
@@ -470,27 +435,21 @@ void BlenderGPUDisplay::graphics_interop_deactivate()
|
|||||||
* Drawing.
|
* Drawing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void BlenderGPUDisplay::clear()
|
void BlenderDisplayDriver::clear()
|
||||||
{
|
{
|
||||||
texture_.need_clear = true;
|
texture_.need_clear = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::set_zoom(float zoom_x, float zoom_y)
|
void BlenderDisplayDriver::set_zoom(float zoom_x, float zoom_y)
|
||||||
{
|
{
|
||||||
zoom_ = make_float2(zoom_x, zoom_y);
|
zoom_ = make_float2(zoom_x, zoom_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::do_draw(const GPUDisplayParams ¶ms)
|
void BlenderDisplayDriver::draw(const Params ¶ms)
|
||||||
{
|
{
|
||||||
/* See do_update_begin() for why no locking is required here. */
|
/* See do_update_begin() for why no locking is required here. */
|
||||||
const bool transparent = true; // TODO(sergey): Derive this from Film.
|
const bool transparent = true; // TODO(sergey): Derive this from Film.
|
||||||
|
|
||||||
if (texture_.need_clear) {
|
|
||||||
/* Texture is requested to be cleared and was not yet cleared.
|
|
||||||
* Do early return which should be equivalent of drawing all-zero texture. */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gl_draw_resources_ensure()) {
|
if (!gl_draw_resources_ensure()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -499,6 +458,16 @@ void BlenderGPUDisplay::do_draw(const GPUDisplayParams ¶ms)
|
|||||||
gl_context_mutex_.lock();
|
gl_context_mutex_.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (texture_.need_clear) {
|
||||||
|
/* Texture is requested to be cleared and was not yet cleared.
|
||||||
|
*
|
||||||
|
* Do early return which should be equivalent of drawing all-zero texture.
|
||||||
|
* Watch out for the lock though so that the clear happening during update is properly
|
||||||
|
* synchronized here. */
|
||||||
|
gl_context_mutex_.unlock();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (gl_upload_sync_) {
|
if (gl_upload_sync_) {
|
||||||
glWaitSync((GLsync)gl_upload_sync_, 0, GL_TIMEOUT_IGNORED);
|
glWaitSync((GLsync)gl_upload_sync_, 0, GL_TIMEOUT_IGNORED);
|
||||||
}
|
}
|
||||||
@@ -580,7 +549,7 @@ void BlenderGPUDisplay::do_draw(const GPUDisplayParams ¶ms)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::gl_context_create()
|
void BlenderDisplayDriver::gl_context_create()
|
||||||
{
|
{
|
||||||
/* When rendering in viewport there is no render context available via engine.
|
/* When rendering in viewport there is no render context available via engine.
|
||||||
* Check whether own context is to be created here.
|
* Check whether own context is to be created here.
|
||||||
@@ -609,7 +578,7 @@ void BlenderGPUDisplay::gl_context_create()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlenderGPUDisplay::gl_context_enable()
|
bool BlenderDisplayDriver::gl_context_enable()
|
||||||
{
|
{
|
||||||
if (use_gl_context_) {
|
if (use_gl_context_) {
|
||||||
if (!gl_context_) {
|
if (!gl_context_) {
|
||||||
@@ -624,7 +593,7 @@ bool BlenderGPUDisplay::gl_context_enable()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::gl_context_disable()
|
void BlenderDisplayDriver::gl_context_disable()
|
||||||
{
|
{
|
||||||
if (use_gl_context_) {
|
if (use_gl_context_) {
|
||||||
if (gl_context_) {
|
if (gl_context_) {
|
||||||
@@ -637,7 +606,7 @@ void BlenderGPUDisplay::gl_context_disable()
|
|||||||
RE_engine_render_context_disable(reinterpret_cast<RenderEngine *>(b_engine_.ptr.data));
|
RE_engine_render_context_disable(reinterpret_cast<RenderEngine *>(b_engine_.ptr.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::gl_context_dispose()
|
void BlenderDisplayDriver::gl_context_dispose()
|
||||||
{
|
{
|
||||||
if (gl_context_) {
|
if (gl_context_) {
|
||||||
const bool drw_state = DRW_opengl_context_release();
|
const bool drw_state = DRW_opengl_context_release();
|
||||||
@@ -649,7 +618,7 @@ void BlenderGPUDisplay::gl_context_dispose()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlenderGPUDisplay::gl_draw_resources_ensure()
|
bool BlenderDisplayDriver::gl_draw_resources_ensure()
|
||||||
{
|
{
|
||||||
if (!texture_.gl_id) {
|
if (!texture_.gl_id) {
|
||||||
/* If there is no texture allocated, there is nothing to draw. Inform the draw call that it can
|
/* If there is no texture allocated, there is nothing to draw. Inform the draw call that it can
|
||||||
@@ -676,7 +645,7 @@ bool BlenderGPUDisplay::gl_draw_resources_ensure()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::gl_resources_destroy()
|
void BlenderDisplayDriver::gl_resources_destroy()
|
||||||
{
|
{
|
||||||
gl_context_enable();
|
gl_context_enable();
|
||||||
|
|
||||||
@@ -699,7 +668,7 @@ void BlenderGPUDisplay::gl_resources_destroy()
|
|||||||
gl_context_dispose();
|
gl_context_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlenderGPUDisplay::gl_texture_resources_ensure()
|
bool BlenderDisplayDriver::gl_texture_resources_ensure()
|
||||||
{
|
{
|
||||||
if (texture_.creation_attempted) {
|
if (texture_.creation_attempted) {
|
||||||
return texture_.is_created;
|
return texture_.is_created;
|
||||||
@@ -736,7 +705,7 @@ bool BlenderGPUDisplay::gl_texture_resources_ensure()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::texture_update_if_needed()
|
void BlenderDisplayDriver::texture_update_if_needed()
|
||||||
{
|
{
|
||||||
if (!texture_.need_update) {
|
if (!texture_.need_update) {
|
||||||
return;
|
return;
|
||||||
@@ -750,8 +719,23 @@ void BlenderGPUDisplay::texture_update_if_needed()
|
|||||||
texture_.need_update = false;
|
texture_.need_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderGPUDisplay::vertex_buffer_update(const GPUDisplayParams ¶ms)
|
void BlenderDisplayDriver::vertex_buffer_update(const Params & /*params*/)
|
||||||
{
|
{
|
||||||
|
/* Draw at the parameters for which the texture has been updated for. This allows to always draw
|
||||||
|
* texture during bordered-rendered camera view without flickering. The validness of the display
|
||||||
|
* parameters for a texture is guaranteed by the initial "clear" state which makes drawing to
|
||||||
|
* have an early output.
|
||||||
|
*
|
||||||
|
* Such approach can cause some extra "jelly" effect during panning, but it is not more jelly
|
||||||
|
* than overlay of selected objects. Also, it's possible to redraw texture at an intersection of
|
||||||
|
* the texture draw parameters and the latest updated draw parameters (although, complexity of
|
||||||
|
* doing it might not worth it. */
|
||||||
|
const int x = texture_.params.full_offset.x;
|
||||||
|
const int y = texture_.params.full_offset.y;
|
||||||
|
|
||||||
|
const int width = texture_.params.size.x;
|
||||||
|
const int height = texture_.params.size.y;
|
||||||
|
|
||||||
/* Invalidate old contents - avoids stalling if the buffer is still waiting in queue to be
|
/* Invalidate old contents - avoids stalling if the buffer is still waiting in queue to be
|
||||||
* rendered. */
|
* rendered. */
|
||||||
glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STREAM_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STREAM_DRAW);
|
||||||
@@ -763,23 +747,23 @@ void BlenderGPUDisplay::vertex_buffer_update(const GPUDisplayParams ¶ms)
|
|||||||
|
|
||||||
vpointer[0] = 0.0f;
|
vpointer[0] = 0.0f;
|
||||||
vpointer[1] = 0.0f;
|
vpointer[1] = 0.0f;
|
||||||
vpointer[2] = params.offset.x;
|
vpointer[2] = x;
|
||||||
vpointer[3] = params.offset.y;
|
vpointer[3] = y;
|
||||||
|
|
||||||
vpointer[4] = 1.0f;
|
vpointer[4] = 1.0f;
|
||||||
vpointer[5] = 0.0f;
|
vpointer[5] = 0.0f;
|
||||||
vpointer[6] = (float)params.size.x + params.offset.x;
|
vpointer[6] = x + width;
|
||||||
vpointer[7] = params.offset.y;
|
vpointer[7] = y;
|
||||||
|
|
||||||
vpointer[8] = 1.0f;
|
vpointer[8] = 1.0f;
|
||||||
vpointer[9] = 1.0f;
|
vpointer[9] = 1.0f;
|
||||||
vpointer[10] = (float)params.size.x + params.offset.x;
|
vpointer[10] = x + width;
|
||||||
vpointer[11] = (float)params.size.y + params.offset.y;
|
vpointer[11] = y + height;
|
||||||
|
|
||||||
vpointer[12] = 0.0f;
|
vpointer[12] = 0.0f;
|
||||||
vpointer[13] = 1.0f;
|
vpointer[13] = 1.0f;
|
||||||
vpointer[14] = params.offset.x;
|
vpointer[14] = x;
|
||||||
vpointer[15] = (float)params.size.y + params.offset.y;
|
vpointer[15] = y + height;
|
||||||
|
|
||||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||||
}
|
}
|
@@ -22,12 +22,14 @@
|
|||||||
|
|
||||||
#include "RNA_blender_cpp.h"
|
#include "RNA_blender_cpp.h"
|
||||||
|
|
||||||
#include "render/gpu_display.h"
|
#include "session/display_driver.h"
|
||||||
#include "util/util_unique_ptr.h"
|
|
||||||
|
#include "util/thread.h"
|
||||||
|
#include "util/unique_ptr.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
/* Base class of shader used for GPU display rendering. */
|
/* Base class of shader used for display driver rendering. */
|
||||||
class BlenderDisplayShader {
|
class BlenderDisplayShader {
|
||||||
public:
|
public:
|
||||||
static constexpr const char *position_attribute_name = "pos";
|
static constexpr const char *position_attribute_name = "pos";
|
||||||
@@ -96,11 +98,11 @@ class BlenderDisplaySpaceShader : public BlenderDisplayShader {
|
|||||||
uint shader_program_ = 0;
|
uint shader_program_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* GPU display implementation which is specific for Blender viewport integration. */
|
/* Display driver implementation which is specific for Blender viewport integration. */
|
||||||
class BlenderGPUDisplay : public GPUDisplay {
|
class BlenderDisplayDriver : public DisplayDriver {
|
||||||
public:
|
public:
|
||||||
BlenderGPUDisplay(BL::RenderEngine &b_engine, BL::Scene &b_scene);
|
BlenderDisplayDriver(BL::RenderEngine &b_engine, BL::Scene &b_scene);
|
||||||
~BlenderGPUDisplay();
|
~BlenderDisplayDriver();
|
||||||
|
|
||||||
virtual void graphics_interop_activate() override;
|
virtual void graphics_interop_activate() override;
|
||||||
virtual void graphics_interop_deactivate() override;
|
virtual void graphics_interop_deactivate() override;
|
||||||
@@ -110,22 +112,15 @@ class BlenderGPUDisplay : public GPUDisplay {
|
|||||||
void set_zoom(float zoom_x, float zoom_y);
|
void set_zoom(float zoom_x, float zoom_y);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool do_update_begin(const GPUDisplayParams ¶ms,
|
virtual bool update_begin(const Params ¶ms, int texture_width, int texture_height) override;
|
||||||
int texture_width,
|
virtual void update_end() override;
|
||||||
int texture_height) override;
|
|
||||||
virtual void do_update_end() override;
|
|
||||||
|
|
||||||
virtual void do_copy_pixels_to_texture(const half4 *rgba_pixels,
|
virtual half4 *map_texture_buffer() override;
|
||||||
int texture_x,
|
virtual void unmap_texture_buffer() override;
|
||||||
int texture_y,
|
|
||||||
int pixels_width,
|
|
||||||
int pixels_height) override;
|
|
||||||
virtual void do_draw(const GPUDisplayParams ¶ms) override;
|
|
||||||
|
|
||||||
virtual half4 *do_map_texture_buffer() override;
|
virtual GraphicsInterop graphics_interop_get() override;
|
||||||
virtual void do_unmap_texture_buffer() override;
|
|
||||||
|
|
||||||
virtual DeviceGraphicsInteropDestination do_graphics_interop_get() override;
|
virtual void draw(const Params ¶ms) override;
|
||||||
|
|
||||||
/* Helper function which allocates new GPU context. */
|
/* Helper function which allocates new GPU context. */
|
||||||
void gl_context_create();
|
void gl_context_create();
|
||||||
@@ -152,13 +147,13 @@ class BlenderGPUDisplay : public GPUDisplay {
|
|||||||
* This buffer is used to render texture in the viewport.
|
* This buffer is used to render texture in the viewport.
|
||||||
*
|
*
|
||||||
* NOTE: The buffer needs to be bound. */
|
* NOTE: The buffer needs to be bound. */
|
||||||
void vertex_buffer_update(const GPUDisplayParams ¶ms);
|
void vertex_buffer_update(const Params ¶ms);
|
||||||
|
|
||||||
BL::RenderEngine b_engine_;
|
BL::RenderEngine b_engine_;
|
||||||
|
|
||||||
/* OpenGL context which is used the render engine doesn't have its own. */
|
/* OpenGL context which is used the render engine doesn't have its own. */
|
||||||
void *gl_context_ = nullptr;
|
void *gl_context_ = nullptr;
|
||||||
/* The when Blender RenderEngine side context is not available and the GPUDisplay is to create
|
/* The when Blender RenderEngine side context is not available and the DisplayDriver is to create
|
||||||
* its own context. */
|
* its own context. */
|
||||||
bool use_gl_context_ = false;
|
bool use_gl_context_ = false;
|
||||||
/* Mutex used to guard the `gl_context_`. */
|
/* Mutex used to guard the `gl_context_`. */
|
||||||
@@ -193,6 +188,9 @@ class BlenderGPUDisplay : public GPUDisplay {
|
|||||||
/* Dimensions of the underlying PBO. */
|
/* Dimensions of the underlying PBO. */
|
||||||
int buffer_width = 0;
|
int buffer_width = 0;
|
||||||
int buffer_height = 0;
|
int buffer_height = 0;
|
||||||
|
|
||||||
|
/* Display parameters the texture has been updated for. */
|
||||||
|
Params params;
|
||||||
} texture_;
|
} texture_;
|
||||||
|
|
||||||
unique_ptr<BlenderDisplayShader> display_shader_;
|
unique_ptr<BlenderDisplayShader> display_shader_;
|
@@ -15,17 +15,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/curves.h"
|
#include "scene/curves.h"
|
||||||
#include "render/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/object.h"
|
#include "scene/object.h"
|
||||||
#include "render/volume.h"
|
#include "scene/volume.h"
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -80,8 +80,10 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
|||||||
{
|
{
|
||||||
/* Test if we can instance or if the object is modified. */
|
/* Test if we can instance or if the object is modified. */
|
||||||
Geometry::Type geom_type = determine_geom_type(b_ob_info, use_particle_hair);
|
Geometry::Type geom_type = determine_geom_type(b_ob_info, use_particle_hair);
|
||||||
BL::ID b_key_id = (BKE_object_is_modified(b_ob_info.real_object)) ? b_ob_info.real_object :
|
BL::ID b_key_id = (b_ob_info.is_real_object_data() &&
|
||||||
b_ob_info.object_data;
|
BKE_object_is_modified(b_ob_info.real_object)) ?
|
||||||
|
b_ob_info.real_object :
|
||||||
|
b_ob_info.object_data;
|
||||||
GeometryKey key(b_key_id.ptr.data, geom_type);
|
GeometryKey key(b_key_id.ptr.data, geom_type);
|
||||||
|
|
||||||
/* Find shader indices. */
|
/* Find shader indices. */
|
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "render/geometry.h"
|
#include "scene/geometry.h"
|
||||||
#include "render/scene.h"
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "util/util_map.h"
|
#include "util/map.h"
|
||||||
#include "util/util_set.h"
|
#include "util/set.h"
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "blender/blender_image.h"
|
#include "blender/image.h"
|
||||||
#include "blender/blender_session.h"
|
#include "blender/session.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "RNA_blender_cpp.h"
|
#include "RNA_blender_cpp.h"
|
||||||
|
|
||||||
#include "render/image.h"
|
#include "scene/image.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -16,12 +16,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/light.h"
|
#include "scene/light.h"
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_hash.h"
|
#include "util/hash.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blender/CCL_api.h"
|
#include "blender/CCL_api.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
|
|
||||||
void CCL_init_logging(const char *argv0)
|
void CCL_init_logging(const char *argv0)
|
||||||
{
|
{
|
@@ -14,25 +14,26 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/camera.h"
|
#include "blender/session.h"
|
||||||
#include "render/colorspace.h"
|
#include "blender/sync.h"
|
||||||
#include "render/mesh.h"
|
#include "blender/util.h"
|
||||||
#include "render/object.h"
|
|
||||||
#include "render/scene.h"
|
|
||||||
|
|
||||||
#include "blender/blender_session.h"
|
#include "scene/camera.h"
|
||||||
#include "blender/blender_sync.h"
|
#include "scene/colorspace.h"
|
||||||
#include "blender/blender_util.h"
|
#include "scene/mesh.h"
|
||||||
|
#include "scene/object.h"
|
||||||
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "subd/subd_patch.h"
|
#include "subd/patch.h"
|
||||||
#include "subd/subd_split.h"
|
#include "subd/split.h"
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/util_disjoint_set.h"
|
#include "util/color.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/disjoint_set.h"
|
||||||
#include "util/util_hash.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/hash.h"
|
||||||
#include "util/util_math.h"
|
#include "util/log.h"
|
||||||
|
#include "util/math.h"
|
||||||
|
|
||||||
#include "mikktspace.h"
|
#include "mikktspace.h"
|
||||||
|
|
@@ -14,26 +14,26 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/alembic.h"
|
#include "blender/object_cull.h"
|
||||||
#include "render/camera.h"
|
#include "blender/sync.h"
|
||||||
#include "render/graph.h"
|
#include "blender/util.h"
|
||||||
#include "render/integrator.h"
|
|
||||||
#include "render/light.h"
|
|
||||||
#include "render/mesh.h"
|
|
||||||
#include "render/nodes.h"
|
|
||||||
#include "render/object.h"
|
|
||||||
#include "render/particles.h"
|
|
||||||
#include "render/scene.h"
|
|
||||||
#include "render/shader.h"
|
|
||||||
|
|
||||||
#include "blender/blender_object_cull.h"
|
#include "scene/alembic.h"
|
||||||
#include "blender/blender_sync.h"
|
#include "scene/camera.h"
|
||||||
#include "blender/blender_util.h"
|
#include "scene/integrator.h"
|
||||||
|
#include "scene/light.h"
|
||||||
|
#include "scene/mesh.h"
|
||||||
|
#include "scene/object.h"
|
||||||
|
#include "scene/particles.h"
|
||||||
|
#include "scene/scene.h"
|
||||||
|
#include "scene/shader.h"
|
||||||
|
#include "scene/shader_graph.h"
|
||||||
|
#include "scene/shader_nodes.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_hash.h"
|
#include "util/hash.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -76,18 +76,15 @@ bool BlenderSync::object_is_geometry(BL::Object &b_ob)
|
|||||||
/* Will be exported attached to mesh. */
|
/* Will be exported attached to mesh. */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (type == BL::Object::type_CURVE) {
|
|
||||||
/* Skip exporting curves without faces, overhead can be
|
|
||||||
* significant if there are many for path animation. */
|
|
||||||
BL::Curve b_curve(b_ob_data);
|
|
||||||
|
|
||||||
return (b_curve.bevel_object() || b_curve.extrude() != 0.0f || b_curve.bevel_depth() != 0.0f ||
|
/* Other object types that are not meshes but evaluate to meshes are presented to render engines
|
||||||
b_curve.dimensions() == BL::Curve::dimensions_2D || b_ob.modifiers.length());
|
* as separate instance objects. Metaballs and surface objects have not been affected by that
|
||||||
}
|
* change yet. */
|
||||||
else {
|
if (type == BL::Object::type_SURFACE || type == BL::Object::type_META) {
|
||||||
return (b_ob_data.is_a(&RNA_Mesh) || b_ob_data.is_a(&RNA_Curve) ||
|
return true;
|
||||||
b_ob_data.is_a(&RNA_MetaBall));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return b_ob_data.is_a(&RNA_Mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlenderSync::object_is_light(BL::Object &b_ob)
|
bool BlenderSync::object_is_light(BL::Object &b_ob)
|
||||||
@@ -104,23 +101,22 @@ void BlenderSync::sync_object_motion_init(BL::Object &b_parent, BL::Object &b_ob
|
|||||||
array<Transform> motion;
|
array<Transform> motion;
|
||||||
object->set_motion(motion);
|
object->set_motion(motion);
|
||||||
|
|
||||||
Scene::MotionType need_motion = scene->need_motion();
|
Geometry *geom = object->get_geometry();
|
||||||
if (need_motion == Scene::MOTION_NONE || !object->get_geometry()) {
|
if (!geom) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry *geom = object->get_geometry();
|
|
||||||
|
|
||||||
int motion_steps = 0;
|
int motion_steps = 0;
|
||||||
bool use_motion_blur = false;
|
bool use_motion_blur = false;
|
||||||
|
|
||||||
|
Scene::MotionType need_motion = scene->need_motion();
|
||||||
if (need_motion == Scene::MOTION_BLUR) {
|
if (need_motion == Scene::MOTION_BLUR) {
|
||||||
motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
|
motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
|
||||||
if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
|
if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
|
||||||
use_motion_blur = true;
|
use_motion_blur = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (need_motion != Scene::MOTION_NONE) {
|
||||||
motion_steps = 3;
|
motion_steps = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +158,11 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
|||||||
if (is_instance) {
|
if (is_instance) {
|
||||||
persistent_id_array = b_instance.persistent_id();
|
persistent_id_array = b_instance.persistent_id();
|
||||||
persistent_id = persistent_id_array.data;
|
persistent_id = persistent_id_array.data;
|
||||||
|
if (!b_ob_info.is_real_object_data()) {
|
||||||
|
/* Remember which object data the geometry is coming from, so that we can sync it when the
|
||||||
|
* object has changed. */
|
||||||
|
instance_geometries_by_object[b_ob_info.real_object.ptr.data].insert(b_ob_info.object_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* light is handled separately */
|
/* light is handled separately */
|
||||||
@@ -561,6 +562,7 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
|||||||
else {
|
else {
|
||||||
geometry_motion_synced.clear();
|
geometry_motion_synced.clear();
|
||||||
}
|
}
|
||||||
|
instance_geometries_by_object.clear();
|
||||||
|
|
||||||
/* initialize culling */
|
/* initialize culling */
|
||||||
BlenderObjectCulling culling(scene, b_scene);
|
BlenderObjectCulling culling(scene, b_scene);
|
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "render/camera.h"
|
#include "scene/camera.h"
|
||||||
|
|
||||||
#include "blender/blender_object_cull.h"
|
#include "blender/object_cull.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -17,8 +17,8 @@
|
|||||||
#ifndef __BLENDER_OBJECT_CULL_H__
|
#ifndef __BLENDER_OBJECT_CULL_H__
|
||||||
#define __BLENDER_OBJECT_CULL_H__
|
#define __BLENDER_OBJECT_CULL_H__
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
126
intern/cycles/blender/output_driver.cpp
Normal file
126
intern/cycles/blender/output_driver.cpp
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Blender Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "blender/output_driver.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
BlenderOutputDriver::BlenderOutputDriver(BL::RenderEngine &b_engine) : b_engine_(b_engine)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BlenderOutputDriver::~BlenderOutputDriver()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BlenderOutputDriver::read_render_tile(const Tile &tile)
|
||||||
|
{
|
||||||
|
/* Get render result. */
|
||||||
|
BL::RenderResult b_rr = b_engine_.begin_result(tile.offset.x,
|
||||||
|
tile.offset.y,
|
||||||
|
tile.size.x,
|
||||||
|
tile.size.y,
|
||||||
|
tile.layer.c_str(),
|
||||||
|
tile.view.c_str());
|
||||||
|
|
||||||
|
/* Can happen if the intersected rectangle gives 0 width or height. */
|
||||||
|
if (b_rr.ptr.data == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
BL::RenderResult::layers_iterator b_single_rlay;
|
||||||
|
b_rr.layers.begin(b_single_rlay);
|
||||||
|
|
||||||
|
/* layer will be missing if it was disabled in the UI */
|
||||||
|
if (b_single_rlay == b_rr.layers.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
BL::RenderLayer b_rlay = *b_single_rlay;
|
||||||
|
|
||||||
|
vector<float> pixels(tile.size.x * tile.size.y * 4);
|
||||||
|
|
||||||
|
/* Copy each pass.
|
||||||
|
* TODO:copy only the required ones for better performance? */
|
||||||
|
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
||||||
|
tile.set_pass_pixels(b_pass.name(), b_pass.channels(), (float *)b_pass.rect());
|
||||||
|
}
|
||||||
|
|
||||||
|
b_engine_.end_result(b_rr, false, false, false);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BlenderOutputDriver::update_render_tile(const Tile &tile)
|
||||||
|
{
|
||||||
|
/* Use final write for preview renders, otherwise render result wouldn't be be updated
|
||||||
|
* quickly on Blender side. For all other cases we use the display driver. */
|
||||||
|
if (b_engine_.is_preview()) {
|
||||||
|
write_render_tile(tile);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don't highlight full-frame tile. */
|
||||||
|
if (!(tile.size == tile.full_size)) {
|
||||||
|
b_engine_.tile_highlight_clear_all();
|
||||||
|
b_engine_.tile_highlight_set(tile.offset.x, tile.offset.y, tile.size.x, tile.size.y, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlenderOutputDriver::write_render_tile(const Tile &tile)
|
||||||
|
{
|
||||||
|
b_engine_.tile_highlight_clear_all();
|
||||||
|
|
||||||
|
/* Get render result. */
|
||||||
|
BL::RenderResult b_rr = b_engine_.begin_result(tile.offset.x,
|
||||||
|
tile.offset.y,
|
||||||
|
tile.size.x,
|
||||||
|
tile.size.y,
|
||||||
|
tile.layer.c_str(),
|
||||||
|
tile.view.c_str());
|
||||||
|
|
||||||
|
/* Can happen if the intersected rectangle gives 0 width or height. */
|
||||||
|
if (b_rr.ptr.data == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BL::RenderResult::layers_iterator b_single_rlay;
|
||||||
|
b_rr.layers.begin(b_single_rlay);
|
||||||
|
|
||||||
|
/* Layer will be missing if it was disabled in the UI. */
|
||||||
|
if (b_single_rlay == b_rr.layers.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BL::RenderLayer b_rlay = *b_single_rlay;
|
||||||
|
|
||||||
|
vector<float> pixels(tile.size.x * tile.size.y * 4);
|
||||||
|
|
||||||
|
/* Copy each pass. */
|
||||||
|
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
||||||
|
if (!tile.get_pass_pixels(b_pass.name(), b_pass.channels(), &pixels[0])) {
|
||||||
|
memset(&pixels[0], 0, pixels.size() * sizeof(float));
|
||||||
|
}
|
||||||
|
|
||||||
|
b_pass.rect(&pixels[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
b_engine_.end_result(b_rr, true, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
40
intern/cycles/blender/output_driver.h
Normal file
40
intern/cycles/blender/output_driver.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Blender Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
|
#include "RNA_blender_cpp.h"
|
||||||
|
|
||||||
|
#include "session/output_driver.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
class BlenderOutputDriver : public OutputDriver {
|
||||||
|
public:
|
||||||
|
explicit BlenderOutputDriver(BL::RenderEngine &b_engine);
|
||||||
|
~BlenderOutputDriver();
|
||||||
|
|
||||||
|
virtual void write_render_tile(const Tile &tile) override;
|
||||||
|
virtual bool update_render_tile(const Tile &tile) override;
|
||||||
|
virtual bool read_render_tile(const Tile &tile) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
BL::RenderEngine b_engine_;
|
||||||
|
};
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
@@ -14,14 +14,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/mesh.h"
|
#include "scene/particles.h"
|
||||||
#include "render/object.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/particles.h"
|
#include "scene/object.h"
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,28 +18,28 @@
|
|||||||
|
|
||||||
#include "blender/CCL_api.h"
|
#include "blender/CCL_api.h"
|
||||||
|
|
||||||
#include "blender/blender_device.h"
|
#include "blender/device.h"
|
||||||
#include "blender/blender_session.h"
|
#include "blender/session.h"
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "render/denoising.h"
|
#include "session/denoising.h"
|
||||||
#include "render/merge.h"
|
#include "session/merge.h"
|
||||||
|
|
||||||
#include "util/util_debug.h"
|
#include "util/debug.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_md5.h"
|
#include "util/md5.h"
|
||||||
#include "util/util_opengl.h"
|
#include "util/opengl.h"
|
||||||
#include "util/util_openimagedenoise.h"
|
#include "util/openimagedenoise.h"
|
||||||
#include "util/util_path.h"
|
#include "util/path.h"
|
||||||
#include "util/util_string.h"
|
#include "util/string.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
#include "util/util_tbb.h"
|
#include "util/tbb.h"
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
|
|
||||||
#ifdef WITH_OSL
|
#ifdef WITH_OSL
|
||||||
# include "render/osl.h"
|
# include "scene/osl.h"
|
||||||
|
|
||||||
# include <OSL/oslconfig.h>
|
# include <OSL/oslconfig.h>
|
||||||
# include <OSL/oslquery.h>
|
# include <OSL/oslquery.h>
|
||||||
@@ -157,8 +157,6 @@ static PyObject *init_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
DebugFlags().running_inside_blender = true;
|
DebugFlags().running_inside_blender = true;
|
||||||
|
|
||||||
VLOG(2) << "Debug flags initialized to:\n" << DebugFlags();
|
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -885,8 +883,6 @@ static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
debug_flags_sync_from_scene(b_scene);
|
debug_flags_sync_from_scene(b_scene);
|
||||||
|
|
||||||
VLOG(2) << "Debug flags set to:\n" << DebugFlags();
|
|
||||||
|
|
||||||
debug_flags_set = true;
|
debug_flags_set = true;
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
@@ -896,7 +892,6 @@ static PyObject *debug_flags_reset_func(PyObject * /*self*/, PyObject * /*args*/
|
|||||||
{
|
{
|
||||||
debug_flags_reset();
|
debug_flags_reset();
|
||||||
if (debug_flags_set) {
|
if (debug_flags_set) {
|
||||||
VLOG(2) << "Debug flags reset to:\n" << DebugFlags();
|
|
||||||
debug_flags_set = false;
|
debug_flags_set = false;
|
||||||
}
|
}
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
@@ -911,14 +906,16 @@ static PyObject *enable_print_stats_func(PyObject * /*self*/, PyObject * /*args*
|
|||||||
static PyObject *get_device_types_func(PyObject * /*self*/, PyObject * /*args*/)
|
static PyObject *get_device_types_func(PyObject * /*self*/, PyObject * /*args*/)
|
||||||
{
|
{
|
||||||
vector<DeviceType> device_types = Device::available_types();
|
vector<DeviceType> device_types = Device::available_types();
|
||||||
bool has_cuda = false, has_optix = false;
|
bool has_cuda = false, has_optix = false, has_hip = false;
|
||||||
foreach (DeviceType device_type, device_types) {
|
foreach (DeviceType device_type, device_types) {
|
||||||
has_cuda |= (device_type == DEVICE_CUDA);
|
has_cuda |= (device_type == DEVICE_CUDA);
|
||||||
has_optix |= (device_type == DEVICE_OPTIX);
|
has_optix |= (device_type == DEVICE_OPTIX);
|
||||||
|
has_hip |= (device_type == DEVICE_HIP);
|
||||||
}
|
}
|
||||||
PyObject *list = PyTuple_New(2);
|
PyObject *list = PyTuple_New(3);
|
||||||
PyTuple_SET_ITEM(list, 0, PyBool_FromLong(has_cuda));
|
PyTuple_SET_ITEM(list, 0, PyBool_FromLong(has_cuda));
|
||||||
PyTuple_SET_ITEM(list, 1, PyBool_FromLong(has_optix));
|
PyTuple_SET_ITEM(list, 1, PyBool_FromLong(has_optix));
|
||||||
|
PyTuple_SET_ITEM(list, 2, PyBool_FromLong(has_hip));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,6 +941,9 @@ static PyObject *set_device_override_func(PyObject * /*self*/, PyObject *arg)
|
|||||||
else if (override == "OPTIX") {
|
else if (override == "OPTIX") {
|
||||||
BlenderSession::device_override = DEVICE_MASK_OPTIX;
|
BlenderSession::device_override = DEVICE_MASK_OPTIX;
|
||||||
}
|
}
|
||||||
|
else if (override == "HIP") {
|
||||||
|
BlenderSession::device_override = DEVICE_MASK_HIP;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
printf("\nError: %s is not a valid Cycles device.\n", override.c_str());
|
printf("\nError: %s is not a valid Cycles device.\n", override.c_str());
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
@@ -17,35 +17,36 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
#include "render/background.h"
|
#include "scene/background.h"
|
||||||
#include "render/buffers.h"
|
#include "scene/camera.h"
|
||||||
#include "render/camera.h"
|
#include "scene/colorspace.h"
|
||||||
#include "render/colorspace.h"
|
#include "scene/film.h"
|
||||||
#include "render/film.h"
|
#include "scene/integrator.h"
|
||||||
#include "render/integrator.h"
|
#include "scene/light.h"
|
||||||
#include "render/light.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/object.h"
|
||||||
#include "render/object.h"
|
#include "scene/scene.h"
|
||||||
#include "render/scene.h"
|
#include "scene/shader.h"
|
||||||
#include "render/session.h"
|
#include "scene/stats.h"
|
||||||
#include "render/shader.h"
|
#include "session/buffers.h"
|
||||||
#include "render/stats.h"
|
#include "session/session.h"
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/util_color.h"
|
#include "util/color.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_function.h"
|
#include "util/function.h"
|
||||||
#include "util/util_hash.h"
|
#include "util/hash.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_murmurhash.h"
|
#include "util/murmurhash.h"
|
||||||
#include "util/util_path.h"
|
#include "util/path.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/progress.h"
|
||||||
#include "util/util_time.h"
|
#include "util/time.h"
|
||||||
|
|
||||||
#include "blender/blender_gpu_display.h"
|
#include "blender/display_driver.h"
|
||||||
#include "blender/blender_session.h"
|
#include "blender/output_driver.h"
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/session.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/sync.h"
|
||||||
|
#include "blender/util.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -71,7 +72,8 @@ BlenderSession::BlenderSession(BL::RenderEngine &b_engine,
|
|||||||
width(0),
|
width(0),
|
||||||
height(0),
|
height(0),
|
||||||
preview_osl(preview_osl),
|
preview_osl(preview_osl),
|
||||||
python_thread_state(NULL)
|
python_thread_state(NULL),
|
||||||
|
use_developer_ui(false)
|
||||||
{
|
{
|
||||||
/* offline render */
|
/* offline render */
|
||||||
background = true;
|
background = true;
|
||||||
@@ -156,13 +158,6 @@ void BlenderSession::create_session()
|
|||||||
b_v3d, b_rv3d, scene->camera, width, height);
|
b_v3d, b_rv3d, scene->camera, width, height);
|
||||||
session->reset(session_params, buffer_params);
|
session->reset(session_params, buffer_params);
|
||||||
|
|
||||||
/* Create GPU display. */
|
|
||||||
if (!b_engine.is_preview() && !headless) {
|
|
||||||
unique_ptr<BlenderGPUDisplay> gpu_display = make_unique<BlenderGPUDisplay>(b_engine, b_scene);
|
|
||||||
gpu_display_ = gpu_display.get();
|
|
||||||
session->set_gpu_display(move(gpu_display));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Viewport and preview (as in, material preview) does not do tiled rendering, so can inform
|
/* Viewport and preview (as in, material preview) does not do tiled rendering, so can inform
|
||||||
* engine that no tracking of the tiles state is needed.
|
* engine that no tracking of the tiles state is needed.
|
||||||
* The offline rendering will make a decision when tile is being written. The penalty of asking
|
* The offline rendering will make a decision when tile is being written. The penalty of asking
|
||||||
@@ -275,96 +270,8 @@ void BlenderSession::free_session()
|
|||||||
|
|
||||||
delete session;
|
delete session;
|
||||||
session = nullptr;
|
session = nullptr;
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderSession::read_render_tile()
|
display_driver_ = nullptr;
|
||||||
{
|
|
||||||
const int2 tile_offset = session->get_render_tile_offset();
|
|
||||||
const int2 tile_size = session->get_render_tile_size();
|
|
||||||
|
|
||||||
/* get render result */
|
|
||||||
BL::RenderResult b_rr = b_engine.begin_result(tile_offset.x,
|
|
||||||
tile_offset.y,
|
|
||||||
tile_size.x,
|
|
||||||
tile_size.y,
|
|
||||||
b_rlay_name.c_str(),
|
|
||||||
b_rview_name.c_str());
|
|
||||||
|
|
||||||
/* can happen if the intersected rectangle gives 0 width or height */
|
|
||||||
if (b_rr.ptr.data == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BL::RenderResult::layers_iterator b_single_rlay;
|
|
||||||
b_rr.layers.begin(b_single_rlay);
|
|
||||||
|
|
||||||
/* layer will be missing if it was disabled in the UI */
|
|
||||||
if (b_single_rlay == b_rr.layers.end())
|
|
||||||
return;
|
|
||||||
|
|
||||||
BL::RenderLayer b_rlay = *b_single_rlay;
|
|
||||||
|
|
||||||
vector<float> pixels(tile_size.x * tile_size.y * 4);
|
|
||||||
|
|
||||||
/* Copy each pass.
|
|
||||||
* TODO:copy only the required ones for better performance? */
|
|
||||||
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
|
||||||
session->set_render_tile_pixels(b_pass.name(), b_pass.channels(), (float *)b_pass.rect());
|
|
||||||
}
|
|
||||||
|
|
||||||
b_engine.end_result(b_rr, false, false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderSession::write_render_tile()
|
|
||||||
{
|
|
||||||
const int2 tile_offset = session->get_render_tile_offset();
|
|
||||||
const int2 tile_size = session->get_render_tile_size();
|
|
||||||
|
|
||||||
const string_view render_layer_name = session->get_render_tile_layer();
|
|
||||||
const string_view render_view_name = session->get_render_tile_view();
|
|
||||||
|
|
||||||
b_engine.tile_highlight_clear_all();
|
|
||||||
|
|
||||||
/* get render result */
|
|
||||||
BL::RenderResult b_rr = b_engine.begin_result(tile_offset.x,
|
|
||||||
tile_offset.y,
|
|
||||||
tile_size.x,
|
|
||||||
tile_size.y,
|
|
||||||
render_layer_name.c_str(),
|
|
||||||
render_view_name.c_str());
|
|
||||||
|
|
||||||
/* can happen if the intersected rectangle gives 0 width or height */
|
|
||||||
if (b_rr.ptr.data == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BL::RenderResult::layers_iterator b_single_rlay;
|
|
||||||
b_rr.layers.begin(b_single_rlay);
|
|
||||||
|
|
||||||
/* layer will be missing if it was disabled in the UI */
|
|
||||||
if (b_single_rlay == b_rr.layers.end()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BL::RenderLayer b_rlay = *b_single_rlay;
|
|
||||||
|
|
||||||
write_render_result(b_rlay);
|
|
||||||
|
|
||||||
b_engine.end_result(b_rr, true, false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderSession::update_render_tile()
|
|
||||||
{
|
|
||||||
if (!session->has_multiple_render_tiles()) {
|
|
||||||
/* Don't highlight full-frame tile. */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int2 tile_offset = session->get_render_tile_offset();
|
|
||||||
const int2 tile_size = session->get_render_tile_size();
|
|
||||||
|
|
||||||
b_engine.tile_highlight_clear_all();
|
|
||||||
b_engine.tile_highlight_set(tile_offset.x, tile_offset.y, tile_size.x, tile_size.y, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderSession::full_buffer_written(string_view filename)
|
void BlenderSession::full_buffer_written(string_view filename)
|
||||||
@@ -440,18 +347,9 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set callback to write out render results */
|
/* Create driver to write out render results. */
|
||||||
session->write_render_tile_cb = [&]() { write_render_tile(); };
|
ensure_display_driver_if_needed();
|
||||||
|
session->set_output_driver(make_unique<BlenderOutputDriver>(b_engine));
|
||||||
/* Use final write for preview renders, otherwise render result wouldn't be be updated on Blender
|
|
||||||
* side. */
|
|
||||||
/* TODO(sergey): Investigate whether GPUDisplay can be used for the preview as well. */
|
|
||||||
if (b_engine.is_preview()) {
|
|
||||||
session->update_render_tile_cb = [&]() { write_render_tile(); };
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
session->update_render_tile_cb = [&]() { update_render_tile(); };
|
|
||||||
}
|
|
||||||
|
|
||||||
session->full_buffer_written_cb = [&](string_view filename) { full_buffer_written(filename); };
|
session->full_buffer_written_cb = [&](string_view filename) { full_buffer_written(filename); };
|
||||||
|
|
||||||
@@ -588,13 +486,22 @@ void BlenderSession::render_frame_finish()
|
|||||||
|
|
||||||
for (string_view filename : full_buffer_files_) {
|
for (string_view filename : full_buffer_files_) {
|
||||||
session->process_full_buffer_from_disk(filename);
|
session->process_full_buffer_from_disk(filename);
|
||||||
|
if (check_and_report_session_error()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (string_view filename : full_buffer_files_) {
|
||||||
path_remove(filename);
|
path_remove(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear callback */
|
/* Clear driver. */
|
||||||
session->write_render_tile_cb = function_null;
|
session->set_output_driver(nullptr);
|
||||||
session->update_render_tile_cb = function_null;
|
|
||||||
session->full_buffer_written_cb = function_null;
|
session->full_buffer_written_cb = function_null;
|
||||||
|
|
||||||
|
/* All the files are handled.
|
||||||
|
* Clear the list so that this session can be re-used by Persistent Data. */
|
||||||
|
full_buffer_files_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
static PassType bake_type_to_pass(const string &bake_type_str, const int bake_filter)
|
static PassType bake_type_to_pass(const string &bake_type_str, const int bake_filter)
|
||||||
@@ -699,9 +606,8 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
|
|||||||
pass->set_type(bake_type_to_pass(bake_type, bake_filter));
|
pass->set_type(bake_type_to_pass(bake_type, bake_filter));
|
||||||
pass->set_include_albedo((bake_filter & BL::BakeSettings::pass_filter_COLOR));
|
pass->set_include_albedo((bake_filter & BL::BakeSettings::pass_filter_COLOR));
|
||||||
|
|
||||||
session->read_render_tile_cb = [&]() { read_render_tile(); };
|
session->set_display_driver(nullptr);
|
||||||
session->write_render_tile_cb = [&]() { write_render_tile(); };
|
session->set_output_driver(make_unique<BlenderOutputDriver>(b_engine));
|
||||||
session->set_gpu_display(nullptr);
|
|
||||||
|
|
||||||
if (!session->progress.get_cancel()) {
|
if (!session->progress.get_cancel()) {
|
||||||
/* Sync scene. */
|
/* Sync scene. */
|
||||||
@@ -744,43 +650,7 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
|
|||||||
session->wait();
|
session->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
session->read_render_tile_cb = function_null;
|
session->set_output_driver(nullptr);
|
||||||
session->write_render_tile_cb = function_null;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderSession::write_render_result(BL::RenderLayer &b_rlay)
|
|
||||||
{
|
|
||||||
if (!session->copy_render_tile_from_device()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int2 tile_size = session->get_render_tile_size();
|
|
||||||
vector<float> pixels(tile_size.x * tile_size.y * 4);
|
|
||||||
|
|
||||||
/* Copy each pass. */
|
|
||||||
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
|
||||||
if (!session->get_render_tile_pixels(b_pass.name(), b_pass.channels(), &pixels[0])) {
|
|
||||||
memset(&pixels[0], 0, pixels.size() * sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
b_pass.rect(&pixels[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderSession::update_render_result(BL::RenderLayer &b_rlay)
|
|
||||||
{
|
|
||||||
if (!session->copy_render_tile_from_device()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int2 tile_size = session->get_render_tile_size();
|
|
||||||
vector<float> pixels(tile_size.x * tile_size.y * 4);
|
|
||||||
|
|
||||||
/* Copy combined pass. */
|
|
||||||
BL::RenderPass b_combined_pass(b_rlay.passes.find_by_name("Combined", b_rview_name.c_str()));
|
|
||||||
if (session->get_render_tile_pixels("Combined", b_combined_pass.channels(), &pixels[0])) {
|
|
||||||
b_combined_pass.rect(&pixels[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderSession::synchronize(BL::Depsgraph &b_depsgraph_)
|
void BlenderSession::synchronize(BL::Depsgraph &b_depsgraph_)
|
||||||
@@ -800,6 +670,8 @@ void BlenderSession::synchronize(BL::Depsgraph &b_depsgraph_)
|
|||||||
create_session();
|
create_session();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensure_display_driver_if_needed();
|
||||||
|
|
||||||
/* increase samples and render time, but never decrease */
|
/* increase samples and render time, but never decrease */
|
||||||
session->set_samples(session_params.samples);
|
session->set_samples(session_params.samples);
|
||||||
session->set_time_limit(session_params.time_limit);
|
session->set_time_limit(session_params.time_limit);
|
||||||
@@ -887,8 +759,10 @@ void BlenderSession::draw(BL::SpaceImageEditor &space_image)
|
|||||||
draw_state_.last_pass_index = pass_index;
|
draw_state_.last_pass_index = pass_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
BL::Array<float, 2> zoom = space_image.zoom();
|
if (display_driver_) {
|
||||||
gpu_display_->set_zoom(zoom[0], zoom[1]);
|
BL::Array<float, 2> zoom = space_image.zoom();
|
||||||
|
display_driver_->set_zoom(zoom[0], zoom[1]);
|
||||||
|
}
|
||||||
|
|
||||||
session->draw();
|
session->draw();
|
||||||
}
|
}
|
||||||
@@ -1035,20 +909,27 @@ void BlenderSession::update_status_progress()
|
|||||||
last_progress = progress;
|
last_progress = progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session->progress.get_error()) {
|
check_and_report_session_error();
|
||||||
string error = session->progress.get_error_message();
|
}
|
||||||
if (error != last_error) {
|
|
||||||
/* TODO(sergey): Currently C++ RNA API doesn't let us to
|
bool BlenderSession::check_and_report_session_error()
|
||||||
* use mnemonic name for the variable. Would be nice to
|
{
|
||||||
* have this figured out.
|
if (!session->progress.get_error()) {
|
||||||
*
|
return false;
|
||||||
* For until then, 1 << 5 means RPT_ERROR.
|
|
||||||
*/
|
|
||||||
b_engine.report(1 << 5, error.c_str());
|
|
||||||
b_engine.error_set(error.c_str());
|
|
||||||
last_error = error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const string error = session->progress.get_error_message();
|
||||||
|
if (error != last_error) {
|
||||||
|
/* TODO(sergey): Currently C++ RNA API doesn't let us to use mnemonic name for the variable.
|
||||||
|
* Would be nice to have this figured out.
|
||||||
|
*
|
||||||
|
* For until then, 1 << 5 means RPT_ERROR. */
|
||||||
|
b_engine.report(1 << 5, error.c_str());
|
||||||
|
b_engine.error_set(error.c_str());
|
||||||
|
last_error = error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderSession::tag_update()
|
void BlenderSession::tag_update()
|
||||||
@@ -1096,4 +977,27 @@ void BlenderSession::free_blender_memory_if_possible()
|
|||||||
b_engine.free_blender_memory();
|
b_engine.free_blender_memory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlenderSession::ensure_display_driver_if_needed()
|
||||||
|
{
|
||||||
|
if (display_driver_) {
|
||||||
|
/* Driver is already created. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (headless) {
|
||||||
|
/* No display needed for headless. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b_engine.is_preview()) {
|
||||||
|
/* TODO(sergey): Investigate whether DisplayDriver can be used for the preview as well. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
unique_ptr<BlenderDisplayDriver> display_driver = make_unique<BlenderDisplayDriver>(b_engine,
|
||||||
|
b_scene);
|
||||||
|
display_driver_ = display_driver.get();
|
||||||
|
session->set_display_driver(move(display_driver));
|
||||||
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
@@ -17,19 +17,21 @@
|
|||||||
#ifndef __BLENDER_SESSION_H__
|
#ifndef __BLENDER_SESSION_H__
|
||||||
#define __BLENDER_SESSION_H__
|
#define __BLENDER_SESSION_H__
|
||||||
|
|
||||||
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "RNA_blender_cpp.h"
|
#include "RNA_blender_cpp.h"
|
||||||
|
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
|
|
||||||
#include "render/bake.h"
|
#include "scene/bake.h"
|
||||||
#include "render/scene.h"
|
#include "scene/scene.h"
|
||||||
#include "render/session.h"
|
#include "session/session.h"
|
||||||
|
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
class BlenderGPUDisplay;
|
class BlenderDisplayDriver;
|
||||||
class BlenderSync;
|
class BlenderSync;
|
||||||
class ImageMetaData;
|
class ImageMetaData;
|
||||||
class Scene;
|
class Scene;
|
||||||
@@ -70,20 +72,7 @@ class BlenderSession {
|
|||||||
const int bake_width,
|
const int bake_width,
|
||||||
const int bake_height);
|
const int bake_height);
|
||||||
|
|
||||||
void write_render_result(BL::RenderLayer &b_rlay);
|
|
||||||
void write_render_tile();
|
|
||||||
|
|
||||||
void update_render_tile();
|
|
||||||
|
|
||||||
void full_buffer_written(string_view filename);
|
void full_buffer_written(string_view filename);
|
||||||
|
|
||||||
/* update functions are used to update display buffer only after sample was rendered
|
|
||||||
* only needed for better visual feedback */
|
|
||||||
void update_render_result(BL::RenderLayer &b_rlay);
|
|
||||||
|
|
||||||
/* read functions for baking input */
|
|
||||||
void read_render_tile();
|
|
||||||
|
|
||||||
/* interactive updates */
|
/* interactive updates */
|
||||||
void synchronize(BL::Depsgraph &b_depsgraph);
|
void synchronize(BL::Depsgraph &b_depsgraph);
|
||||||
|
|
||||||
@@ -110,8 +99,7 @@ class BlenderSession {
|
|||||||
BL::RenderSettings b_render;
|
BL::RenderSettings b_render;
|
||||||
BL::Depsgraph b_depsgraph;
|
BL::Depsgraph b_depsgraph;
|
||||||
/* NOTE: Blender's scene might become invalid after call
|
/* NOTE: Blender's scene might become invalid after call
|
||||||
* free_blender_memory_if_possible().
|
* #free_blender_memory_if_possible(). */
|
||||||
*/
|
|
||||||
BL::Scene b_scene;
|
BL::Scene b_scene;
|
||||||
BL::SpaceView3D b_v3d;
|
BL::SpaceView3D b_v3d;
|
||||||
BL::RegionView3D b_rv3d;
|
BL::RegionView3D b_rv3d;
|
||||||
@@ -147,6 +135,11 @@ class BlenderSession {
|
|||||||
protected:
|
protected:
|
||||||
void stamp_view_layer_metadata(Scene *scene, const string &view_layer_name);
|
void stamp_view_layer_metadata(Scene *scene, const string &view_layer_name);
|
||||||
|
|
||||||
|
/* Check whether session error happened.
|
||||||
|
* If so, it is reported to the render engine and true is returned.
|
||||||
|
* Otherwise false is returned. */
|
||||||
|
bool check_and_report_session_error();
|
||||||
|
|
||||||
void builtin_images_load();
|
void builtin_images_load();
|
||||||
|
|
||||||
/* Is used after each render layer synchronization is done with the goal
|
/* Is used after each render layer synchronization is done with the goal
|
||||||
@@ -155,13 +148,15 @@ class BlenderSession {
|
|||||||
*/
|
*/
|
||||||
void free_blender_memory_if_possible();
|
void free_blender_memory_if_possible();
|
||||||
|
|
||||||
|
void ensure_display_driver_if_needed();
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
thread_mutex mutex;
|
thread_mutex mutex;
|
||||||
int last_pass_index = -1;
|
int last_pass_index = -1;
|
||||||
} draw_state_;
|
} draw_state_;
|
||||||
|
|
||||||
/* NOTE: The BlenderSession references the GPU display. */
|
/* NOTE: The BlenderSession references the display driver. */
|
||||||
BlenderGPUDisplay *gpu_display_ = nullptr;
|
BlenderDisplayDriver *display_driver_ = nullptr;
|
||||||
|
|
||||||
vector<string> full_buffer_files_;
|
vector<string> full_buffer_files_;
|
||||||
};
|
};
|
@@ -14,26 +14,26 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/background.h"
|
#include "scene/shader.h"
|
||||||
#include "render/colorspace.h"
|
#include "scene/background.h"
|
||||||
#include "render/graph.h"
|
#include "scene/colorspace.h"
|
||||||
#include "render/integrator.h"
|
#include "scene/integrator.h"
|
||||||
#include "render/light.h"
|
#include "scene/light.h"
|
||||||
#include "render/nodes.h"
|
#include "scene/osl.h"
|
||||||
#include "render/osl.h"
|
#include "scene/scene.h"
|
||||||
#include "render/scene.h"
|
#include "scene/shader_graph.h"
|
||||||
#include "render/shader.h"
|
#include "scene/shader_nodes.h"
|
||||||
|
|
||||||
#include "blender/blender_image.h"
|
#include "blender/image.h"
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_texture.h"
|
#include "blender/texture.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_debug.h"
|
#include "util/debug.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_set.h"
|
#include "util/set.h"
|
||||||
#include "util/util_string.h"
|
#include "util/string.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
array<float3> curve_mapping_curves;
|
array<float3> curve_mapping_curves;
|
||||||
float min_x, max_x;
|
float min_x, max_x;
|
||||||
curvemapping_color_to_array(mapping, curve_mapping_curves, RAMP_TABLE_SIZE, true);
|
curvemapping_color_to_array(mapping, curve_mapping_curves, RAMP_TABLE_SIZE, true);
|
||||||
curvemapping_minmax(mapping, true, &min_x, &max_x);
|
curvemapping_minmax(mapping, 4, &min_x, &max_x);
|
||||||
curves->set_min_x(min_x);
|
curves->set_min_x(min_x);
|
||||||
curves->set_max_x(max_x);
|
curves->set_max_x(max_x);
|
||||||
curves->set_curves(curve_mapping_curves);
|
curves->set_curves(curve_mapping_curves);
|
||||||
@@ -292,12 +292,25 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
array<float3> curve_mapping_curves;
|
array<float3> curve_mapping_curves;
|
||||||
float min_x, max_x;
|
float min_x, max_x;
|
||||||
curvemapping_color_to_array(mapping, curve_mapping_curves, RAMP_TABLE_SIZE, false);
|
curvemapping_color_to_array(mapping, curve_mapping_curves, RAMP_TABLE_SIZE, false);
|
||||||
curvemapping_minmax(mapping, false, &min_x, &max_x);
|
curvemapping_minmax(mapping, 3, &min_x, &max_x);
|
||||||
curves->set_min_x(min_x);
|
curves->set_min_x(min_x);
|
||||||
curves->set_max_x(max_x);
|
curves->set_max_x(max_x);
|
||||||
curves->set_curves(curve_mapping_curves);
|
curves->set_curves(curve_mapping_curves);
|
||||||
node = curves;
|
node = curves;
|
||||||
}
|
}
|
||||||
|
else if (b_node.is_a(&RNA_ShaderNodeFloatCurve)) {
|
||||||
|
BL::ShaderNodeFloatCurve b_curve_node(b_node);
|
||||||
|
BL::CurveMapping mapping(b_curve_node.mapping());
|
||||||
|
FloatCurveNode *curve = graph->create_node<FloatCurveNode>();
|
||||||
|
array<float> curve_mapping_curve;
|
||||||
|
float min_x, max_x;
|
||||||
|
curvemapping_float_to_array(mapping, curve_mapping_curve, RAMP_TABLE_SIZE);
|
||||||
|
curvemapping_minmax(mapping, 1, &min_x, &max_x);
|
||||||
|
curve->set_min_x(min_x);
|
||||||
|
curve->set_max_x(max_x);
|
||||||
|
curve->set_curve(curve_mapping_curve);
|
||||||
|
node = curve;
|
||||||
|
}
|
||||||
else if (b_node.is_a(&RNA_ShaderNodeValToRGB)) {
|
else if (b_node.is_a(&RNA_ShaderNodeValToRGB)) {
|
||||||
RGBRampNode *ramp = graph->create_node<RGBRampNode>();
|
RGBRampNode *ramp = graph->create_node<RGBRampNode>();
|
||||||
BL::ShaderNodeValToRGB b_ramp_node(b_node);
|
BL::ShaderNodeValToRGB b_ramp_node(b_node);
|
||||||
@@ -476,6 +489,9 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
SubsurfaceScatteringNode *subsurface = graph->create_node<SubsurfaceScatteringNode>();
|
SubsurfaceScatteringNode *subsurface = graph->create_node<SubsurfaceScatteringNode>();
|
||||||
|
|
||||||
switch (b_subsurface_node.falloff()) {
|
switch (b_subsurface_node.falloff()) {
|
||||||
|
case BL::ShaderNodeSubsurfaceScattering::falloff_BURLEY:
|
||||||
|
subsurface->set_method(CLOSURE_BSSRDF_BURLEY_ID);
|
||||||
|
break;
|
||||||
case BL::ShaderNodeSubsurfaceScattering::falloff_RANDOM_WALK_FIXED_RADIUS:
|
case BL::ShaderNodeSubsurfaceScattering::falloff_RANDOM_WALK_FIXED_RADIUS:
|
||||||
subsurface->set_method(CLOSURE_BSSRDF_RANDOM_WALK_FIXED_RADIUS_ID);
|
subsurface->set_method(CLOSURE_BSSRDF_RANDOM_WALK_FIXED_RADIUS_ID);
|
||||||
break;
|
break;
|
||||||
@@ -592,6 +608,9 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (b_principled_node.subsurface_method()) {
|
switch (b_principled_node.subsurface_method()) {
|
||||||
|
case BL::ShaderNodeBsdfPrincipled::subsurface_method_BURLEY:
|
||||||
|
principled->set_subsurface_method(CLOSURE_BSSRDF_BURLEY_ID);
|
||||||
|
break;
|
||||||
case BL::ShaderNodeBsdfPrincipled::subsurface_method_RANDOM_WALK_FIXED_RADIUS:
|
case BL::ShaderNodeBsdfPrincipled::subsurface_method_RANDOM_WALK_FIXED_RADIUS:
|
||||||
principled->set_subsurface_method(CLOSURE_BSSRDF_RANDOM_WALK_FIXED_RADIUS_ID);
|
principled->set_subsurface_method(CLOSURE_BSSRDF_RANDOM_WALK_FIXED_RADIUS_ID);
|
||||||
break;
|
break;
|
||||||
@@ -1356,6 +1375,7 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
|
|||||||
{
|
{
|
||||||
Background *background = scene->background;
|
Background *background = scene->background;
|
||||||
Integrator *integrator = scene->integrator;
|
Integrator *integrator = scene->integrator;
|
||||||
|
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||||
|
|
||||||
BL::World b_world = b_scene.world();
|
BL::World b_world = b_scene.world();
|
||||||
|
|
||||||
@@ -1447,14 +1467,8 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
|
|||||||
graph->connect(background->output("Background"), out->input("Surface"));
|
graph->connect(background->output("Background"), out->input("Surface"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Visibility */
|
||||||
if (b_world) {
|
if (b_world) {
|
||||||
/* AO */
|
|
||||||
BL::WorldLighting b_light = b_world.light_settings();
|
|
||||||
|
|
||||||
integrator->set_ao_factor(b_light.ao_factor());
|
|
||||||
integrator->set_ao_distance(b_light.distance());
|
|
||||||
|
|
||||||
/* visibility */
|
|
||||||
PointerRNA cvisibility = RNA_pointer_get(&b_world.ptr, "cycles_visibility");
|
PointerRNA cvisibility = RNA_pointer_get(&b_world.ptr, "cycles_visibility");
|
||||||
uint visibility = 0;
|
uint visibility = 0;
|
||||||
|
|
||||||
@@ -1466,16 +1480,38 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
|
|||||||
|
|
||||||
background->set_visibility(visibility);
|
background->set_visibility(visibility);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
integrator->set_ao_factor(1.0f);
|
|
||||||
integrator->set_ao_distance(10.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
shader->set_graph(graph);
|
shader->set_graph(graph);
|
||||||
shader->tag_update(scene);
|
shader->tag_update(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
/* Fast GI */
|
||||||
|
if (b_world) {
|
||||||
|
BL::WorldLighting b_light = b_world.light_settings();
|
||||||
|
enum { FAST_GI_METHOD_REPLACE = 0, FAST_GI_METHOD_ADD = 1, FAST_GI_METHOD_NUM };
|
||||||
|
|
||||||
|
const bool use_fast_gi = get_boolean(cscene, "use_fast_gi");
|
||||||
|
if (use_fast_gi) {
|
||||||
|
const int fast_gi_method = get_enum(
|
||||||
|
cscene, "fast_gi_method", FAST_GI_METHOD_NUM, FAST_GI_METHOD_REPLACE);
|
||||||
|
integrator->set_ao_factor((fast_gi_method == FAST_GI_METHOD_REPLACE) ? b_light.ao_factor() :
|
||||||
|
0.0f);
|
||||||
|
integrator->set_ao_additive_factor(
|
||||||
|
(fast_gi_method == FAST_GI_METHOD_ADD) ? b_light.ao_factor() : 0.0f);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
integrator->set_ao_factor(0.0f);
|
||||||
|
integrator->set_ao_additive_factor(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
integrator->set_ao_distance(b_light.distance());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
integrator->set_ao_factor(0.0f);
|
||||||
|
integrator->set_ao_additive_factor(0.0f);
|
||||||
|
integrator->set_ao_distance(10.0f);
|
||||||
|
}
|
||||||
|
|
||||||
background->set_transparent(b_scene.render().film_transparent());
|
background->set_transparent(b_scene.render().film_transparent());
|
||||||
|
|
||||||
if (background->get_transparent()) {
|
if (background->get_transparent()) {
|
@@ -14,33 +14,33 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/background.h"
|
#include "scene/background.h"
|
||||||
#include "render/camera.h"
|
#include "scene/camera.h"
|
||||||
#include "render/curves.h"
|
#include "scene/curves.h"
|
||||||
#include "render/film.h"
|
#include "scene/film.h"
|
||||||
#include "render/graph.h"
|
#include "scene/integrator.h"
|
||||||
#include "render/integrator.h"
|
#include "scene/light.h"
|
||||||
#include "render/light.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/object.h"
|
||||||
#include "render/nodes.h"
|
#include "scene/procedural.h"
|
||||||
#include "render/object.h"
|
#include "scene/scene.h"
|
||||||
#include "render/procedural.h"
|
#include "scene/shader.h"
|
||||||
#include "render/scene.h"
|
#include "scene/shader_graph.h"
|
||||||
#include "render/shader.h"
|
#include "scene/shader_nodes.h"
|
||||||
|
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
|
|
||||||
#include "blender/blender_device.h"
|
#include "blender/device.h"
|
||||||
#include "blender/blender_session.h"
|
#include "blender/session.h"
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "util/util_debug.h"
|
#include "util/debug.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_hash.h"
|
#include "util/hash.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_opengl.h"
|
#include "util/opengl.h"
|
||||||
#include "util/util_openimagedenoise.h"
|
#include "util/openimagedenoise.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -183,6 +183,15 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
|||||||
(object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE)) {
|
(object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE)) {
|
||||||
BL::ID key = BKE_object_is_modified(b_ob) ? b_ob : b_ob.data();
|
BL::ID key = BKE_object_is_modified(b_ob) ? b_ob : b_ob.data();
|
||||||
geometry_map.set_recalc(key);
|
geometry_map.set_recalc(key);
|
||||||
|
|
||||||
|
/* Sync all contained geometry instances as well when the object changed.. */
|
||||||
|
map<void *, set<BL::ID>>::const_iterator instance_geometries =
|
||||||
|
instance_geometries_by_object.find(b_ob.ptr.data);
|
||||||
|
if (instance_geometries != instance_geometries_by_object.end()) {
|
||||||
|
for (BL::ID geometry : instance_geometries->second) {
|
||||||
|
geometry_map.set_recalc(geometry);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updated_geometry) {
|
if (updated_geometry) {
|
||||||
@@ -340,18 +349,37 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
|
|||||||
cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_SOBOL);
|
cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_SOBOL);
|
||||||
integrator->set_sampling_pattern(sampling_pattern);
|
integrator->set_sampling_pattern(sampling_pattern);
|
||||||
|
|
||||||
|
bool use_adaptive_sampling = false;
|
||||||
if (preview) {
|
if (preview) {
|
||||||
integrator->set_use_adaptive_sampling(
|
use_adaptive_sampling = RNA_boolean_get(&cscene, "use_preview_adaptive_sampling");
|
||||||
RNA_boolean_get(&cscene, "use_preview_adaptive_sampling"));
|
integrator->set_use_adaptive_sampling(use_adaptive_sampling);
|
||||||
integrator->set_adaptive_threshold(get_float(cscene, "preview_adaptive_threshold"));
|
integrator->set_adaptive_threshold(get_float(cscene, "preview_adaptive_threshold"));
|
||||||
integrator->set_adaptive_min_samples(get_int(cscene, "preview_adaptive_min_samples"));
|
integrator->set_adaptive_min_samples(get_int(cscene, "preview_adaptive_min_samples"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
integrator->set_use_adaptive_sampling(RNA_boolean_get(&cscene, "use_adaptive_sampling"));
|
use_adaptive_sampling = RNA_boolean_get(&cscene, "use_adaptive_sampling");
|
||||||
|
integrator->set_use_adaptive_sampling(use_adaptive_sampling);
|
||||||
integrator->set_adaptive_threshold(get_float(cscene, "adaptive_threshold"));
|
integrator->set_adaptive_threshold(get_float(cscene, "adaptive_threshold"));
|
||||||
integrator->set_adaptive_min_samples(get_int(cscene, "adaptive_min_samples"));
|
integrator->set_adaptive_min_samples(get_int(cscene, "adaptive_min_samples"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int samples = get_int(cscene, "samples");
|
||||||
|
float scrambling_distance = get_float(cscene, "scrambling_distance");
|
||||||
|
bool adaptive_scrambling_distance = get_boolean(cscene, "adaptive_scrambling_distance");
|
||||||
|
if (adaptive_scrambling_distance) {
|
||||||
|
scrambling_distance *= 4.0f / sqrtf(samples);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* only use scrambling distance in the viewport if user wants to and disable with AS */
|
||||||
|
bool preview_scrambling_distance = get_boolean(cscene, "preview_scrambling_distance");
|
||||||
|
if ((preview && !preview_scrambling_distance) || use_adaptive_sampling)
|
||||||
|
scrambling_distance = 1.0f;
|
||||||
|
|
||||||
|
if (scrambling_distance != 1.0f) {
|
||||||
|
VLOG(3) << "Using scrambling distance: " << scrambling_distance;
|
||||||
|
}
|
||||||
|
integrator->set_scrambling_distance(scrambling_distance);
|
||||||
|
|
||||||
if (get_boolean(cscene, "use_fast_gi")) {
|
if (get_boolean(cscene, "use_fast_gi")) {
|
||||||
if (preview) {
|
if (preview) {
|
||||||
integrator->set_ao_bounces(get_int(cscene, "ao_bounces"));
|
integrator->set_ao_bounces(get_int(cscene, "ao_bounces"));
|
||||||
@@ -541,12 +569,11 @@ static PassType get_blender_pass_type(BL::RenderPass &b_pass)
|
|||||||
|
|
||||||
MAP_PASS("Denoising Normal", PASS_DENOISING_NORMAL);
|
MAP_PASS("Denoising Normal", PASS_DENOISING_NORMAL);
|
||||||
MAP_PASS("Denoising Albedo", PASS_DENOISING_ALBEDO);
|
MAP_PASS("Denoising Albedo", PASS_DENOISING_ALBEDO);
|
||||||
|
MAP_PASS("Denoising Depth", PASS_DENOISING_DEPTH);
|
||||||
|
|
||||||
MAP_PASS("Shadow Catcher", PASS_SHADOW_CATCHER);
|
MAP_PASS("Shadow Catcher", PASS_SHADOW_CATCHER);
|
||||||
MAP_PASS("Noisy Shadow Catcher", PASS_SHADOW_CATCHER);
|
MAP_PASS("Noisy Shadow Catcher", PASS_SHADOW_CATCHER);
|
||||||
|
|
||||||
MAP_PASS("Debug Render Time", PASS_RENDER_TIME);
|
|
||||||
|
|
||||||
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
|
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
|
||||||
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
|
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
|
||||||
|
|
||||||
@@ -604,10 +631,6 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
|
|||||||
PointerRNA crl = RNA_pointer_get(&b_view_layer.ptr, "cycles");
|
PointerRNA crl = RNA_pointer_get(&b_view_layer.ptr, "cycles");
|
||||||
|
|
||||||
/* Debug passes. */
|
/* Debug passes. */
|
||||||
if (get_boolean(crl, "pass_debug_render_time")) {
|
|
||||||
b_engine.add_pass("Debug Render Time", 1, "X", b_view_layer.name().c_str());
|
|
||||||
pass_add(scene, PASS_RENDER_TIME, "Debug Render Time");
|
|
||||||
}
|
|
||||||
if (get_boolean(crl, "pass_debug_sample_count")) {
|
if (get_boolean(crl, "pass_debug_sample_count")) {
|
||||||
b_engine.add_pass("Debug Sample Count", 1, "X", b_view_layer.name().c_str());
|
b_engine.add_pass("Debug Sample Count", 1, "X", b_view_layer.name().c_str());
|
||||||
pass_add(scene, PASS_SAMPLE_COUNT, "Debug Sample Count");
|
pass_add(scene, PASS_SAMPLE_COUNT, "Debug Sample Count");
|
||||||
@@ -676,6 +699,9 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
|
|||||||
|
|
||||||
b_engine.add_pass("Denoising Albedo", 3, "RGB", b_view_layer.name().c_str());
|
b_engine.add_pass("Denoising Albedo", 3, "RGB", b_view_layer.name().c_str());
|
||||||
pass_add(scene, PASS_DENOISING_ALBEDO, "Denoising Albedo", PassMode::NOISY);
|
pass_add(scene, PASS_DENOISING_ALBEDO, "Denoising Albedo", PassMode::NOISY);
|
||||||
|
|
||||||
|
b_engine.add_pass("Denoising Depth", 1, "Z", b_view_layer.name().c_str());
|
||||||
|
pass_add(scene, PASS_DENOISING_DEPTH, "Denoising Depth", PassMode::NOISY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Custom AOV passes. */
|
/* Custom AOV passes. */
|
@@ -22,17 +22,17 @@
|
|||||||
#include "RNA_blender_cpp.h"
|
#include "RNA_blender_cpp.h"
|
||||||
#include "RNA_types.h"
|
#include "RNA_types.h"
|
||||||
|
|
||||||
#include "blender/blender_id_map.h"
|
#include "blender/id_map.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
#include "blender/blender_viewport.h"
|
#include "blender/viewport.h"
|
||||||
|
|
||||||
#include "render/scene.h"
|
#include "scene/scene.h"
|
||||||
#include "render/session.h"
|
#include "session/session.h"
|
||||||
|
|
||||||
#include "util/util_map.h"
|
#include "util/map.h"
|
||||||
#include "util/util_set.h"
|
#include "util/set.h"
|
||||||
#include "util/util_transform.h"
|
#include "util/transform.h"
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -225,6 +225,8 @@ class BlenderSync {
|
|||||||
set<Geometry *> geometry_synced;
|
set<Geometry *> geometry_synced;
|
||||||
set<Geometry *> geometry_motion_synced;
|
set<Geometry *> geometry_motion_synced;
|
||||||
set<Geometry *> geometry_motion_attribute_synced;
|
set<Geometry *> geometry_motion_attribute_synced;
|
||||||
|
/** Remember which geometries come from which objects to be able to sync them after changes. */
|
||||||
|
map<void *, set<BL::ID>> instance_geometries_by_object;
|
||||||
set<float> motion_times;
|
set<float> motion_times;
|
||||||
void *world_map;
|
void *world_map;
|
||||||
bool world_recalc;
|
bool world_recalc;
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blender/blender_texture.h"
|
#include "blender/texture.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -17,7 +17,7 @@
|
|||||||
#ifndef __BLENDER_TEXTURE_H__
|
#ifndef __BLENDER_TEXTURE_H__
|
||||||
#define __BLENDER_TEXTURE_H__
|
#define __BLENDER_TEXTURE_H__
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
@@ -17,16 +17,16 @@
|
|||||||
#ifndef __BLENDER_UTIL_H__
|
#ifndef __BLENDER_UTIL_H__
|
||||||
#define __BLENDER_UTIL_H__
|
#define __BLENDER_UTIL_H__
|
||||||
|
|
||||||
#include "render/mesh.h"
|
#include "scene/mesh.h"
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/util_array.h"
|
#include "util/array.h"
|
||||||
#include "util/util_map.h"
|
#include "util/map.h"
|
||||||
#include "util/util_path.h"
|
#include "util/path.h"
|
||||||
#include "util/util_set.h"
|
#include "util/set.h"
|
||||||
#include "util/util_transform.h"
|
#include "util/transform.h"
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
/* Hacks to hook into Blender API
|
/* Hacks to hook into Blender API
|
||||||
* todo: clean this up ... */
|
* todo: clean this up ... */
|
||||||
@@ -90,26 +90,27 @@ static inline BL::Mesh object_to_mesh(BL::BlendData & /*data*/,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BL::Mesh mesh(PointerRNA_NULL);
|
BL::Mesh mesh = (b_ob_info.object_data.is_a(&RNA_Mesh)) ? BL::Mesh(b_ob_info.object_data) :
|
||||||
if (b_ob_info.object_data.is_a(&RNA_Mesh)) {
|
BL::Mesh(PointerRNA_NULL);
|
||||||
/* TODO: calc_undeformed is not used. */
|
|
||||||
mesh = BL::Mesh(b_ob_info.object_data);
|
|
||||||
|
|
||||||
/* Make a copy to split faces if we use autosmooth, otherwise not needed.
|
if (b_ob_info.is_real_object_data()) {
|
||||||
* Also in edit mode do we need to make a copy, to ensure data layers like
|
if (mesh) {
|
||||||
* UV are not empty. */
|
/* Make a copy to split faces if we use autosmooth, otherwise not needed.
|
||||||
if (mesh.is_editmode() ||
|
* Also in edit mode do we need to make a copy, to ensure data layers like
|
||||||
(mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE)) {
|
* UV are not empty. */
|
||||||
|
if (mesh.is_editmode() ||
|
||||||
|
(mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE)) {
|
||||||
|
BL::Depsgraph depsgraph(PointerRNA_NULL);
|
||||||
|
mesh = b_ob_info.real_object.to_mesh(false, depsgraph);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
BL::Depsgraph depsgraph(PointerRNA_NULL);
|
BL::Depsgraph depsgraph(PointerRNA_NULL);
|
||||||
assert(b_ob_info.is_real_object_data());
|
|
||||||
mesh = b_ob_info.real_object.to_mesh(false, depsgraph);
|
mesh = b_ob_info.real_object.to_mesh(false, depsgraph);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BL::Depsgraph depsgraph(PointerRNA_NULL);
|
/* TODO: what to do about non-mesh geometry instances? */
|
||||||
if (b_ob_info.is_real_object_data()) {
|
|
||||||
mesh = b_ob_info.real_object.to_mesh(false, depsgraph);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -170,12 +171,11 @@ static inline void curvemap_minmax_curve(/*const*/ BL::CurveMap &curve, float *m
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void curvemapping_minmax(/*const*/ BL::CurveMapping &cumap,
|
static inline void curvemapping_minmax(/*const*/ BL::CurveMapping &cumap,
|
||||||
bool rgb_curve,
|
int num_curves,
|
||||||
float *min_x,
|
float *min_x,
|
||||||
float *max_x)
|
float *max_x)
|
||||||
{
|
{
|
||||||
// const int num_curves = cumap.curves.length(); /* Gives linking error so far. */
|
// const int num_curves = cumap.curves.length(); /* Gives linking error so far. */
|
||||||
const int num_curves = rgb_curve ? 4 : 3;
|
|
||||||
*min_x = FLT_MAX;
|
*min_x = FLT_MAX;
|
||||||
*max_x = -FLT_MAX;
|
*max_x = -FLT_MAX;
|
||||||
for (int i = 0; i < num_curves; ++i) {
|
for (int i = 0; i < num_curves; ++i) {
|
||||||
@@ -195,6 +195,28 @@ static inline void curvemapping_to_array(BL::CurveMapping &cumap, array<float> &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void curvemapping_float_to_array(BL::CurveMapping &cumap,
|
||||||
|
array<float> &data,
|
||||||
|
int size)
|
||||||
|
{
|
||||||
|
float min = 0.0f, max = 1.0f;
|
||||||
|
|
||||||
|
curvemapping_minmax(cumap, 1, &min, &max);
|
||||||
|
|
||||||
|
const float range = max - min;
|
||||||
|
|
||||||
|
cumap.update();
|
||||||
|
|
||||||
|
BL::CurveMap map = cumap.curves[0];
|
||||||
|
|
||||||
|
data.resize(size);
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
float t = min + (float)i / (float)(size - 1) * range;
|
||||||
|
data[i] = cumap.evaluate(map, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline void curvemapping_color_to_array(BL::CurveMapping &cumap,
|
static inline void curvemapping_color_to_array(BL::CurveMapping &cumap,
|
||||||
array<float3> &data,
|
array<float3> &data,
|
||||||
int size,
|
int size,
|
||||||
@@ -213,7 +235,8 @@ static inline void curvemapping_color_to_array(BL::CurveMapping &cumap,
|
|||||||
*
|
*
|
||||||
* There might be some better estimations here tho.
|
* There might be some better estimations here tho.
|
||||||
*/
|
*/
|
||||||
curvemapping_minmax(cumap, rgb_curve, &min_x, &max_x);
|
const int num_curves = rgb_curve ? 4 : 3;
|
||||||
|
curvemapping_minmax(cumap, num_curves, &min_x, &max_x);
|
||||||
|
|
||||||
const float range_x = max_x - min_x;
|
const float range_x = max_x - min_x;
|
||||||
|
|
@@ -14,11 +14,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blender_viewport.h"
|
#include "blender/viewport.h"
|
||||||
|
#include "blender/util.h"
|
||||||
|
|
||||||
#include "blender_util.h"
|
#include "scene/pass.h"
|
||||||
#include "render/pass.h"
|
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -23,7 +23,7 @@
|
|||||||
#include "RNA_blender_cpp.h"
|
#include "RNA_blender_cpp.h"
|
||||||
#include "RNA_types.h"
|
#include "RNA_types.h"
|
||||||
|
|
||||||
#include "render/film.h"
|
#include "scene/film.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -14,14 +14,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render/colorspace.h"
|
#include "scene/volume.h"
|
||||||
#include "render/image.h"
|
#include "scene/colorspace.h"
|
||||||
#include "render/image_vdb.h"
|
#include "scene/image.h"
|
||||||
#include "render/object.h"
|
#include "scene/image_vdb.h"
|
||||||
#include "render/volume.h"
|
#include "scene/object.h"
|
||||||
|
|
||||||
#include "blender/blender_sync.h"
|
#include "blender/sync.h"
|
||||||
#include "blender/blender_util.h"
|
#include "blender/util.h"
|
||||||
|
|
||||||
#ifdef WITH_OPENVDB
|
#ifdef WITH_OPENVDB
|
||||||
# include <openvdb/openvdb.h>
|
# include <openvdb/openvdb.h>
|
@@ -22,34 +22,34 @@ set(INC_SYS
|
|||||||
set(SRC
|
set(SRC
|
||||||
bvh.cpp
|
bvh.cpp
|
||||||
bvh2.cpp
|
bvh2.cpp
|
||||||
bvh_binning.cpp
|
binning.cpp
|
||||||
bvh_build.cpp
|
build.cpp
|
||||||
bvh_embree.cpp
|
embree.cpp
|
||||||
bvh_multi.cpp
|
multi.cpp
|
||||||
bvh_node.cpp
|
node.cpp
|
||||||
bvh_optix.cpp
|
optix.cpp
|
||||||
bvh_sort.cpp
|
sort.cpp
|
||||||
bvh_split.cpp
|
split.cpp
|
||||||
bvh_unaligned.cpp
|
unaligned.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SRC_HEADERS
|
set(SRC_HEADERS
|
||||||
bvh.h
|
bvh.h
|
||||||
bvh2.h
|
bvh2.h
|
||||||
bvh_binning.h
|
binning.h
|
||||||
bvh_build.h
|
build.h
|
||||||
bvh_embree.h
|
embree.h
|
||||||
bvh_multi.h
|
multi.h
|
||||||
bvh_node.h
|
node.h
|
||||||
bvh_optix.h
|
optix.h
|
||||||
bvh_params.h
|
params.h
|
||||||
bvh_sort.h
|
sort.h
|
||||||
bvh_split.h
|
split.h
|
||||||
bvh_unaligned.h
|
unaligned.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIB
|
set(LIB
|
||||||
cycles_render
|
cycles_scene
|
||||||
cycles_util
|
cycles_util
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
//#define __KERNEL_SSE__
|
//#define __KERNEL_SSE__
|
||||||
|
|
||||||
#include "bvh/bvh_binning.h"
|
#include "bvh/binning.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/util_boundbox.h"
|
#include "util/boundbox.h"
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,10 +18,10 @@
|
|||||||
#ifndef __BVH_BINNING_H__
|
#ifndef __BVH_BINNING_H__
|
||||||
#define __BVH_BINNING_H__
|
#define __BVH_BINNING_H__
|
||||||
|
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
#include "bvh/bvh_unaligned.h"
|
#include "bvh/unaligned.h"
|
||||||
|
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -15,27 +15,27 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bvh/bvh_build.h"
|
#include "bvh/build.h"
|
||||||
|
|
||||||
#include "bvh/bvh_binning.h"
|
#include "bvh/binning.h"
|
||||||
#include "bvh/bvh_node.h"
|
#include "bvh/node.h"
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
#include "bvh_split.h"
|
#include "bvh/split.h"
|
||||||
|
|
||||||
#include "render/curves.h"
|
#include "scene/curves.h"
|
||||||
#include "render/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/object.h"
|
#include "scene/object.h"
|
||||||
#include "render/scene.h"
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/progress.h"
|
||||||
#include "util/util_queue.h"
|
#include "util/queue.h"
|
||||||
#include "util/util_simd.h"
|
#include "util/simd.h"
|
||||||
#include "util/util_stack_allocator.h"
|
#include "util/stack_allocator.h"
|
||||||
#include "util/util_time.h"
|
#include "util/time.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -67,8 +67,12 @@ BVHBuild::~BVHBuild()
|
|||||||
|
|
||||||
/* Adding References */
|
/* Adding References */
|
||||||
|
|
||||||
void BVHBuild::add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *mesh, int i)
|
void BVHBuild::add_reference_triangles(BoundBox &root,
|
||||||
|
BoundBox ¢er,
|
||||||
|
Mesh *mesh,
|
||||||
|
int object_index)
|
||||||
{
|
{
|
||||||
|
const PrimitiveType primitive_type = mesh->primitive_type();
|
||||||
const Attribute *attr_mP = NULL;
|
const Attribute *attr_mP = NULL;
|
||||||
if (mesh->has_motion_blur()) {
|
if (mesh->has_motion_blur()) {
|
||||||
attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
@@ -81,7 +85,7 @@ void BVHBuild::add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *m
|
|||||||
BoundBox bounds = BoundBox::empty;
|
BoundBox bounds = BoundBox::empty;
|
||||||
t.bounds_grow(verts, bounds);
|
t.bounds_grow(verts, bounds);
|
||||||
if (bounds.valid() && t.valid(verts)) {
|
if (bounds.valid() && t.valid(verts)) {
|
||||||
references.push_back(BVHReference(bounds, j, i, PRIMITIVE_TRIANGLE));
|
references.push_back(BVHReference(bounds, j, object_index, primitive_type));
|
||||||
root.grow(bounds);
|
root.grow(bounds);
|
||||||
center.grow(bounds.center2());
|
center.grow(bounds.center2());
|
||||||
}
|
}
|
||||||
@@ -101,7 +105,7 @@ void BVHBuild::add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *m
|
|||||||
t.bounds_grow(vert_steps + step * num_verts, bounds);
|
t.bounds_grow(vert_steps + step * num_verts, bounds);
|
||||||
}
|
}
|
||||||
if (bounds.valid()) {
|
if (bounds.valid()) {
|
||||||
references.push_back(BVHReference(bounds, j, i, PRIMITIVE_MOTION_TRIANGLE));
|
references.push_back(BVHReference(bounds, j, object_index, primitive_type));
|
||||||
root.grow(bounds);
|
root.grow(bounds);
|
||||||
center.grow(bounds.center2());
|
center.grow(bounds.center2());
|
||||||
}
|
}
|
||||||
@@ -140,7 +144,7 @@ void BVHBuild::add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *m
|
|||||||
if (bounds.valid()) {
|
if (bounds.valid()) {
|
||||||
const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1;
|
const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1;
|
||||||
references.push_back(
|
references.push_back(
|
||||||
BVHReference(bounds, j, i, PRIMITIVE_MOTION_TRIANGLE, prev_time, curr_time));
|
BVHReference(bounds, j, object_index, primitive_type, prev_time, curr_time));
|
||||||
root.grow(bounds);
|
root.grow(bounds);
|
||||||
center.grow(bounds.center2());
|
center.grow(bounds.center2());
|
||||||
}
|
}
|
||||||
@@ -153,18 +157,14 @@ void BVHBuild::add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair, int i)
|
void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair, int object_index)
|
||||||
{
|
{
|
||||||
const Attribute *curve_attr_mP = NULL;
|
const Attribute *curve_attr_mP = NULL;
|
||||||
if (hair->has_motion_blur()) {
|
if (hair->has_motion_blur()) {
|
||||||
curve_attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
curve_attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
}
|
}
|
||||||
|
|
||||||
const PrimitiveType primitive_type =
|
const PrimitiveType primitive_type = hair->primitive_type();
|
||||||
(curve_attr_mP != NULL) ?
|
|
||||||
((hair->curve_shape == CURVE_RIBBON) ? PRIMITIVE_MOTION_CURVE_RIBBON :
|
|
||||||
PRIMITIVE_MOTION_CURVE_THICK) :
|
|
||||||
((hair->curve_shape == CURVE_RIBBON) ? PRIMITIVE_CURVE_RIBBON : PRIMITIVE_CURVE_THICK);
|
|
||||||
|
|
||||||
const size_t num_curves = hair->num_curves();
|
const size_t num_curves = hair->num_curves();
|
||||||
for (uint j = 0; j < num_curves; j++) {
|
for (uint j = 0; j < num_curves; j++) {
|
||||||
@@ -177,7 +177,7 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair
|
|||||||
curve.bounds_grow(k, &hair->get_curve_keys()[0], curve_radius, bounds);
|
curve.bounds_grow(k, &hair->get_curve_keys()[0], curve_radius, bounds);
|
||||||
if (bounds.valid()) {
|
if (bounds.valid()) {
|
||||||
int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k);
|
int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k);
|
||||||
references.push_back(BVHReference(bounds, j, i, packed_type));
|
references.push_back(BVHReference(bounds, j, object_index, packed_type));
|
||||||
root.grow(bounds);
|
root.grow(bounds);
|
||||||
center.grow(bounds.center2());
|
center.grow(bounds.center2());
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair
|
|||||||
}
|
}
|
||||||
if (bounds.valid()) {
|
if (bounds.valid()) {
|
||||||
int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k);
|
int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k);
|
||||||
references.push_back(BVHReference(bounds, j, i, packed_type));
|
references.push_back(BVHReference(bounds, j, object_index, packed_type));
|
||||||
root.grow(bounds);
|
root.grow(bounds);
|
||||||
center.grow(bounds.center2());
|
center.grow(bounds.center2());
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,8 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair
|
|||||||
if (bounds.valid()) {
|
if (bounds.valid()) {
|
||||||
const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1;
|
const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1;
|
||||||
int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k);
|
int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k);
|
||||||
references.push_back(BVHReference(bounds, j, i, packed_type, prev_time, curr_time));
|
references.push_back(
|
||||||
|
BVHReference(bounds, j, object_index, packed_type, prev_time, curr_time));
|
||||||
root.grow(bounds);
|
root.grow(bounds);
|
||||||
center.grow(bounds.center2());
|
center.grow(bounds.center2());
|
||||||
}
|
}
|
||||||
@@ -268,15 +269,18 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BVHBuild::add_reference_geometry(BoundBox &root, BoundBox ¢er, Geometry *geom, int i)
|
void BVHBuild::add_reference_geometry(BoundBox &root,
|
||||||
|
BoundBox ¢er,
|
||||||
|
Geometry *geom,
|
||||||
|
int object_index)
|
||||||
{
|
{
|
||||||
if (geom->geometry_type == Geometry::MESH || geom->geometry_type == Geometry::VOLUME) {
|
if (geom->geometry_type == Geometry::MESH || geom->geometry_type == Geometry::VOLUME) {
|
||||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||||
add_reference_triangles(root, center, mesh, i);
|
add_reference_triangles(root, center, mesh, object_index);
|
||||||
}
|
}
|
||||||
else if (geom->geometry_type == Geometry::HAIR) {
|
else if (geom->geometry_type == Geometry::HAIR) {
|
||||||
Hair *hair = static_cast<Hair *>(geom);
|
Hair *hair = static_cast<Hair *>(geom);
|
||||||
add_reference_curves(root, center, hair, i);
|
add_reference_curves(root, center, hair, object_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@@ -20,12 +20,12 @@
|
|||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
#include "bvh/bvh_unaligned.h"
|
#include "bvh/unaligned.h"
|
||||||
|
|
||||||
#include "util/util_array.h"
|
#include "util/array.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,12 +18,12 @@
|
|||||||
#include "bvh/bvh.h"
|
#include "bvh/bvh.h"
|
||||||
|
|
||||||
#include "bvh/bvh2.h"
|
#include "bvh/bvh2.h"
|
||||||
#include "bvh/bvh_embree.h"
|
#include "bvh/embree.h"
|
||||||
#include "bvh/bvh_multi.h"
|
#include "bvh/multi.h"
|
||||||
#include "bvh/bvh_optix.h"
|
#include "bvh/optix.h"
|
||||||
|
|
||||||
#include "util/util_logging.h"
|
#include "util/log.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/progress.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
@@ -18,10 +18,10 @@
|
|||||||
#ifndef __BVH_H__
|
#ifndef __BVH_H__
|
||||||
#define __BVH_H__
|
#define __BVH_H__
|
||||||
|
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
#include "util/util_array.h"
|
#include "util/array.h"
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -50,13 +50,9 @@ struct PackedBVH {
|
|||||||
array<int4> leaf_nodes;
|
array<int4> leaf_nodes;
|
||||||
/* object index to BVH node index mapping for instances */
|
/* object index to BVH node index mapping for instances */
|
||||||
array<int> object_node;
|
array<int> object_node;
|
||||||
/* Mapping from primitive index to index in triangle array. */
|
|
||||||
array<uint> prim_tri_index;
|
|
||||||
/* Continuous storage of triangle vertices. */
|
|
||||||
array<float4> prim_tri_verts;
|
|
||||||
/* primitive type - triangle or strand */
|
/* primitive type - triangle or strand */
|
||||||
array<int> prim_type;
|
array<int> prim_type;
|
||||||
/* visibility visibilitys for primitives */
|
/* Visibility visibilities for primitives. */
|
||||||
array<uint> prim_visibility;
|
array<uint> prim_visibility;
|
||||||
/* mapping from BVH primitive index to true primitive index, as primitives
|
/* mapping from BVH primitive index to true primitive index, as primitives
|
||||||
* may be duplicated due to spatial splits. -1 for instances. */
|
* may be duplicated due to spatial splits. -1 for instances. */
|
||||||
|
@@ -17,16 +17,16 @@
|
|||||||
|
|
||||||
#include "bvh/bvh2.h"
|
#include "bvh/bvh2.h"
|
||||||
|
|
||||||
#include "render/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/object.h"
|
#include "scene/object.h"
|
||||||
|
|
||||||
#include "bvh/bvh_build.h"
|
#include "bvh/build.h"
|
||||||
#include "bvh/bvh_node.h"
|
#include "bvh/node.h"
|
||||||
#include "bvh/bvh_unaligned.h"
|
#include "bvh/unaligned.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/progress.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -439,61 +439,20 @@ void BVH2::refit_primitives(int start, int end, BoundBox &bbox, uint &visibility
|
|||||||
|
|
||||||
/* Triangles */
|
/* Triangles */
|
||||||
|
|
||||||
void BVH2::pack_triangle(int idx, float4 tri_verts[3])
|
|
||||||
{
|
|
||||||
int tob = pack.prim_object[idx];
|
|
||||||
assert(tob >= 0 && tob < objects.size());
|
|
||||||
const Mesh *mesh = static_cast<const Mesh *>(objects[tob]->get_geometry());
|
|
||||||
|
|
||||||
int tidx = pack.prim_index[idx];
|
|
||||||
Mesh::Triangle t = mesh->get_triangle(tidx);
|
|
||||||
const float3 *vpos = &mesh->verts[0];
|
|
||||||
float3 v0 = vpos[t.v[0]];
|
|
||||||
float3 v1 = vpos[t.v[1]];
|
|
||||||
float3 v2 = vpos[t.v[2]];
|
|
||||||
|
|
||||||
tri_verts[0] = float3_to_float4(v0);
|
|
||||||
tri_verts[1] = float3_to_float4(v1);
|
|
||||||
tri_verts[2] = float3_to_float4(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BVH2::pack_primitives()
|
void BVH2::pack_primitives()
|
||||||
{
|
{
|
||||||
const size_t tidx_size = pack.prim_index.size();
|
const size_t tidx_size = pack.prim_index.size();
|
||||||
size_t num_prim_triangles = 0;
|
|
||||||
/* Count number of triangles primitives in BVH. */
|
|
||||||
for (unsigned int i = 0; i < tidx_size; i++) {
|
|
||||||
if ((pack.prim_index[i] != -1)) {
|
|
||||||
if ((pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE) != 0) {
|
|
||||||
++num_prim_triangles;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Reserve size for arrays. */
|
/* Reserve size for arrays. */
|
||||||
pack.prim_tri_index.clear();
|
|
||||||
pack.prim_tri_index.resize(tidx_size);
|
|
||||||
pack.prim_tri_verts.clear();
|
|
||||||
pack.prim_tri_verts.resize(num_prim_triangles * 3);
|
|
||||||
pack.prim_visibility.clear();
|
pack.prim_visibility.clear();
|
||||||
pack.prim_visibility.resize(tidx_size);
|
pack.prim_visibility.resize(tidx_size);
|
||||||
/* Fill in all the arrays. */
|
/* Fill in all the arrays. */
|
||||||
size_t prim_triangle_index = 0;
|
|
||||||
for (unsigned int i = 0; i < tidx_size; i++) {
|
for (unsigned int i = 0; i < tidx_size; i++) {
|
||||||
if (pack.prim_index[i] != -1) {
|
if (pack.prim_index[i] != -1) {
|
||||||
int tob = pack.prim_object[i];
|
int tob = pack.prim_object[i];
|
||||||
Object *ob = objects[tob];
|
Object *ob = objects[tob];
|
||||||
if ((pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE) != 0) {
|
|
||||||
pack_triangle(i, (float4 *)&pack.prim_tri_verts[3 * prim_triangle_index]);
|
|
||||||
pack.prim_tri_index[i] = 3 * prim_triangle_index;
|
|
||||||
++prim_triangle_index;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pack.prim_tri_index[i] = -1;
|
|
||||||
}
|
|
||||||
pack.prim_visibility[i] = ob->visibility_for_tracing();
|
pack.prim_visibility[i] = ob->visibility_for_tracing();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pack.prim_tri_index[i] = -1;
|
|
||||||
pack.prim_visibility[i] = 0;
|
pack.prim_visibility[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -522,10 +481,8 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
|
|
||||||
/* reserve */
|
/* reserve */
|
||||||
size_t prim_index_size = pack.prim_index.size();
|
size_t prim_index_size = pack.prim_index.size();
|
||||||
size_t prim_tri_verts_size = pack.prim_tri_verts.size();
|
|
||||||
|
|
||||||
size_t pack_prim_index_offset = prim_index_size;
|
size_t pack_prim_index_offset = prim_index_size;
|
||||||
size_t pack_prim_tri_verts_offset = prim_tri_verts_size;
|
|
||||||
size_t pack_nodes_offset = nodes_size;
|
size_t pack_nodes_offset = nodes_size;
|
||||||
size_t pack_leaf_nodes_offset = leaf_nodes_size;
|
size_t pack_leaf_nodes_offset = leaf_nodes_size;
|
||||||
size_t object_offset = 0;
|
size_t object_offset = 0;
|
||||||
@@ -535,7 +492,6 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
|
|
||||||
if (geom->need_build_bvh(params.bvh_layout)) {
|
if (geom->need_build_bvh(params.bvh_layout)) {
|
||||||
prim_index_size += bvh->pack.prim_index.size();
|
prim_index_size += bvh->pack.prim_index.size();
|
||||||
prim_tri_verts_size += bvh->pack.prim_tri_verts.size();
|
|
||||||
nodes_size += bvh->pack.nodes.size();
|
nodes_size += bvh->pack.nodes.size();
|
||||||
leaf_nodes_size += bvh->pack.leaf_nodes.size();
|
leaf_nodes_size += bvh->pack.leaf_nodes.size();
|
||||||
}
|
}
|
||||||
@@ -545,8 +501,6 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
pack.prim_type.resize(prim_index_size);
|
pack.prim_type.resize(prim_index_size);
|
||||||
pack.prim_object.resize(prim_index_size);
|
pack.prim_object.resize(prim_index_size);
|
||||||
pack.prim_visibility.resize(prim_index_size);
|
pack.prim_visibility.resize(prim_index_size);
|
||||||
pack.prim_tri_verts.resize(prim_tri_verts_size);
|
|
||||||
pack.prim_tri_index.resize(prim_index_size);
|
|
||||||
pack.nodes.resize(nodes_size);
|
pack.nodes.resize(nodes_size);
|
||||||
pack.leaf_nodes.resize(leaf_nodes_size);
|
pack.leaf_nodes.resize(leaf_nodes_size);
|
||||||
pack.object_node.resize(objects.size());
|
pack.object_node.resize(objects.size());
|
||||||
@@ -559,8 +513,6 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
int *pack_prim_type = (pack.prim_type.size()) ? &pack.prim_type[0] : NULL;
|
int *pack_prim_type = (pack.prim_type.size()) ? &pack.prim_type[0] : NULL;
|
||||||
int *pack_prim_object = (pack.prim_object.size()) ? &pack.prim_object[0] : NULL;
|
int *pack_prim_object = (pack.prim_object.size()) ? &pack.prim_object[0] : NULL;
|
||||||
uint *pack_prim_visibility = (pack.prim_visibility.size()) ? &pack.prim_visibility[0] : NULL;
|
uint *pack_prim_visibility = (pack.prim_visibility.size()) ? &pack.prim_visibility[0] : NULL;
|
||||||
float4 *pack_prim_tri_verts = (pack.prim_tri_verts.size()) ? &pack.prim_tri_verts[0] : NULL;
|
|
||||||
uint *pack_prim_tri_index = (pack.prim_tri_index.size()) ? &pack.prim_tri_index[0] : NULL;
|
|
||||||
int4 *pack_nodes = (pack.nodes.size()) ? &pack.nodes[0] : NULL;
|
int4 *pack_nodes = (pack.nodes.size()) ? &pack.nodes[0] : NULL;
|
||||||
int4 *pack_leaf_nodes = (pack.leaf_nodes.size()) ? &pack.leaf_nodes[0] : NULL;
|
int4 *pack_leaf_nodes = (pack.leaf_nodes.size()) ? &pack.leaf_nodes[0] : NULL;
|
||||||
float2 *pack_prim_time = (pack.prim_time.size()) ? &pack.prim_time[0] : NULL;
|
float2 *pack_prim_time = (pack.prim_time.size()) ? &pack.prim_time[0] : NULL;
|
||||||
@@ -609,18 +561,14 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
int *bvh_prim_index = &bvh->pack.prim_index[0];
|
int *bvh_prim_index = &bvh->pack.prim_index[0];
|
||||||
int *bvh_prim_type = &bvh->pack.prim_type[0];
|
int *bvh_prim_type = &bvh->pack.prim_type[0];
|
||||||
uint *bvh_prim_visibility = &bvh->pack.prim_visibility[0];
|
uint *bvh_prim_visibility = &bvh->pack.prim_visibility[0];
|
||||||
uint *bvh_prim_tri_index = &bvh->pack.prim_tri_index[0];
|
|
||||||
float2 *bvh_prim_time = bvh->pack.prim_time.size() ? &bvh->pack.prim_time[0] : NULL;
|
float2 *bvh_prim_time = bvh->pack.prim_time.size() ? &bvh->pack.prim_time[0] : NULL;
|
||||||
|
|
||||||
for (size_t i = 0; i < bvh_prim_index_size; i++) {
|
for (size_t i = 0; i < bvh_prim_index_size; i++) {
|
||||||
if (bvh->pack.prim_type[i] & PRIMITIVE_ALL_CURVE) {
|
if (bvh->pack.prim_type[i] & PRIMITIVE_ALL_CURVE) {
|
||||||
pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + geom_prim_offset;
|
pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + geom_prim_offset;
|
||||||
pack_prim_tri_index[pack_prim_index_offset] = -1;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + geom_prim_offset;
|
pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + geom_prim_offset;
|
||||||
pack_prim_tri_index[pack_prim_index_offset] = bvh_prim_tri_index[i] +
|
|
||||||
pack_prim_tri_verts_offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pack_prim_type[pack_prim_index_offset] = bvh_prim_type[i];
|
pack_prim_type[pack_prim_index_offset] = bvh_prim_type[i];
|
||||||
@@ -633,15 +581,6 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Merge triangle vertices data. */
|
|
||||||
if (bvh->pack.prim_tri_verts.size()) {
|
|
||||||
const size_t prim_tri_size = bvh->pack.prim_tri_verts.size();
|
|
||||||
memcpy(pack_prim_tri_verts + pack_prim_tri_verts_offset,
|
|
||||||
&bvh->pack.prim_tri_verts[0],
|
|
||||||
prim_tri_size * sizeof(float4));
|
|
||||||
pack_prim_tri_verts_offset += prim_tri_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* merge nodes */
|
/* merge nodes */
|
||||||
if (bvh->pack.leaf_nodes.size()) {
|
if (bvh->pack.leaf_nodes.size()) {
|
||||||
int4 *leaf_nodes_offset = &bvh->pack.leaf_nodes[0];
|
int4 *leaf_nodes_offset = &bvh->pack.leaf_nodes[0];
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
#define __BVH2_H__
|
#define __BVH2_H__
|
||||||
|
|
||||||
#include "bvh/bvh.h"
|
#include "bvh/bvh.h"
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
|
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
@@ -32,24 +32,24 @@
|
|||||||
|
|
||||||
# include <embree3/rtcore_geometry.h>
|
# include <embree3/rtcore_geometry.h>
|
||||||
|
|
||||||
# include "bvh/bvh_embree.h"
|
# include "bvh/embree.h"
|
||||||
|
|
||||||
/* Kernel includes are necessary so that the filter function for Embree can access the packed BVH.
|
/* Kernel includes are necessary so that the filter function for Embree can access the packed BVH.
|
||||||
*/
|
*/
|
||||||
# include "kernel/bvh/bvh_embree.h"
|
# include "kernel/bvh/embree.h"
|
||||||
# include "kernel/bvh/bvh_util.h"
|
# include "kernel/bvh/util.h"
|
||||||
# include "kernel/device/cpu/compat.h"
|
# include "kernel/device/cpu/compat.h"
|
||||||
# include "kernel/device/cpu/globals.h"
|
# include "kernel/device/cpu/globals.h"
|
||||||
# include "kernel/kernel_random.h"
|
# include "kernel/sample/lcg.h"
|
||||||
|
|
||||||
# include "render/hair.h"
|
# include "scene/hair.h"
|
||||||
# include "render/mesh.h"
|
# include "scene/mesh.h"
|
||||||
# include "render/object.h"
|
# include "scene/object.h"
|
||||||
|
|
||||||
# include "util/util_foreach.h"
|
# include "util/foreach.h"
|
||||||
# include "util/util_logging.h"
|
# include "util/log.h"
|
||||||
# include "util/util_progress.h"
|
# include "util/progress.h"
|
||||||
# include "util/util_stats.h"
|
# include "util/stats.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -73,49 +73,56 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
const RTCRay *ray = (RTCRay *)args->ray;
|
const RTCRay *ray = (RTCRay *)args->ray;
|
||||||
RTCHit *hit = (RTCHit *)args->hit;
|
RTCHit *hit = (RTCHit *)args->hit;
|
||||||
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
|
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
|
||||||
const KernelGlobals *kg = ctx->kg;
|
const KernelGlobalsCPU *kg = ctx->kg;
|
||||||
|
|
||||||
switch (ctx->type) {
|
switch (ctx->type) {
|
||||||
case CCLIntersectContext::RAY_SHADOW_ALL: {
|
case CCLIntersectContext::RAY_SHADOW_ALL: {
|
||||||
Intersection current_isect;
|
Intersection current_isect;
|
||||||
kernel_embree_convert_hit(kg, ray, hit, ¤t_isect);
|
kernel_embree_convert_hit(kg, ray, hit, ¤t_isect);
|
||||||
|
|
||||||
/* If no transparent shadows, all light is blocked. */
|
/* If no transparent shadows or max number of hits exceeded, all light is blocked. */
|
||||||
const int flags = intersection_get_shader_flags(kg, ¤t_isect);
|
const int flags = intersection_get_shader_flags(kg, current_isect.prim, current_isect.type);
|
||||||
if (!(flags & (SD_HAS_TRANSPARENT_SHADOW)) || ctx->max_hits == 0) {
|
if (!(flags & (SD_HAS_TRANSPARENT_SHADOW)) || ctx->num_hits >= ctx->max_hits) {
|
||||||
ctx->opaque_hit = true;
|
ctx->opaque_hit = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test if we need to record this transparent intersection. */
|
++ctx->num_hits;
|
||||||
if (ctx->num_hits < ctx->max_hits || ray->tfar < ctx->max_t) {
|
|
||||||
/* Skip already recorded intersections. */
|
|
||||||
int num_recorded_hits = min(ctx->num_hits, ctx->max_hits);
|
|
||||||
|
|
||||||
for (int i = 0; i < num_recorded_hits; ++i) {
|
/* Always use baked shadow transparency for curves. */
|
||||||
if (current_isect.object == ctx->isect_s[i].object &&
|
if (current_isect.type & PRIMITIVE_ALL_CURVE) {
|
||||||
current_isect.prim == ctx->isect_s[i].prim && current_isect.t == ctx->isect_s[i].t) {
|
ctx->throughput *= intersection_curve_shadow_transparency(
|
||||||
/* This intersection was already recorded, skip it. */
|
kg, current_isect.object, current_isect.prim, current_isect.u);
|
||||||
*args->valid = 0;
|
|
||||||
return;
|
if (ctx->throughput < CURVE_SHADOW_TRANSPARENCY_CUTOFF) {
|
||||||
}
|
ctx->opaque_hit = true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Test if we need to record this transparent intersection. */
|
||||||
|
const uint max_record_hits = min(ctx->max_hits, INTEGRATOR_SHADOW_ISECT_SIZE);
|
||||||
|
if (ctx->num_recorded_hits < max_record_hits || ray->tfar < ctx->max_t) {
|
||||||
/* If maximum number of hits was reached, replace the intersection with the
|
/* If maximum number of hits was reached, replace the intersection with the
|
||||||
* highest distance. We want to find the N closest intersections. */
|
* highest distance. We want to find the N closest intersections. */
|
||||||
int isect_index = num_recorded_hits;
|
const uint num_recorded_hits = min(ctx->num_recorded_hits, max_record_hits);
|
||||||
if (num_recorded_hits + 1 >= ctx->max_hits) {
|
uint isect_index = num_recorded_hits;
|
||||||
|
if (num_recorded_hits + 1 >= max_record_hits) {
|
||||||
float max_t = ctx->isect_s[0].t;
|
float max_t = ctx->isect_s[0].t;
|
||||||
int max_recorded_hit = 0;
|
uint max_recorded_hit = 0;
|
||||||
|
|
||||||
for (int i = 1; i < num_recorded_hits; ++i) {
|
for (uint i = 1; i < num_recorded_hits; ++i) {
|
||||||
if (ctx->isect_s[i].t > max_t) {
|
if (ctx->isect_s[i].t > max_t) {
|
||||||
max_recorded_hit = i;
|
max_recorded_hit = i;
|
||||||
max_t = ctx->isect_s[i].t;
|
max_t = ctx->isect_s[i].t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_recorded_hits >= ctx->max_hits) {
|
if (num_recorded_hits >= max_record_hits) {
|
||||||
isect_index = max_recorded_hit;
|
isect_index = max_recorded_hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,10 +136,9 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
ctx->isect_s[isect_index] = current_isect;
|
ctx->isect_s[isect_index] = current_isect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Always increase the number of hits, even beyond ray.max_hits so that
|
/* Always increase the number of recorded hits, even beyond the maximum,
|
||||||
* the caller can detect this as and consider it opaque, or trace another
|
* so that we can detect this and trace another ray if needed. */
|
||||||
* ray. */
|
++ctx->num_recorded_hits;
|
||||||
++ctx->num_hits;
|
|
||||||
|
|
||||||
/* This tells Embree to continue tracing. */
|
/* This tells Embree to continue tracing. */
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
@@ -147,10 +153,7 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
kernel_embree_convert_hit(kg, ray, hit, ¤t_isect);
|
kernel_embree_convert_hit(kg, ray, hit, ¤t_isect);
|
||||||
int object = (current_isect.object == OBJECT_NONE) ?
|
if (ctx->local_object_id != current_isect.object) {
|
||||||
kernel_tex_fetch(__prim_object, current_isect.prim) :
|
|
||||||
current_isect.object;
|
|
||||||
if (ctx->local_object_id != object) {
|
|
||||||
/* This tells Embree to continue tracing. */
|
/* This tells Embree to continue tracing. */
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
break;
|
break;
|
||||||
@@ -169,41 +172,49 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See triangle_intersect_subsurface() for the native equivalent. */
|
LocalIntersection *local_isect = ctx->local_isect;
|
||||||
for (int i = min(ctx->max_hits, ctx->local_isect->num_hits) - 1; i >= 0; --i) {
|
|
||||||
if (ctx->local_isect->hits[i].t == ray->tfar) {
|
|
||||||
/* This tells Embree to continue tracing. */
|
|
||||||
*args->valid = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int hit_idx = 0;
|
int hit_idx = 0;
|
||||||
|
|
||||||
if (ctx->lcg_state) {
|
if (ctx->lcg_state) {
|
||||||
|
/* See triangle_intersect_subsurface() for the native equivalent. */
|
||||||
|
for (int i = min((int)ctx->max_hits, local_isect->num_hits) - 1; i >= 0; --i) {
|
||||||
|
if (local_isect->hits[i].t == ray->tfar) {
|
||||||
|
/* This tells Embree to continue tracing. */
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
++ctx->local_isect->num_hits;
|
local_isect->num_hits++;
|
||||||
if (ctx->local_isect->num_hits <= ctx->max_hits) {
|
|
||||||
hit_idx = ctx->local_isect->num_hits - 1;
|
if (local_isect->num_hits <= ctx->max_hits) {
|
||||||
|
hit_idx = local_isect->num_hits - 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* reservoir sampling: if we are at the maximum number of
|
/* reservoir sampling: if we are at the maximum number of
|
||||||
* hits, randomly replace element or skip it */
|
* hits, randomly replace element or skip it */
|
||||||
hit_idx = lcg_step_uint(ctx->lcg_state) % ctx->local_isect->num_hits;
|
hit_idx = lcg_step_uint(ctx->lcg_state) % local_isect->num_hits;
|
||||||
|
|
||||||
if (hit_idx >= ctx->max_hits) {
|
if (hit_idx >= ctx->max_hits) {
|
||||||
/* This tells Embree to continue tracing. */
|
/* This tells Embree to continue tracing. */
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctx->local_isect->num_hits = 1;
|
/* Record closest intersection only. */
|
||||||
|
if (local_isect->num_hits && current_isect.t > local_isect->hits[0].t) {
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
local_isect->num_hits = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* record intersection */
|
/* record intersection */
|
||||||
ctx->local_isect->hits[hit_idx] = current_isect;
|
local_isect->hits[hit_idx] = current_isect;
|
||||||
ctx->local_isect->Ng[hit_idx] = normalize(make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z));
|
local_isect->Ng[hit_idx] = normalize(make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z));
|
||||||
/* This tells Embree to continue tracing. */
|
/* This tells Embree to continue tracing. */
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
break;
|
break;
|
||||||
@@ -213,21 +224,11 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
if (ctx->num_hits < ctx->max_hits) {
|
if (ctx->num_hits < ctx->max_hits) {
|
||||||
Intersection current_isect;
|
Intersection current_isect;
|
||||||
kernel_embree_convert_hit(kg, ray, hit, ¤t_isect);
|
kernel_embree_convert_hit(kg, ray, hit, ¤t_isect);
|
||||||
for (size_t i = 0; i < ctx->max_hits; ++i) {
|
|
||||||
if (current_isect.object == ctx->isect_s[i].object &&
|
|
||||||
current_isect.prim == ctx->isect_s[i].prim && current_isect.t == ctx->isect_s[i].t) {
|
|
||||||
/* This intersection was already recorded, skip it. */
|
|
||||||
*args->valid = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Intersection *isect = &ctx->isect_s[ctx->num_hits];
|
Intersection *isect = &ctx->isect_s[ctx->num_hits];
|
||||||
++ctx->num_hits;
|
++ctx->num_hits;
|
||||||
*isect = current_isect;
|
*isect = current_isect;
|
||||||
/* Only primitives from volume object. */
|
/* Only primitives from volume object. */
|
||||||
uint tri_object = (isect->object == OBJECT_NONE) ?
|
uint tri_object = isect->object;
|
||||||
kernel_tex_fetch(__prim_object, isect->prim) :
|
|
||||||
isect->object;
|
|
||||||
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
|
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
|
||||||
if ((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
|
if ((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
|
||||||
--ctx->num_hits;
|
--ctx->num_hits;
|
||||||
@@ -249,7 +250,7 @@ static void rtc_filter_func_thick_curve(const RTCFilterFunctionNArguments *args)
|
|||||||
const RTCRay *ray = (RTCRay *)args->ray;
|
const RTCRay *ray = (RTCRay *)args->ray;
|
||||||
RTCHit *hit = (RTCHit *)args->hit;
|
RTCHit *hit = (RTCHit *)args->hit;
|
||||||
|
|
||||||
/* Always ignore backfacing intersections. */
|
/* Always ignore back-facing intersections. */
|
||||||
if (dot(make_float3(ray->dir_x, ray->dir_y, ray->dir_z),
|
if (dot(make_float3(ray->dir_x, ray->dir_y, ray->dir_z),
|
||||||
make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) {
|
make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) {
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
@@ -262,7 +263,7 @@ static void rtc_filter_occluded_func_thick_curve(const RTCFilterFunctionNArgumen
|
|||||||
const RTCRay *ray = (RTCRay *)args->ray;
|
const RTCRay *ray = (RTCRay *)args->ray;
|
||||||
RTCHit *hit = (RTCHit *)args->hit;
|
RTCHit *hit = (RTCHit *)args->hit;
|
||||||
|
|
||||||
/* Always ignore backfacing intersections. */
|
/* Always ignore back-facing intersections. */
|
||||||
if (dot(make_float3(ray->dir_x, ray->dir_y, ray->dir_z),
|
if (dot(make_float3(ray->dir_x, ray->dir_y, ray->dir_z),
|
||||||
make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) {
|
make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) {
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
@@ -456,7 +457,7 @@ void BVHEmbree::add_instance(Object *ob, int i)
|
|||||||
|
|
||||||
void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
|
void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
|
||||||
{
|
{
|
||||||
size_t prim_offset = mesh->optix_prim_offset;
|
size_t prim_offset = mesh->prim_offset;
|
||||||
|
|
||||||
const Attribute *attr_mP = NULL;
|
const Attribute *attr_mP = NULL;
|
||||||
size_t num_motion_steps = 1;
|
size_t num_motion_steps = 1;
|
||||||
@@ -625,7 +626,7 @@ void BVHEmbree::set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, c
|
|||||||
|
|
||||||
void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
||||||
{
|
{
|
||||||
size_t prim_offset = hair->optix_prim_offset;
|
size_t prim_offset = hair->curve_segment_offset;
|
||||||
|
|
||||||
const Attribute *attr_mP = NULL;
|
const Attribute *attr_mP = NULL;
|
||||||
size_t num_motion_steps = 1;
|
size_t num_motion_steps = 1;
|
||||||
@@ -702,7 +703,7 @@ void BVHEmbree::refit(Progress &progress)
|
|||||||
if (mesh->num_triangles() > 0) {
|
if (mesh->num_triangles() > 0) {
|
||||||
RTCGeometry geom = rtcGetGeometry(scene, geom_id);
|
RTCGeometry geom = rtcGetGeometry(scene, geom_id);
|
||||||
set_tri_vertex_buffer(geom, mesh, true);
|
set_tri_vertex_buffer(geom, mesh, true);
|
||||||
rtcSetGeometryUserData(geom, (void *)mesh->optix_prim_offset);
|
rtcSetGeometryUserData(geom, (void *)mesh->prim_offset);
|
||||||
rtcCommitGeometry(geom);
|
rtcCommitGeometry(geom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -711,7 +712,7 @@ void BVHEmbree::refit(Progress &progress)
|
|||||||
if (hair->num_curves() > 0) {
|
if (hair->num_curves() > 0) {
|
||||||
RTCGeometry geom = rtcGetGeometry(scene, geom_id + 1);
|
RTCGeometry geom = rtcGetGeometry(scene, geom_id + 1);
|
||||||
set_curve_vertex_buffer(geom, hair, true);
|
set_curve_vertex_buffer(geom, hair, true);
|
||||||
rtcSetGeometryUserData(geom, (void *)hair->optix_prim_offset);
|
rtcSetGeometryUserData(geom, (void *)hair->curve_segment_offset);
|
||||||
rtcCommitGeometry(geom);
|
rtcCommitGeometry(geom);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -23,11 +23,11 @@
|
|||||||
# include <embree3/rtcore_scene.h>
|
# include <embree3/rtcore_scene.h>
|
||||||
|
|
||||||
# include "bvh/bvh.h"
|
# include "bvh/bvh.h"
|
||||||
# include "bvh/bvh_params.h"
|
# include "bvh/params.h"
|
||||||
|
|
||||||
# include "util/util_thread.h"
|
# include "util/thread.h"
|
||||||
# include "util/util_types.h"
|
# include "util/types.h"
|
||||||
# include "util/util_vector.h"
|
# include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bvh/bvh_multi.h"
|
#include "bvh/multi.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/foreach.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,7 +18,7 @@
|
|||||||
#define __BVH_MULTI_H__
|
#define __BVH_MULTI_H__
|
||||||
|
|
||||||
#include "bvh/bvh.h"
|
#include "bvh/bvh.h"
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bvh/bvh_node.h"
|
#include "bvh/node.h"
|
||||||
|
|
||||||
|
#include "bvh/build.h"
|
||||||
#include "bvh/bvh.h"
|
#include "bvh/bvh.h"
|
||||||
#include "bvh/bvh_build.h"
|
|
||||||
|
|
||||||
#include "util/util_vector.h"
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,8 +18,8 @@
|
|||||||
#ifndef __BVH_NODE_H__
|
#ifndef __BVH_NODE_H__
|
||||||
#define __BVH_NODE_H__
|
#define __BVH_NODE_H__
|
||||||
|
|
||||||
#include "util/util_boundbox.h"
|
#include "util/boundbox.h"
|
||||||
#include "util/util_types.h"
|
#include "util/types.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
# include "device/device.h"
|
# include "device/device.h"
|
||||||
|
|
||||||
# include "bvh/bvh_optix.h"
|
# include "bvh/optix.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -21,8 +21,9 @@
|
|||||||
#ifdef WITH_OPTIX
|
#ifdef WITH_OPTIX
|
||||||
|
|
||||||
# include "bvh/bvh.h"
|
# include "bvh/bvh.h"
|
||||||
# include "bvh/bvh_params.h"
|
# include "bvh/params.h"
|
||||||
# include "device/device_memory.h"
|
|
||||||
|
# include "device/memory.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,9 +18,9 @@
|
|||||||
#ifndef __BVH_PARAMS_H__
|
#ifndef __BVH_PARAMS_H__
|
||||||
#define __BVH_PARAMS_H__
|
#define __BVH_PARAMS_H__
|
||||||
|
|
||||||
#include "util/util_boundbox.h"
|
#include "util/boundbox.h"
|
||||||
|
|
||||||
#include "kernel/kernel_types.h"
|
#include "kernel/types.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bvh/bvh_sort.h"
|
#include "bvh/sort.h"
|
||||||
|
|
||||||
#include "bvh/bvh_build.h"
|
#include "bvh/build.h"
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/util_task.h"
|
#include "util/task.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -15,16 +15,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bvh/bvh_split.h"
|
#include "bvh/split.h"
|
||||||
|
|
||||||
#include "bvh/bvh_build.h"
|
#include "bvh/build.h"
|
||||||
#include "bvh/bvh_sort.h"
|
#include "bvh/sort.h"
|
||||||
|
|
||||||
#include "render/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "render/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "render/object.h"
|
#include "scene/object.h"
|
||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/algorithm.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -18,8 +18,8 @@
|
|||||||
#ifndef __BVH_SPLIT_H__
|
#ifndef __BVH_SPLIT_H__
|
||||||
#define __BVH_SPLIT_H__
|
#define __BVH_SPLIT_H__
|
||||||
|
|
||||||
#include "bvh/bvh_build.h"
|
#include "bvh/build.h"
|
||||||
#include "bvh/bvh_params.h"
|
#include "bvh/params.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
@@ -14,16 +14,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bvh/bvh_unaligned.h"
|
#include "bvh/unaligned.h"
|
||||||
|
|
||||||
#include "render/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "render/object.h"
|
#include "scene/object.h"
|
||||||
|
|
||||||
#include "bvh/bvh_binning.h"
|
#include "bvh/binning.h"
|
||||||
#include "bvh_params.h"
|
#include "bvh/params.h"
|
||||||
|
|
||||||
#include "util/util_boundbox.h"
|
#include "util/boundbox.h"
|
||||||
#include "util/util_transform.h"
|
#include "util/transform.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user