Compare commits
1466 Commits
gpu-shader
...
gltf_vtree
Author | SHA1 | Date | |
---|---|---|---|
13a158e3bb | |||
2110e271f5 | |||
2bd71b49e7 | |||
![]() |
e9150ac317 | ||
32b33e91eb | |||
b03fb70eff | |||
f8713aae5e | |||
217e0a2ce6 | |||
84dab8b597 | |||
34449ba9a6 | |||
6f9828289f | |||
396413dedf | |||
146618fb22 | |||
120deaac5b | |||
64264a496d | |||
c8814fb610 | |||
9ce1135440 | |||
f21f1279fa | |||
2e4a1a70da | |||
95005bbe02 | |||
f420118335 | |||
1d1859c3c4 | |||
bff83ecee5 | |||
71c76d596c | |||
2053fc849e | |||
68c2650b03 | |||
c3a41a8002 | |||
c8c9965df2 | |||
5fabbedb04 | |||
c4f159cfcd | |||
81ee46da1a | |||
716d8436f0 | |||
64359f8998 | |||
fc5ef2452d | |||
2bd30272ea | |||
![]() |
5edb924e57 | ||
![]() |
8ad5241778 | ||
![]() |
83fa6a1b2a | ||
![]() |
c626301f19 | ||
64ca0f44cb | |||
5257257539 | |||
9578fe3068 | |||
2216699c64 | |||
8cc6623c18 | |||
180a68c1dc | |||
46abc6ce25 | |||
caaec3e0c5 | |||
a31859c754 | |||
8b4f1e41ea | |||
cf871ab967 | |||
9badd27fb7 | |||
b9718899fa | |||
deb90557ea | |||
869180548c | |||
75576a3001 | |||
![]() |
e43ccfb702 | ||
dfc959eed6 | |||
cfa235b89d | |||
a727692af7 | |||
ed80c887b7 | |||
97dbe235a2 | |||
8815f2f116 | |||
9ccdad8a21 | |||
57f6aa4d83 | |||
79032a8513 | |||
23775f3914 | |||
ac3324f197 | |||
012e41fc8b | |||
14427f5aaa | |||
a04d0de039 | |||
![]() |
1f7013fb90 | ||
b315678fea | |||
![]() |
07514def19 | ||
4fcc651435 | |||
a58592885c | |||
0c5a9a0e77 | |||
f18172b023 | |||
f8b8727873 | |||
2cf3ed13da | |||
e951e81b0f | |||
ec2e9a4352 | |||
c9d35ee07c | |||
1405787142 | |||
90a23dec46 | |||
0b2864382a | |||
544a0f2880 | |||
d29a079cb6 | |||
03b57d3973 | |||
fd1078e105 | |||
3435c9a2c1 | |||
afdc35b636 | |||
fe80b6ceac | |||
0a8fa07735 | |||
6b7756279f | |||
4311a32bc2 | |||
ace1b6a73a | |||
26e608d820 | |||
82ad1631e4 | |||
dd4a89e78d | |||
cb09485ff2 | |||
92d747b0c4 | |||
391bb6e9ba | |||
b6f640b953 | |||
4e93918b35 | |||
3b2a1ff716 | |||
75e61e5a6d | |||
c40d6ebceb | |||
430f71fce2 | |||
29a1d8b1d3 | |||
cdcbdf8ce4 | |||
5d74fa314b | |||
7c48196056 | |||
be921a04f2 | |||
dcb7b3f9f7 | |||
379814a118 | |||
60bd6804db | |||
1a15461612 | |||
3aa56608f7 | |||
f4031f2be2 | |||
66e4fdab68 | |||
cfe18c3b94 | |||
f756dc4812 | |||
5d4583683b | |||
d45098024e | |||
c37b837244 | |||
c0225aa573 | |||
49b9b0251b | |||
78647fbcc0 | |||
e1be275878 | |||
![]() |
bdd74e1e93 | ||
0a32ac02e9 | |||
1e0758333d | |||
9523b1478e | |||
ebd0e76088 | |||
9f6b19526d | |||
7475012e24 | |||
f2b24272dd | |||
da848b7440 | |||
423bbbbaae | |||
![]() |
3775615aea | ||
a21f1e81e0 | |||
87c13ac68c | |||
4710f3346a | |||
74d68e50d3 | |||
89dbad9085 | |||
834b966b41 | |||
d7ac659e02 | |||
9c341153a2 | |||
279a73e429 | |||
32a96b80a3 | |||
25ac6aa5e4 | |||
658ae5d63f | |||
![]() |
58e0aa36ea | ||
99ffe1153a | |||
6c483479b8 | |||
![]() |
c85c52f2ce | ||
d518550c46 | |||
aa2164da33 | |||
5730668dea | |||
8a20aec403 | |||
5400018106 | |||
6f1ab97c53 | |||
78f29c0467 | |||
0379ddac7d | |||
cf31c4ba18 | |||
a99e43b2b7 | |||
5abab0a41a | |||
a7f7b0b77e | |||
1edf520439 | |||
0e86c60c28 | |||
bb1e2a80e4 | |||
710e46cb2d | |||
cab1f1d9a2 | |||
7b615ca186 | |||
9dc0379dc0 | |||
f6296e502a | |||
fdd84d36ce | |||
b57db4b79e | |||
fc0dd5583c | |||
08e2885796 | |||
da1b6c4c02 | |||
d74c2b5c1f | |||
57dfec79f4 | |||
13f2df3c28 | |||
489b484b7b | |||
b42adab3a2 | |||
e729abb0e2 | |||
![]() |
74afc86d4b | ||
![]() |
ae44070341 | ||
![]() |
a9bb460766 | ||
974981a637 | |||
79927e730e | |||
990ed109f2 | |||
37848d1c8e | |||
12b26d21b0 | |||
6738ecb64e | |||
5b299e5999 | |||
9bce134e56 | |||
1bf6a880ab | |||
![]() |
a21bca0e20 | ||
b3bf46b78d | |||
0cb5eae9d0 | |||
1758dcd423 | |||
9338126ecc | |||
46ae083113 | |||
b06fff4737 | |||
94d2a611ec | |||
37e555d2fe | |||
086f191169 | |||
4c951bfa82 | |||
4530449317 | |||
c4bedeb018 | |||
83094d9a0d | |||
c1b5cea63a | |||
b45e71e22c | |||
597eaeaa11 | |||
52b2769b9c | |||
c847122096 | |||
1687903fb8 | |||
c89d6b0953 | |||
2637f94358 | |||
3e2591c83e | |||
0ec94d5359 | |||
932d8dba52 | |||
ec1b0c2014 | |||
97a023a0d5 | |||
e2a36a6e45 | |||
f26c36c96b | |||
c813a1b358 | |||
eab066cbf2 | |||
![]() |
2ed73fc97e | ||
a18bd403bf | |||
96667e3391 | |||
6c25aabddf | |||
0477ca75f0 | |||
![]() |
14f6afb090 | ||
368bfa80f9 | |||
460e0a1347 | |||
33ba298b5d | |||
![]() |
948211679f | ||
![]() |
3f42417cd4 | ||
196da819ba | |||
31296f6f9d | |||
0f89bcdbeb | |||
c5980ada4f | |||
![]() |
17b0c06946 | ||
a000de7c2a | |||
a54142f3f1 | |||
1b1693d43f | |||
2e9b8689e4 | |||
a2301b1d91 | |||
114b06b3cb | |||
2bf519d211 | |||
4d799db72f | |||
5a0c5912a4 | |||
083de503ce | |||
04c3b08518 | |||
263f862ba5 | |||
e2337b5342 | |||
90d61600fc | |||
![]() |
e673cfc2d7 | ||
25fa5792e6 | |||
a215d7e230 | |||
0928fe8710 | |||
4c617c06e9 | |||
796ef560b4 | |||
578baf95e0 | |||
e774f2c901 | |||
7708a848c9 | |||
4b1f243e4d | |||
f9b6a257bd | |||
95981c9876 | |||
46475b8e11 | |||
43e3a33082 | |||
c69a581c0b | |||
abf30007ab | |||
38c7378949 | |||
807c58aae4 | |||
889712927f | |||
5c4a5fd40d | |||
6cd977b903 | |||
dde997086c | |||
579e8ebe79 | |||
5ae76fae90 | |||
e88d966737 | |||
25c99e72cd | |||
b7878a4d45 | |||
![]() |
9350005d8b | ||
1f026a3db9 | |||
![]() |
45d038181a | ||
d590e223da | |||
68aa35ae74 | |||
294ab84909 | |||
1c23a06706 | |||
e07b217669 | |||
32ceb0b807 | |||
4f9be46526 | |||
54d69a2fd1 | |||
9d274a609c | |||
58f8eb54a3 | |||
![]() |
5b90c046d5 | ||
c20f209b1c | |||
59fc95bf97 | |||
d034b85f33 | |||
![]() |
c39d514a4e | ||
4251455dcd | |||
87c5423c5e | |||
![]() |
d68ce0e475 | ||
5e51a5e8a4 | |||
93065a67c6 | |||
f6888b530a | |||
36c40760a5 | |||
23fa5bb723 | |||
64196a6b29 | |||
872dc1038c | |||
53923f502d | |||
20655128c9 | |||
5fca280c80 | |||
1ac2d2dcb6 | |||
14d261d23a | |||
9ca1052226 | |||
4369c5817a | |||
22a8e934e4 | |||
e1ae95f6b2 | |||
24e00c115c | |||
2559d79d2f | |||
![]() |
cc1a48e395 | ||
6baccc36a0 | |||
d552b3c0c0 | |||
902a103f80 | |||
19622ffc5b | |||
f6c8a78ac6 | |||
9315215b20 | |||
264fe10ddd | |||
969a571e0f | |||
4425e0cd64 | |||
9b4c017031 | |||
ae349eb2d5 | |||
eb3ff1d6f9 | |||
1d536c21dd | |||
e3f9d9b206 | |||
b7fe27314b | |||
b47a1867e8 | |||
e7db1247b1 | |||
293aab2253 | |||
9a2d1cd5b7 | |||
cd0acba330 | |||
17cab47ed1 | |||
596ce11556 | |||
f179637222 | |||
ecf2f5ed01 | |||
eddad4e9a1 | |||
e49bf4019b | |||
1788298804 | |||
8a23d91a50 | |||
952a4fa456 | |||
71386c08f1 | |||
eb63646605 | |||
71879d665d | |||
ee6507f2b1 | |||
7e3b1e2c8f | |||
2e5aecf557 | |||
221ff895d9 | |||
a5610da1d5 | |||
9506dcf675 | |||
977baeaa26 | |||
09ecb089a5 | |||
15657b7ccd | |||
b88a37a490 | |||
4d5c08b938 | |||
796e9d442c | |||
dfe22a53bb | |||
0d7b3ed39c | |||
6952228386 | |||
6a8ad00bcc | |||
08d008a508 | |||
2486346f6f | |||
9f8ae130af | |||
5d7ac749c5 | |||
fce0b824a7 | |||
![]() |
36068487d0 | ||
d7822981b1 | |||
542d15b1cd | |||
1b94631975 | |||
6dd89afa96 | |||
db496a0b7d | |||
20df402adc | |||
7220897280 | |||
75d84b1b64 | |||
0fc9526178 | |||
84f6d86445 | |||
c11c2a4b91 | |||
![]() |
54fb1a75ee | ||
0fa36c81d9 | |||
3bbb39ecc1 | |||
44ca984dc7 | |||
8c1ddee10c | |||
b776c46d2f | |||
![]() |
449db0ab1e | ||
8af22719d0 | |||
fa1fef5081 | |||
194979e929 | |||
aa0ecd1791 | |||
4d10a46e63 | |||
a25cfc5db2 | |||
be8f10a4e2 | |||
e3fd0b1d17 | |||
7abdd82dfd | |||
59fcbdd815 | |||
0a08ac2528 | |||
9d3f35a0bf | |||
edee5a947b | |||
![]() |
8fb2ff458b | ||
08822801ac | |||
04feaa8bd0 | |||
e15449623d | |||
40c8e23d48 | |||
e1e3043a51 | |||
![]() |
a84621347d | ||
![]() |
34d424fd64 | ||
d914cfcb7a | |||
608d51c9c8 | |||
bc66cd9868 | |||
3574f2730d | |||
b87d87b1d3 | |||
e69020ad0f | |||
18c5d4ccb3 | |||
9664cc91f3 | |||
6a16a9e661 | |||
6e926e9b56 | |||
2a095d8bfe | |||
9fe704800e | |||
b7a27efd78 | |||
bba95d1901 | |||
67517c7d5c | |||
41495707d2 | |||
82d5905e4b | |||
ca9a749b21 | |||
e9a43a3b60 | |||
9109ea0b96 | |||
5703efab88 | |||
d723fa3d31 | |||
780633ec4b | |||
301bb5afa5 | |||
eb33ee566e | |||
85df7036f7 | |||
e57365a70b | |||
348631cffe | |||
8ae6995e98 | |||
c0d0e2788b | |||
ba48c1ee58 | |||
6f51cb0ad7 | |||
a5cb7c1e62 | |||
0cf746c1fa | |||
c0432d5edb | |||
86b7746e3c | |||
0a3de0305c | |||
c9a8975de5 | |||
261517e475 | |||
c8e536bac3 | |||
e0ac75cb44 | |||
7c568e7d36 | |||
cea588b9ef | |||
7a0cf2c72f | |||
1bd0a87384 | |||
8b3d798374 | |||
0c5ccae79d | |||
cfa53e0fbe | |||
800fc17367 | |||
1c4a1c13e0 | |||
5ecaa9a838 | |||
3537abe84b | |||
743b9c5e1d | |||
b8157f5bf1 | |||
22dc865a86 | |||
039cc32917 | |||
1a4f8ab389 | |||
f173973ae4 | |||
79e985ea54 | |||
19a6220308 | |||
d53738396f | |||
7bb572f208 | |||
0cf2fafd81 | |||
a3deef6fff | |||
eaa4cdaa42 | |||
![]() |
29450a2af3 | ||
![]() |
75a1a578bd | ||
f1a488d0f2 | |||
a7c9fb59ca | |||
227f0f3582 | |||
97c2c39916 | |||
a311fa96aa | |||
e594f23a27 | |||
fa8c2c7885 | |||
a0dcd0bf2c | |||
a72a9e099c | |||
![]() |
62a0de1673 | ||
![]() |
bab47b60cb | ||
![]() |
a909ab984c | ||
5f7ad4baaa | |||
![]() |
e5858a3ad0 | ||
ec5560db73 | |||
0882069095 | |||
1552b86b55 | |||
d43b5791e0 | |||
fb6bd88644 | |||
![]() |
46e049d0ce | ||
e5766752d0 | |||
![]() |
b2ccd8546c | ||
a2c1c368af | |||
d320f3677e | |||
1e61b759c7 | |||
145f1d1e0a | |||
7a2b181591 | |||
ebad1d8d33 | |||
795cea2cce | |||
7f28084e2a | |||
77616082f4 | |||
0dc309bef6 | |||
f4492629ea | |||
ef5d01d98f | |||
89145341e5 | |||
bbe59c6014 | |||
ab125f466c | |||
947dc21979 | |||
5a6ec0f003 | |||
48ff9b57f8 | |||
bdf99a5119 | |||
e339946515 | |||
ac3d07ad17 | |||
376e425c02 | |||
45bb6b836a | |||
e95b4dc2dd | |||
259a71cd3c | |||
8cff1ecf9f | |||
![]() |
631067e559 | ||
41ce7807a6 | |||
ccac22fec5 | |||
6774cae3f2 | |||
fc0f315106 | |||
![]() |
0c94e5d166 | ||
9dc9692b09 | |||
255727b752 | |||
![]() |
1949aece21 | ||
4e8a883bcc | |||
bc02ede98b | |||
d608b98145 | |||
9af81c2b74 | |||
c77f837598 | |||
fd922f5940 | |||
f2fb9a0c59 | |||
f134341e03 | |||
922ae55a16 | |||
37b336a8af | |||
f4af21038d | |||
fe82b8d1e8 | |||
4b8cf11fa5 | |||
a4a95c8d36 | |||
ccf06fffbc | |||
![]() |
57bea57f5e | ||
1a27d20df3 | |||
39ba82f25d | |||
af6a30ebf1 | |||
b0a83a6ed4 | |||
292c2cefe3 | |||
20cb2c72a5 | |||
d9dd8c287f | |||
76d69bbb08 | |||
8dd163160e | |||
![]() |
3ec88ae21d | ||
f5e90a943f | |||
8a772645e2 | |||
1b57dcf320 | |||
6669431846 | |||
e12a707692 | |||
f813aab787 | |||
cfb3f5062d | |||
3488339475 | |||
227fd753df | |||
bd8fa07a3d | |||
934db6a820 | |||
5aac794b11 | |||
1b1e947162 | |||
101fadcf6b | |||
62e8d80a61 | |||
6beaa29791 | |||
eb7333e772 | |||
1705587e21 | |||
74c896c081 | |||
c04d36e922 | |||
37d6ae16be | |||
17c7bac405 | |||
6110f3aa1f | |||
ca0c69eaeb | |||
5519a6a520 | |||
c5ee3ac7e0 | |||
e17ac8dc58 | |||
ed1ced2484 | |||
9620fdc986 | |||
45bc4e3209 | |||
d5e73fa13d | |||
937aa8e114 | |||
90e5ce6ab5 | |||
741ed5fcd2 | |||
34e84d0ee8 | |||
09d6846839 | |||
3e11c7016e | |||
5ba5678e00 | |||
![]() |
1152caad32 | ||
![]() |
34d553671d | ||
![]() |
ee0928d4be | ||
ae28d90578 | |||
![]() |
efe3d60a2c | ||
b7ea6e9d0e | |||
![]() |
5560f32447 | ||
5085c622ea | |||
312aa67cc7 | |||
ed52de948c | |||
2cc6b249c3 | |||
![]() |
361702f239 | ||
bef2412ca2 | |||
29e33cfff5 | |||
6c906b7c21 | |||
7c04bc9a01 | |||
f24854005d | |||
1642028310 | |||
82858ca3f4 | |||
b3dc1a17a0 | |||
2cd8238ce3 | |||
f48164b5ea | |||
3d3bc74884 | |||
bb69c19f08 | |||
e6ca0b33e9 | |||
ed9b21098d | |||
3ae664363d | |||
3a4952e7c2 | |||
0c6b29ee43 | |||
c2089ae53c | |||
ddae2d88fa | |||
1785286ecc | |||
7bcf21e66e | |||
08aa7861d6 | |||
45277d804e | |||
d31b8c316f | |||
88e15ff1e6 | |||
ed3fecae8e | |||
f9aa6376f1 | |||
1484fe260b | |||
e766dc9189 | |||
6f389f1bb8 | |||
c12607baa3 | |||
66a4da87f4 | |||
ed68e18c1c | |||
2ee37e9031 | |||
499fec6f79 | |||
aa363ec2ae | |||
61e2384b7a | |||
60757f010a | |||
0e53ea4cb5 | |||
4067367b6c | |||
c0fb8ea8f3 | |||
1d9bac7d92 | |||
0e1da8dd12 | |||
e55a6bf82b | |||
c240ab70ae | |||
7c013f1154 | |||
611da3b7d6 | |||
50f694c7de | |||
a5b4373f95 | |||
cdd61bb6d7 | |||
f7a0f6a0e4 | |||
1dc0bf86bb | |||
a0edee712a | |||
8cd6d0fe68 | |||
3c04b44913 | |||
5e7e571b0d | |||
bfb760e16a | |||
1403f034ff | |||
b63f375775 | |||
3e92b4ed24 | |||
![]() |
5dedb39d44 | ||
1031638c51 | |||
f64d7bfa4a | |||
8393ccd076 | |||
86141a75eb | |||
29ab711efa | |||
4c3f52e7dc | |||
b1bd0f8ffd | |||
13e7065dd2 | |||
924d2b8df6 | |||
d960c78693 | |||
33400ffcc9 | |||
5df916f23f | |||
b7073fa797 | |||
458be2ecc4 | |||
5336fdc6e3 | |||
713d59bcaf | |||
e3748d7fa5 | |||
07de17ded6 | |||
![]() |
25018dc061 | ||
f7c0287278 | |||
55842b4244 | |||
ad8e2d6661 | |||
bbd0c4118b | |||
54e2f851a4 | |||
070948b5f1 | |||
f7018f7b06 | |||
b2867d4365 | |||
![]() |
a2a02e3994 | ||
![]() |
325beef7af | ||
![]() |
7af01de802 | ||
a9e0caa92d | |||
d2cc672b0c | |||
9c85acf61d | |||
![]() |
d3ad04172d | ||
9793bc30ce | |||
675d3cdd69 | |||
4e44cfa3d9 | |||
c6069c439c | |||
a42e972e1b | |||
1b9e103a30 | |||
b7ad58b945 | |||
ca143fafa6 | |||
8f9f65bc29 | |||
8189471912 | |||
a230445cae | |||
a3e634d4d7 | |||
6a4ee3fd56 | |||
e51864a357 | |||
0a4bd32e59 | |||
add4aa7d25 | |||
2e00d90938 | |||
e2fdc6226a | |||
ea8d749587 | |||
180b66ae8a | |||
![]() |
367fc69dc1 | ||
8be217ada5 | |||
4c46203cb5 | |||
![]() |
6844304dda | ||
e79b4523b4 | |||
97ae08c9fc | |||
d09b1d2759 | |||
56344fb30f | |||
018272ee5b | |||
![]() |
71468f475b | ||
0aa7315608 | |||
bf4358ed0c | |||
ee2b72fd29 | |||
e0d1e66732 | |||
![]() |
52da1afbf6 | ||
49a18cc91e | |||
0b73b2c6cf | |||
6d7dbdbb44 | |||
9d3264b4fd | |||
d3a31311b9 | |||
c0fdf16561 | |||
04ead39dae | |||
bb0da7dbbd | |||
5e8b42bf86 | |||
a94d80716e | |||
a836ded990 | |||
279085e18e | |||
d5b77fd522 | |||
![]() |
1c7d7c9150 | ||
d786b48aab | |||
![]() |
465bd66519 | ||
![]() |
b7f6377e38 | ||
bdcc258305 | |||
4bf74afacc | |||
dc0bf9b702 | |||
ba38b06a97 | |||
b92ef379b7 | |||
53ed7ec7f2 | |||
c34ea3323a | |||
7006d4f0fb | |||
1464eff375 | |||
c32ce881e8 | |||
![]() |
1e9175e1d7 | ||
2668f9181c | |||
715e0faabc | |||
955748ab1e | |||
4cbcfd22f5 | |||
d7c556de32 | |||
2e6ae11326 | |||
1a721c5dbe | |||
0e38002dd5 | |||
bd9d09ca82 | |||
9bacd54312 | |||
23ac79f2c2 | |||
44db9f192e | |||
a7dca135dc | |||
b29e33caa2 | |||
e28222966b | |||
d25fa3250a | |||
f6699bfccf | |||
0a68fa8e14 | |||
8c4edd1b37 | |||
d5b72fb06c | |||
336f6f4bbd | |||
d6dd2f51bb | |||
5814de65f9 | |||
11ac276caa | |||
1c9d8fcb47 | |||
644e6c7a3e | |||
eed45d2a23 | |||
31e120ef49 | |||
51a131ddbc | |||
594438ef0d | |||
7cf5f4cc63 | |||
52585b39a1 | |||
20b438d523 | |||
5cf993f951 | |||
28a8d434d5 | |||
dd3a72f275 | |||
ceed8f7c06 | |||
85abac7e87 | |||
![]() |
f7ddb1ed8a | ||
![]() |
fbd01624e3 | ||
![]() |
c5862da5ad | ||
![]() |
9085b4a731 | ||
e505957b47 | |||
28df0107d4 | |||
f1e04116f0 | |||
67525b88d2 | |||
95c7e8aa13 | |||
fc45b00720 | |||
6e0cf86e73 | |||
79012c6784 | |||
26c7be71d7 | |||
291d2a2222 | |||
d48fc7d156 | |||
dd01ce2cd0 | |||
ba4b7b4319 | |||
c0db8a9a3b | |||
81b3933abb | |||
35bd6fe993 | |||
2df912466c | |||
582f6032fc | |||
05f900e346 | |||
43f5e761a6 | |||
![]() |
7a71a95f32 | ||
d71009d980 | |||
025c921416 | |||
00965c98cb | |||
710e279b19 | |||
41f3164e57 | |||
1931387799 | |||
8f89196be2 | |||
60c59d7d61 | |||
c593db5a2f | |||
6b662ebdb9 | |||
9033d270d5 | |||
dca5be9b94 | |||
14621e7720 | |||
![]() |
c6e7fc9744 | ||
0fd72a98ac | |||
b4f978e901 | |||
586e2face6 | |||
e2a9e7e803 | |||
6a71b2af66 | |||
3579a9e0fc | |||
921708fc76 | |||
f577abc5cd | |||
8d3e57f338 | |||
902318f0fd | |||
978a930d9c | |||
aba91a745a | |||
dbbf0e7f66 | |||
fdc4a1a590 | |||
d6224db8f1 | |||
2ce2bffc4d | |||
d2bf60cc17 | |||
![]() |
6db0919724 | ||
aa7105f759 | |||
bdbd0cffda | |||
8cf1994455 | |||
d66a6525c3 | |||
7e712b2d6a | |||
1abf2f3c7c | |||
d13970de86 | |||
fac42e3fa1 | |||
68f1b2c671 | |||
bb4de77b82 | |||
c0f06ba614 | |||
e4de5b4657 | |||
5457b66301 | |||
7acd3ad7d8 | |||
59221476b0 | |||
399f84d479 | |||
d93dd85951 | |||
![]() |
e9092110ff | ||
bdb5852e28 | |||
![]() |
70de992afe | ||
76cb11e332 | |||
82fa2bdf3f | |||
cb96435047 | |||
1d25ba175e | |||
6c33a0f6d6 | |||
edb3ab0617 | |||
e2e7f7ea52 | |||
![]() |
5adc06d2d8 | ||
deb3d566a5 | |||
ffd1a7d8c8 | |||
fdb2167b4a | |||
5c63c0a58c | |||
528fc35fed | |||
0b69793487 | |||
34fac7a670 | |||
cc367908cd | |||
0966eab8e9 | |||
c27d0cb7b9 | |||
eac6aff741 | |||
6878897a6d | |||
8a91673562 | |||
491b9cd2b9 | |||
b9861055ad | |||
d15d512a68 | |||
4c3f57ffa7 | |||
3471b0016c | |||
214a56ce8c | |||
![]() |
8e31e53aa0 | ||
76fd2ff9fa | |||
4b21067aea | |||
2648d920d8 | |||
![]() |
0aabaa4583 | ||
552dce0de7 | |||
77760194fe | |||
a3ad5abf2f | |||
![]() |
c0d96ca9a5 | ||
![]() |
3b965ba10b | ||
b386f960f6 | |||
![]() |
67734d1853 | ||
f3c1d0e3a3 | |||
7c9e409985 | |||
9690b7c91b | |||
367b484841 | |||
b9d6271916 | |||
7788293954 | |||
0e1bb232e6 | |||
c536eb410c | |||
6b3c3454d3 | |||
![]() |
1f50c2876e | ||
b7e151d876 | |||
da2c564bb0 | |||
35b1e9fc3a | |||
2229179faa | |||
bd12855110 | |||
197b3502b0 | |||
9765ddf4eb | |||
0624fad0f3 | |||
b1f865f9d3 | |||
0f589f8d3c | |||
d6902668e3 | |||
6da23db5e0 | |||
3e04d37529 | |||
59774d64f0 | |||
21c7689b77 | |||
1818110459 | |||
8dbd406ea0 | |||
15c3617009 | |||
![]() |
4e98d974b5 | ||
5de109cc2d | |||
4b12f521e3 | |||
807efa8538 | |||
366ec5f0f8 | |||
b265b447b6 | |||
36a830b4d3 | |||
49311a73b8 | |||
aa55cb2996 | |||
43875e8dd1 | |||
b32f5a922f | |||
11be151d58 | |||
474adc6f88 | |||
d79868c4e6 | |||
![]() |
5f52684a0f | ||
1a833dbdb9 | |||
e85d7d5a28 | |||
c101ded463 | |||
a9d8ff6e21 | |||
883e4c089a | |||
6a885e5d89 | |||
3a856f7967 | |||
6051b80dd2 | |||
723fb16343 | |||
67b657f07c | |||
644eb68524 | |||
40aee0b2e9 | |||
4cfa21f09b | |||
7afd84df40 | |||
7e8912eb96 | |||
![]() |
5b61737a8f | ||
44232a2ce6 | |||
d56bbfea7b | |||
fdd41ac49e | |||
f5ce243a56 | |||
8e2c9f2dd3 | |||
b44a500988 | |||
b5c18288f5 | |||
5cce6894d2 | |||
381cef1773 | |||
c9e5897bb0 | |||
f6fd3a84c2 | |||
a207c1cdaf | |||
c097c7b855 | |||
c1f5d8d023 | |||
b647509913 | |||
2a0a6a0541 | |||
a603bb3459 | |||
e688c927eb | |||
![]() |
b8952ecec9 | ||
0606adceb3 | |||
![]() |
a90c356467 | ||
459af75d1e | |||
49802af7cd | |||
![]() |
3f96555123 | ||
8ba6302696 | |||
8709cbb73e | |||
1686979747 | |||
e549d6c1bd | |||
bea5a9997d | |||
36c6b2e893 | |||
8ad2642c47 | |||
27231afce5 | |||
80f1527762 | |||
d9d4b9899e | |||
f5679838bc | |||
bc1e517bb3 | |||
03015a9b22 | |||
92237f11eb | |||
b444e1be0f | |||
![]() |
8c55481e33 | ||
9df13fba69 | |||
23be5fd449 | |||
96387a2eff | |||
7b88a4a3ba | |||
4c705ab8fe | |||
8c7d970e2c | |||
1a02c0d7dd | |||
a8b730e04c | |||
7c2fb00e66 | |||
5a3d5f751f | |||
5ca38fd612 | |||
![]() |
f886f29355 | ||
943aed0de3 | |||
60a9703de8 | |||
05df6366a4 | |||
f76e04bf4d | |||
37e799e299 | |||
bd2b48e98d | |||
63f8d18c0f | |||
3060217d39 | |||
715f57371b | |||
b87b33adbf | |||
fcf8fc3eaa | |||
![]() |
57f46b9d5f | ||
566a458950 | |||
dffd032bc9 | |||
18412744c8 | |||
74a566d211 | |||
![]() |
b8f41825e8 | ||
![]() |
dbd64a5592 | ||
![]() |
20987b0f29 | ||
bd3bd776c8 | |||
ad44f22397 | |||
4b00a779ec | |||
56fa6f58a0 | |||
e427e4dbb1 | |||
fc14d02bc5 | |||
5ce1c63e1b | |||
74fa4ee92b | |||
d812e46f40 | |||
74e57efb2d | |||
69f55b1b62 | |||
9183f9f860 | |||
50f378e5c8 | |||
973dac9b5f | |||
7f4878ac7f | |||
![]() |
b8bad3549d | ||
65de17ece4 | |||
bc01003673 | |||
cd4a7be5b2 | |||
3647a1e621 | |||
8ef8f3a60a | |||
15a428eab0 | |||
8aed5dbcf8 | |||
7c76bdca1b | |||
9f546d6908 | |||
9e365069af | |||
![]() |
d8b4275162 | ||
894269ad12 | |||
30cebf5747 | |||
cf6be711e2 | |||
3753a0b72b | |||
be2213472f | |||
f32b63ec58 | |||
6ebc581b52 | |||
069d63561a | |||
72b39d3f92 | |||
e23b54a59f | |||
![]() |
5e9dba822d | ||
98bb8e6955 | |||
5b06759473 | |||
61776befc3 | |||
8f1997975d | |||
32b1a13fa1 | |||
e89d42ddff | |||
a46ff1dd38 | |||
2c0ccb0159 | |||
07726ef1b6 | |||
ca0c9757f2 | |||
a7b64a714d | |||
4f48b2992b | |||
93ba5e2375 | |||
7e92717439 | |||
db795a4727 | |||
da67a19ed9 | |||
2545119112 | |||
d6c3ea9e7a | |||
00f3957b8e | |||
c1279768a7 | |||
cbcd74de22 | |||
b71e29b3da | |||
47b36ddcce | |||
2964c4e1d0 | |||
333dc7b5c4 | |||
0d8c479225 | |||
1552c92fb1 | |||
5568455d63 | |||
204ae33d75 | |||
b815088416 | |||
![]() |
24e0165463 | ||
205254150a | |||
763cd2e0be | |||
5bd41b2e25 | |||
63bd356faf | |||
b9641cfc37 | |||
7fbb767259 | |||
![]() |
5e37f70307 | ||
![]() |
a92805bf24 | ||
484714992c | |||
13af88b23f | |||
e14f8c2dd7 | |||
a37dac0a88 | |||
fee4b58627 | |||
c4cee2e221 | |||
9558fa5196 | |||
565b33c0ad | |||
a8e0fe6a54 | |||
2309fa20af | |||
![]() |
6a9775ec6f | ||
0f48b37aae | |||
ae5a89e80a | |||
4312cb8545 | |||
cd494087c1 | |||
![]() |
b069218a55 | ||
![]() |
e2f0b4a0cb | ||
1de3636624 | |||
512a560cde | |||
a55d318d71 | |||
c6a200c693 | |||
1e7ef83e46 | |||
a37a6fb445 | |||
6483dee141 | |||
ffc4c126f5 | |||
![]() |
f159d49f56 | ||
![]() |
92dae5775f | ||
50fb0fd636 | |||
5cad004d71 | |||
97e3a2d935 | |||
![]() |
b1696702cd | ||
![]() |
ae6f3056fc | ||
78ae587649 | |||
aa23e870ec | |||
01779970c2 | |||
b91ac86cfc | |||
5705db5bb3 | |||
0ed254574f | |||
![]() |
f60b95b532 | ||
c3c69fee09 | |||
86d520f268 | |||
![]() |
9792994311 | ||
2d4c7fa896 | |||
2814740f5b | |||
ee4ed99866 | |||
![]() |
0bd3cad04e | ||
![]() |
f72cc47d8e | ||
0c703b856b | |||
86992a96b8 | |||
c2292b2cd6 | |||
7d1a10a9bb | |||
a5e3899853 | |||
![]() |
477631d9ec | ||
b9c6ef4e8f | |||
0e52af097f | |||
989d510e3e | |||
9a69c456bd | |||
3d8dea9ff9 | |||
![]() |
3f7014ecc9 | ||
0a8a22fc04 | |||
9a312ba192 | |||
338c1060d5 | |||
0578921063 | |||
c20098e6ec | |||
![]() |
d5efda72f5 | ||
b32f9bf801 | |||
d19443074a | |||
![]() |
5ef5a9fc24 | ||
![]() |
d5920744f4 | ||
56ed4c14d3 | |||
2d8606b360 | |||
ca0dbf8c26 | |||
d1f118d228 | |||
be3f3812dc | |||
cb0fbe1fde | |||
ab927f5ca7 | |||
c4e041da23 | |||
![]() |
7c4fc5b58d | ||
de5d36560f | |||
56ff954030 | |||
c0122cc888 | |||
a159f67ccc | |||
f1cca30557 | |||
0988711575 | |||
fca6a9fe3f | |||
e38532773b | |||
cef8f5ff50 | |||
1e98a0cee5 | |||
431255e5e8 | |||
27b70428c1 | |||
e6a732daad | |||
7e60d8a713 | |||
2fd657db5b | |||
aec56e562a | |||
a1f0f2eacb | |||
23ffcb242d | |||
61e92eeb3e | |||
1620dcd208 | |||
c5ec3738d8 | |||
e130903060 | |||
0f89d05848 | |||
42a6b2fd06 | |||
1766549418 | |||
7da979c070 | |||
67c490daaf | |||
68e3755209 | |||
9f290467ca | |||
4fe8c62b56 | |||
198e571e87 | |||
f1b0b0ffb8 | |||
8f69c91408 | |||
0de1d2e84e | |||
![]() |
bb3d03973a | ||
![]() |
26d2caee3b | ||
218360a892 | |||
ca9cdba2df | |||
b869da0c10 | |||
70a7685d04 | |||
2b6c01d98c | |||
70a0d45b69 | |||
594656e7a3 | |||
fed4fc9c42 | |||
8ca8380699 | |||
![]() |
cb334428b0 | ||
9afd6e7b70 | |||
![]() |
7336af3259 | ||
128ebdb062 | |||
bc48da3235 | |||
be6e56b36b | |||
506d672524 | |||
![]() |
d54a08c8af | ||
1757840843 | |||
f8dd03d3dd | |||
![]() |
fd8418385c | ||
1ef8ef4941 | |||
d5d91b4ae4 | |||
02ab4ad991 | |||
fd22404837 | |||
51791004ea | |||
9cec9b4d6e | |||
24b84e4688 | |||
5eeaf4cce6 | |||
386b112f76 | |||
![]() |
d723e331f1 | ||
1cb99f5808 | |||
b3d101ac29 | |||
88e9e97ee9 | |||
247f37f765 | |||
221b7b27fc | |||
88b37b639e | |||
1b4734c57d | |||
3f08488244 | |||
b9f54dd48a | |||
581fb2da10 | |||
c822e03e2a | |||
2fbb52dd86 | |||
3788003cda | |||
74039388cd | |||
7863e03e89 | |||
![]() |
de7f1e8e07 | ||
![]() |
251c017534 | ||
0704570721 | |||
8cf0d15b60 | |||
1cd9fcd98d | |||
2f7bec04e8 | |||
3692c0521c | |||
b67dca9b76 | |||
4b971bb87c | |||
![]() |
2e53f8b4b1 | ||
e1cb2a226c | |||
d8edc2c634 | |||
6f460b76fe | |||
bc1e3238c4 | |||
c12d8a72ce | |||
d7f0de0e3a | |||
![]() |
7168a4fa5c | ||
500ec993f5 | |||
![]() |
da279927b1 | ||
ac447ba1a3 | |||
e2473d3baf | |||
76471dbd5e | |||
4e45265dc6 | |||
262ef26ea3 | |||
35124acd19 | |||
c2001ec275 | |||
e7ae9f493a | |||
4fac3be146 | |||
2e6f914e37 | |||
0adb356f2e | |||
aa7051c8f2 | |||
aff6227412 | |||
dae9917915 | |||
2206b6b9a0 | |||
f613c4c095 | |||
98a5c924fc | |||
![]() |
03c9563582 | ||
f9add2d63e | |||
![]() |
e5e8db73df | ||
6ae34bb071 | |||
7c703b4699 | |||
f1118ee51e | |||
ab2a7aa0da | |||
cebe5f5bf4 | |||
0cbcddd91e | |||
b31250feba | |||
444971aa8e | |||
f7f558e293 | |||
e121b5b66c | |||
![]() |
d2e6087335 | ||
aa6c922d99 | |||
d2f4fb68f5 | |||
2531358297 | |||
08264aaf82 | |||
61bd5882a2 | |||
a0bb6bb4d6 | |||
97465046c6 | |||
92daff6ac2 | |||
2efc2221cc | |||
0789f61373 | |||
602ecbdf9a | |||
eb7827e797 | |||
12a83db83c | |||
f86331a033 | |||
ef88047a97 | |||
a773cd3850 | |||
35c3644e78 | |||
63342861e7 | |||
b066d58216 | |||
236be8e9f1 | |||
dcc500e5a2 | |||
![]() |
c6eaa9c552 | ||
658fd8df0b | |||
![]() |
004172de38 | ||
6b5e1cfaca | |||
2cda65a35a | |||
8015433f81 | |||
e3cf7ebdb1 | |||
a073e1e401 | |||
7b5a6f452a | |||
466b50dbc9 | |||
2fb8c6805a | |||
e3d3296327 | |||
e6a41e1c80 | |||
b2bb3e4b72 | |||
4a3f99ad5a | |||
5a11c6e558 | |||
5514ca58a4 | |||
94e8db1e86 | |||
3652f5f758 | |||
c91d196159 | |||
9812a08848 | |||
e216660382 | |||
e253fb2143 | |||
3bf10e5d0a | |||
2378f057a0 | |||
bc4c20d414 | |||
ffddf9e5c9 | |||
447378753d | |||
845716e600 | |||
d6646f7a8a | |||
1e2376f41f | |||
82808e18e6 | |||
5ffb9b6dc4 | |||
![]() |
a0acb9bd0c | ||
e6cd4761e7 | |||
726bc3a46b | |||
610e68590b | |||
ce5561b815 | |||
f12a6ff5cb | |||
40d28b40df | |||
![]() |
c49d2cbe92 | ||
![]() |
b41c72b710 | ||
827c5b399e | |||
8f2db94627 | |||
c26011efcb | |||
6b1b3383c6 | |||
![]() |
a9642f8d61 | ||
c155a5f9d7 | |||
752c6d668b | |||
bbadee6fc1 | |||
7a7ae4df43 | |||
338408772a | |||
71c39a9e2e | |||
cae3b581b0 | |||
499c24ce75 | |||
cbe9a87d28 | |||
01ab36ebc1 | |||
e206a0ae96 | |||
4930cd5db6 | |||
a07089dcb1 | |||
7a97e925fd | |||
56b068a664 | |||
64d9291d26 | |||
![]() |
2cc56495f3 | ||
72acce43bc | |||
5d59b38605 | |||
057cb7e5e7 | |||
65f547c3fc | |||
9fc5a9c78f | |||
7ea4342e73 | |||
833eb90820 | |||
![]() |
25478bdc9a | ||
5a50b46376 | |||
f5e5a0987a | |||
050b205a97 | |||
3850fdd5b9 | |||
98a5658239 | |||
cd818fd081 | |||
75b53542f2 | |||
17770192fb | |||
e0763760e4 | |||
f8dea3fe64 | |||
2ddbf81c47 | |||
f9db7675e0 | |||
785503a7e4 | |||
1a887b0088 | |||
4d46e8a5e0 | |||
4b259edb0a | |||
de35a90f9f | |||
ebe5a5eca8 | |||
![]() |
dbeab82a89 | ||
![]() |
16fc0da0e7 | ||
21f22759ea | |||
60c0b79256 | |||
![]() |
6b4405d757 | ||
d144983f8c | |||
56f66602c7 |
@@ -269,9 +269,5 @@ StatementMacros:
|
|||||||
- PyObject_HEAD
|
- PyObject_HEAD
|
||||||
- PyObject_VAR_HEAD
|
- PyObject_VAR_HEAD
|
||||||
|
|
||||||
StatementMacros:
|
|
||||||
- GPU_STAGE_INTERFACE_CREATE
|
|
||||||
- GPU_SHADER_DESCRIPTOR
|
|
||||||
|
|
||||||
MacroBlockBegin: "^BSDF_CLOSURE_CLASS_BEGIN$"
|
MacroBlockBegin: "^BSDF_CLOSURE_CLASS_BEGIN$"
|
||||||
MacroBlockEnd: "^BSDF_CLOSURE_CLASS_END$"
|
MacroBlockEnd: "^BSDF_CLOSURE_CLASS_END$"
|
||||||
|
102
CMakeLists.txt
102
CMakeLists.txt
@@ -187,6 +187,13 @@ mark_as_advanced(CPACK_OVERRIDE_PACKAGENAME)
|
|||||||
mark_as_advanced(BUILDINFO_OVERRIDE_DATE)
|
mark_as_advanced(BUILDINFO_OVERRIDE_DATE)
|
||||||
mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
|
mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
|
||||||
|
|
||||||
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16")
|
||||||
|
option(WITH_UNITY_BUILD "Enable unity build for modules that support it to improve compile times" ON)
|
||||||
|
mark_as_advanced(WITH_UNITY_BUILD)
|
||||||
|
else()
|
||||||
|
set(WITH_UNITY_BUILD OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
||||||
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
||||||
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ON)
|
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ON)
|
||||||
@@ -266,11 +273,13 @@ endif()
|
|||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
|
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
|
||||||
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
|
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
|
||||||
|
option(WITH_SYSTEM_FREETYPE "Use the freetype library provided by the operating system" OFF)
|
||||||
else()
|
else()
|
||||||
# not an option for other OS's
|
# not an option for other OS's
|
||||||
set(WITH_SYSTEM_GLEW OFF)
|
set(WITH_SYSTEM_GLEW OFF)
|
||||||
set(WITH_SYSTEM_GLES OFF)
|
set(WITH_SYSTEM_GLES OFF)
|
||||||
|
set(WITH_SYSTEM_FREETYPE OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@@ -426,30 +435,40 @@ mark_as_advanced(WITH_CYCLES_DEBUG_NAN)
|
|||||||
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
||||||
|
|
||||||
# NVIDIA CUDA & OptiX
|
# NVIDIA CUDA & OptiX
|
||||||
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles NVIDIA CUDA compute support" ON)
|
if(NOT APPLE)
|
||||||
option(WITH_CYCLES_DEVICE_OPTIX "Enable Cycles NVIDIA OptiX support" ON)
|
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles NVIDIA CUDA compute support" ON)
|
||||||
mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
|
option(WITH_CYCLES_DEVICE_OPTIX "Enable Cycles NVIDIA OptiX support" ON)
|
||||||
|
mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
|
||||||
|
|
||||||
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles NVIDIA CUDA binaries" OFF)
|
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")
|
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_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_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)
|
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(CYCLES_CUDA_BINARIES_ARCH)
|
||||||
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
||||||
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
||||||
mark_as_advanced(WITH_CUDA_DYNLOAD)
|
mark_as_advanced(WITH_CUDA_DYNLOAD)
|
||||||
|
endif()
|
||||||
|
|
||||||
# AMD HIP
|
# AMD HIP
|
||||||
if(WIN32)
|
if(NOT APPLE)
|
||||||
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
|
if(WIN32)
|
||||||
else()
|
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
|
||||||
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" OFF)
|
else()
|
||||||
|
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
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)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Apple Metal
|
||||||
|
if(APPLE)
|
||||||
|
option(WITH_CYCLES_DEVICE_METAL "Enable Cycles Apple Metal compute support" ON)
|
||||||
endif()
|
endif()
|
||||||
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)
|
||||||
@@ -494,11 +513,10 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# This should be turned off when Blender enter beta/rc/release
|
# This should be turned off when Blender enter beta/rc/release
|
||||||
if("${BLENDER_VERSION_CYCLE}" STREQUAL "release" OR
|
if("${BLENDER_VERSION_CYCLE}" STREQUAL "alpha")
|
||||||
"${BLENDER_VERSION_CYCLE}" STREQUAL "rc")
|
|
||||||
set(WITH_EXPERIMENTAL_FEATURES OFF)
|
|
||||||
else()
|
|
||||||
set(WITH_EXPERIMENTAL_FEATURES ON)
|
set(WITH_EXPERIMENTAL_FEATURES ON)
|
||||||
|
else()
|
||||||
|
set(WITH_EXPERIMENTAL_FEATURES OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Unit testsing
|
# Unit testsing
|
||||||
@@ -520,12 +538,14 @@ option(WITH_OPENGL "When off limits visibility of the opengl header
|
|||||||
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
||||||
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
||||||
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
||||||
|
option(WITH_GPU_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
|
||||||
|
|
||||||
mark_as_advanced(
|
mark_as_advanced(
|
||||||
WITH_OPENGL
|
WITH_OPENGL
|
||||||
WITH_GLEW_ES
|
WITH_GLEW_ES
|
||||||
WITH_GL_EGL
|
WITH_GL_EGL
|
||||||
WITH_GL_PROFILE_ES20
|
WITH_GL_PROFILE_ES20
|
||||||
|
WITH_GPU_SHADER_BUILDER
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@@ -543,12 +563,18 @@ if(WIN32)
|
|||||||
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
|
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler toolchain
|
# Compiler tool-chain.
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(UNIX AND NOT APPLE)
|
||||||
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
mark_as_advanced(WITH_LINKER_GOLD)
|
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
|
||||||
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
|
mark_as_advanced(WITH_LINKER_GOLD)
|
||||||
mark_as_advanced(WITH_LINKER_LLD)
|
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
|
||||||
|
mark_as_advanced(WITH_LINKER_LLD)
|
||||||
|
endif()
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
option(WITH_LINKER_MOLD "Use ld.mold linker which is usually faster than ld.gold & ld.lld." OFF)
|
||||||
|
mark_as_advanced(WITH_LINKER_MOLD)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
|
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
|
||||||
@@ -659,7 +685,7 @@ if(WIN32 OR XCODE)
|
|||||||
option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON)
|
option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON)
|
||||||
mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS)
|
mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS)
|
||||||
|
|
||||||
if (IDE_GROUP_PROJECTS_IN_FOLDERS)
|
if(IDE_GROUP_PROJECTS_IN_FOLDERS)
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -684,9 +710,12 @@ if(UNIX AND NOT APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Installation process.
|
# Installation process.
|
||||||
option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" OFF)
|
set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after installation process")
|
||||||
mark_as_advanced(POSTINSTALL_SCRIPT)
|
mark_as_advanced(POSTINSTALL_SCRIPT)
|
||||||
|
|
||||||
|
set(POSTCONFIGURE_SCRIPT "" CACHE FILEPATH "Run given CMake script as the last step of CMake configuration")
|
||||||
|
mark_as_advanced(POSTCONFIGURE_SCRIPT)
|
||||||
|
|
||||||
# end option(...)
|
# end option(...)
|
||||||
|
|
||||||
|
|
||||||
@@ -840,7 +869,7 @@ if(WITH_AUDASPACE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Auto-enable CUDA dynload if toolkit is not found.
|
# Auto-enable CUDA dynload if toolkit is not found.
|
||||||
if(NOT WITH_CUDA_DYNLOAD)
|
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_CUDA AND NOT WITH_CUDA_DYNLOAD)
|
||||||
find_package(CUDA)
|
find_package(CUDA)
|
||||||
if(NOT CUDA_FOUND)
|
if(NOT CUDA_FOUND)
|
||||||
message(STATUS "CUDA toolkit not found, using dynamic runtime loading of libraries (WITH_CUDA_DYNLOAD) instead")
|
message(STATUS "CUDA toolkit not found, using dynamic runtime loading of libraries (WITH_CUDA_DYNLOAD) instead")
|
||||||
@@ -2050,3 +2079,8 @@ endif()
|
|||||||
if(0)
|
if(0)
|
||||||
print_all_vars()
|
print_all_vars()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Should be the last step of configuration.
|
||||||
|
if(POSTCONFIGURE_SCRIPT)
|
||||||
|
include(${POSTCONFIGURE_SCRIPT})
|
||||||
|
endif()
|
||||||
|
@@ -63,6 +63,7 @@ include(cmake/jpeg.cmake)
|
|||||||
include(cmake/blosc.cmake)
|
include(cmake/blosc.cmake)
|
||||||
include(cmake/pthreads.cmake)
|
include(cmake/pthreads.cmake)
|
||||||
include(cmake/openexr.cmake)
|
include(cmake/openexr.cmake)
|
||||||
|
include(cmake/brotli.cmake)
|
||||||
include(cmake/freetype.cmake)
|
include(cmake/freetype.cmake)
|
||||||
include(cmake/freeglut.cmake)
|
include(cmake/freeglut.cmake)
|
||||||
include(cmake/glew.cmake)
|
include(cmake/glew.cmake)
|
||||||
|
@@ -25,8 +25,13 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(BOOST_TOOLSET toolset=msvc-14.1)
|
if(MSVC_VERSION GREATER_EQUAL 1920) # 2019
|
||||||
set(BOOST_COMPILER_STRING -vc141)
|
set(BOOST_TOOLSET toolset=msvc-14.2)
|
||||||
|
set(BOOST_COMPILER_STRING -vc142)
|
||||||
|
else() # 2017
|
||||||
|
set(BOOST_TOOLSET toolset=msvc-14.1)
|
||||||
|
set(BOOST_COMPILER_STRING -vc141)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
|
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
|
||||||
set(BOOST_BUILD_COMMAND b2)
|
set(BOOST_BUILD_COMMAND b2)
|
||||||
|
38
build_files/build_environment/cmake/brotli.cmake
Normal file
38
build_files/build_environment/cmake/brotli.cmake
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# ***** 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.
|
||||||
|
#
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
|
set(BROTLI_EXTRA_ARGS
|
||||||
|
)
|
||||||
|
|
||||||
|
ExternalProject_Add(external_brotli
|
||||||
|
URL file://${PACKAGE_DIR}/${BROTLI_FILE}
|
||||||
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
|
URL_HASH ${BROTLI_HASH_TYPE}=${BROTLI_HASH}
|
||||||
|
PREFIX ${BUILD_DIR}/brotli
|
||||||
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/brotli ${DEFAULT_CMAKE_FLAGS} ${BROTLI_EXTRA_ARGS}
|
||||||
|
INSTALL_DIR ${LIBDIR}/brotli
|
||||||
|
)
|
||||||
|
|
||||||
|
if(BUILD_MODE STREQUAL Release AND WIN32)
|
||||||
|
ExternalProject_Add_Step(external_brotli after_install
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/brotli/include ${HARVEST_TARGET}/brotli/include
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlidec-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlidec-static${LIBEXT}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlicommon-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlicommon-static${LIBEXT}
|
||||||
|
DEPENDEES install
|
||||||
|
)
|
||||||
|
endif()
|
@@ -94,3 +94,4 @@ download_source(POTRACE)
|
|||||||
download_source(HARU)
|
download_source(HARU)
|
||||||
download_source(ZSTD)
|
download_source(ZSTD)
|
||||||
download_source(FLEX)
|
download_source(FLEX)
|
||||||
|
download_source(BROTLI)
|
||||||
|
@@ -23,9 +23,12 @@ set(FREETYPE_EXTRA_ARGS
|
|||||||
-DWITH_HarfBuzz=OFF
|
-DWITH_HarfBuzz=OFF
|
||||||
-DFT_WITH_HARFBUZZ=OFF
|
-DFT_WITH_HARFBUZZ=OFF
|
||||||
-DFT_WITH_BZIP2=OFF
|
-DFT_WITH_BZIP2=OFF
|
||||||
|
-DFT_WITH_BROTLI=ON
|
||||||
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
|
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
|
||||||
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
|
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
|
||||||
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
|
-DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include
|
||||||
|
-DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib
|
||||||
|
)
|
||||||
|
|
||||||
ExternalProject_Add(external_freetype
|
ExternalProject_Add(external_freetype
|
||||||
URL file://${PACKAGE_DIR}/${FREETYPE_FILE}
|
URL file://${PACKAGE_DIR}/${FREETYPE_FILE}
|
||||||
@@ -36,6 +39,11 @@ ExternalProject_Add(external_freetype
|
|||||||
INSTALL_DIR ${LIBDIR}/freetype
|
INSTALL_DIR ${LIBDIR}/freetype
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_dependencies(
|
||||||
|
external_freetype
|
||||||
|
external_brotli
|
||||||
|
)
|
||||||
|
|
||||||
if(BUILD_MODE STREQUAL Release AND WIN32)
|
if(BUILD_MODE STREQUAL Release AND WIN32)
|
||||||
ExternalProject_Add_Step(external_freetype after_install
|
ExternalProject_Add_Step(external_freetype after_install
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
|
||||||
|
@@ -38,13 +38,6 @@ elseif(UNIX AND NOT APPLE)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BLENDER_PLATFORM_ARM)
|
|
||||||
set(GMP_OPTIONS
|
|
||||||
${GMP_OPTIONS}
|
|
||||||
--disable-assembly
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
ExternalProject_Add(external_gmp
|
ExternalProject_Add(external_gmp
|
||||||
URL file://${PACKAGE_DIR}/${GMP_FILE}
|
URL file://${PACKAGE_DIR}/${GMP_FILE}
|
||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
|
@@ -79,6 +79,8 @@ endfunction()
|
|||||||
harvest(alembic/include alembic/include "*.h")
|
harvest(alembic/include alembic/include "*.h")
|
||||||
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
|
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
|
||||||
harvest(alembic/bin alembic/bin "*")
|
harvest(alembic/bin alembic/bin "*")
|
||||||
|
harvest(brotli/include brotli/include "*.h")
|
||||||
|
harvest(brotli/lib brotli/lib "*.a")
|
||||||
harvest(boost/include boost/include "*")
|
harvest(boost/include boost/include "*")
|
||||||
harvest(boost/lib boost/lib "*.a")
|
harvest(boost/lib boost/lib "*.a")
|
||||||
harvest(ffmpeg/include ffmpeg/include "*.h")
|
harvest(ffmpeg/include ffmpeg/include "*.h")
|
||||||
|
@@ -31,7 +31,7 @@ ExternalProject_Add(external_python_site_packages
|
|||||||
CONFIGURE_COMMAND ${PIP_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} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} --no-binary :all:
|
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${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)
|
||||||
|
@@ -83,9 +83,9 @@ else()
|
|||||||
set(OPENEXR_VERSION_POSTFIX)
|
set(OPENEXR_VERSION_POSTFIX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(FREETYPE_VERSION 2.10.2)
|
set(FREETYPE_VERSION 2.11.0)
|
||||||
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
|
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
|
||||||
set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945)
|
set(FREETYPE_HASH cf09172322f6b50cf8f568bf8fe14bde)
|
||||||
set(FREETYPE_HASH_TYPE MD5)
|
set(FREETYPE_HASH_TYPE MD5)
|
||||||
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
|
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
|
||||||
|
|
||||||
@@ -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.7)
|
set(PYTHON_VERSION 3.10.2)
|
||||||
set(PYTHON_SHORT_VERSION 3.9)
|
set(PYTHON_SHORT_VERSION 3.10)
|
||||||
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
|
set(PYTHON_SHORT_VERSION_NO_DOTS 310)
|
||||||
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 fddb060b483bc01850a3f412eea1d954)
|
set(PYTHON_HASH 14e8c22458ed7779a1957b26cde01db9)
|
||||||
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,18 +215,20 @@ 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 3.2)
|
set(IDNA_VERSION 3.3)
|
||||||
set(CHARSET_NORMALIZER_VERSION 2.0.6)
|
set(CHARSET_NORMALIZER_VERSION 2.0.10)
|
||||||
set(URLLIB3_VERSION 1.26.7)
|
set(URLLIB3_VERSION 1.26.8)
|
||||||
set(CERTIFI_VERSION 2021.10.8)
|
set(CERTIFI_VERSION 2021.10.8)
|
||||||
set(REQUESTS_VERSION 2.26.0)
|
set(REQUESTS_VERSION 2.27.1)
|
||||||
set(CYTHON_VERSION 0.29.24)
|
set(CYTHON_VERSION 0.29.26)
|
||||||
set(ZSTANDARD_VERSION 0.15.2 )
|
# The version of the zstd library used to build the Python package should match ZSTD_VERSION defined below.
|
||||||
|
# At this time of writing, 0.17.0 was already released, but built against zstd 1.5.1, while we use 1.5.0.
|
||||||
|
set(ZSTANDARD_VERSION 0.16.0)
|
||||||
|
|
||||||
set(NUMPY_VERSION 1.21.2)
|
set(NUMPY_VERSION 1.22.0)
|
||||||
set(NUMPY_SHORT_VERSION 1.21)
|
set(NUMPY_SHORT_VERSION 1.22)
|
||||||
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 5638d5dae3ca387be562912312db842e)
|
set(NUMPY_HASH 252de134862a27bd66705d29622edbfe)
|
||||||
set(NUMPY_HASH_TYPE MD5)
|
set(NUMPY_HASH_TYPE MD5)
|
||||||
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
|
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
|
||||||
|
|
||||||
@@ -474,9 +476,9 @@ set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
|
|||||||
set(ISPC_HASH_TYPE MD5)
|
set(ISPC_HASH_TYPE MD5)
|
||||||
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
|
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
|
||||||
|
|
||||||
set(GMP_VERSION 6.2.0)
|
set(GMP_VERSION 6.2.1)
|
||||||
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
|
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
|
||||||
set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
|
set(GMP_HASH 0b82665c4a92fd2ade7440c13fcaa42b)
|
||||||
set(GMP_HASH_TYPE MD5)
|
set(GMP_HASH_TYPE MD5)
|
||||||
set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)
|
set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)
|
||||||
|
|
||||||
@@ -500,3 +502,9 @@ set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
|
|||||||
|
|
||||||
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
|
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
|
||||||
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
|
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
|
||||||
|
|
||||||
|
set(BROTLI_VERSION v1.0.9)
|
||||||
|
set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz)
|
||||||
|
set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46)
|
||||||
|
set(BROTLI_HASH_TYPE SHA256)
|
||||||
|
set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
|
||||||
|
@@ -379,27 +379,27 @@ USE_CXX11=true
|
|||||||
CLANG_FORMAT_VERSION_MIN="6.0"
|
CLANG_FORMAT_VERSION_MIN="6.0"
|
||||||
CLANG_FORMAT_VERSION_MEX="10.0"
|
CLANG_FORMAT_VERSION_MEX="10.0"
|
||||||
|
|
||||||
PYTHON_VERSION="3.9.7"
|
PYTHON_VERSION="3.10.2"
|
||||||
PYTHON_VERSION_SHORT="3.9"
|
PYTHON_VERSION_SHORT="3.10"
|
||||||
PYTHON_VERSION_MIN="3.7"
|
PYTHON_VERSION_MIN="3.9"
|
||||||
PYTHON_VERSION_MEX="3.11"
|
PYTHON_VERSION_MEX="3.12"
|
||||||
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="3.2"
|
PYTHON_IDNA_VERSION="3.3"
|
||||||
PYTHON_IDNA_VERSION_MIN="2.0"
|
PYTHON_IDNA_VERSION_MIN="2.0"
|
||||||
PYTHON_IDNA_VERSION_MEX="4.0"
|
PYTHON_IDNA_VERSION_MEX="4.0"
|
||||||
PYTHON_IDNA_NAME="idna"
|
PYTHON_IDNA_NAME="idna"
|
||||||
|
|
||||||
PYTHON_CHARSET_NORMALIZER_VERSION="2.0.6"
|
PYTHON_CHARSET_NORMALIZER_VERSION="2.0.10"
|
||||||
PYTHON_CHARSET_NORMALIZER_VERSION_MIN="2.0.6"
|
PYTHON_CHARSET_NORMALIZER_VERSION_MIN="2.0.6"
|
||||||
PYTHON_CHARSET_NORMALIZER_VERSION_MEX="2.1.0" # requests uses `charset_normalizer~=2.0.0`
|
PYTHON_CHARSET_NORMALIZER_VERSION_MEX="2.1.0" # requests uses `charset_normalizer~=2.0.0`
|
||||||
PYTHON_CHARSET_NORMALIZER_NAME="charset-normalizer"
|
PYTHON_CHARSET_NORMALIZER_NAME="charset-normalizer"
|
||||||
|
|
||||||
PYTHON_URLLIB3_VERSION="1.26.7"
|
PYTHON_URLLIB3_VERSION="1.26.8"
|
||||||
PYTHON_URLLIB3_VERSION_MIN="1.0"
|
PYTHON_URLLIB3_VERSION_MIN="1.0"
|
||||||
PYTHON_URLLIB3_VERSION_MEX="2.0"
|
PYTHON_URLLIB3_VERSION_MEX="2.0"
|
||||||
PYTHON_URLLIB3_NAME="urllib3"
|
PYTHON_URLLIB3_NAME="urllib3"
|
||||||
@@ -409,17 +409,17 @@ PYTHON_CERTIFI_VERSION_MIN="2021.0"
|
|||||||
PYTHON_CERTIFI_VERSION_MEX="2023.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.27.1"
|
||||||
PYTHON_REQUESTS_VERSION_MIN="2.0"
|
PYTHON_REQUESTS_VERSION_MIN="2.0"
|
||||||
PYTHON_REQUESTS_VERSION_MEX="3.0"
|
PYTHON_REQUESTS_VERSION_MEX="3.0"
|
||||||
PYTHON_REQUESTS_NAME="requests"
|
PYTHON_REQUESTS_NAME="requests"
|
||||||
|
|
||||||
PYTHON_ZSTANDARD_VERSION="0.15.2"
|
PYTHON_ZSTANDARD_VERSION="0.16.0"
|
||||||
PYTHON_ZSTANDARD_VERSION_MIN="0.15.2"
|
PYTHON_ZSTANDARD_VERSION_MIN="0.15.2"
|
||||||
PYTHON_ZSTANDARD_VERSION_MEX="0.16.0"
|
PYTHON_ZSTANDARD_VERSION_MEX="0.20.0"
|
||||||
PYTHON_ZSTANDARD_NAME="zstandard"
|
PYTHON_ZSTANDARD_NAME="zstandard"
|
||||||
|
|
||||||
PYTHON_NUMPY_VERSION="1.21.2"
|
PYTHON_NUMPY_VERSION="1.22.0"
|
||||||
PYTHON_NUMPY_VERSION_MIN="1.14"
|
PYTHON_NUMPY_VERSION_MIN="1.14"
|
||||||
PYTHON_NUMPY_VERSION_MEX="2.0"
|
PYTHON_NUMPY_VERSION_MEX="2.0"
|
||||||
PYTHON_NUMPY_NAME="numpy"
|
PYTHON_NUMPY_NAME="numpy"
|
||||||
@@ -492,14 +492,14 @@ 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_MEX="13.0"
|
LLVM_VERSION_MEX="14.0"
|
||||||
LLVM_VERSION_FOUND=""
|
LLVM_VERSION_FOUND=""
|
||||||
LLVM_FORCE_BUILD=false
|
LLVM_FORCE_BUILD=false
|
||||||
LLVM_FORCE_REBUILD=false
|
LLVM_FORCE_REBUILD=false
|
||||||
LLVM_SKIP=false
|
LLVM_SKIP=false
|
||||||
|
|
||||||
# OSL needs to be compiled for now!
|
# OSL needs to be compiled for now!
|
||||||
OSL_VERSION="1.11.14.1"
|
OSL_VERSION="1.11.17.0"
|
||||||
OSL_VERSION_SHORT="1.11"
|
OSL_VERSION_SHORT="1.11"
|
||||||
OSL_VERSION_MIN="1.11"
|
OSL_VERSION_MIN="1.11"
|
||||||
OSL_VERSION_MEX="2.0"
|
OSL_VERSION_MEX="2.0"
|
||||||
@@ -2083,9 +2083,9 @@ compile_OIIO() {
|
|||||||
cmake_d="$cmake_d -D OPENEXR_VERSION=$OPENEXR_VERSION"
|
cmake_d="$cmake_d -D OPENEXR_VERSION=$OPENEXR_VERSION"
|
||||||
|
|
||||||
if [ "$_with_built_openexr" = true ]; then
|
if [ "$_with_built_openexr" = true ]; then
|
||||||
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
|
cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
|
||||||
cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr"
|
cmake_d="$cmake_d -D OPENEXR_ROOT=$INST/openexr"
|
||||||
INFO "ILMBASE_HOME=$INST/openexr"
|
INFO "Ilmbase_ROOT=$INST/openexr"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ptex is only needed when nicholas bishop is ready
|
# ptex is only needed when nicholas bishop is ready
|
||||||
@@ -2374,9 +2374,9 @@ compile_OSL() {
|
|||||||
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
|
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
|
||||||
|
|
||||||
if [ "$_with_built_openexr" = true ]; then
|
if [ "$_with_built_openexr" = true ]; then
|
||||||
INFO "ILMBASE_HOME=$INST/openexr"
|
cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
|
||||||
cmake_d="$cmake_d -D OPENEXR_ROOT_DIR=$INST/openexr"
|
cmake_d="$cmake_d -D OPENEXR_ROOT=$INST/openexr"
|
||||||
cmake_d="$cmake_d -D ILMBASE_ROOT_DIR=$INST/openexr"
|
INFO "Ilmbase_ROOT=$INST/openexr"
|
||||||
# XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
|
# XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -3620,8 +3620,8 @@ compile_FFmpeg() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
./configure --cc="gcc -Wl,--as-needed" \
|
./configure --cc="gcc -Wl,--as-needed" \
|
||||||
--extra-ldflags="-pthread -static-libgcc" \
|
--extra-ldflags="-pthread" \
|
||||||
--prefix=$_inst --enable-static \
|
--prefix=$_inst --enable-shared \
|
||||||
--disable-ffplay --disable-doc \
|
--disable-ffplay --disable-doc \
|
||||||
--enable-gray \
|
--enable-gray \
|
||||||
--enable-avfilter --disable-vdpau \
|
--enable-avfilter --disable-vdpau \
|
||||||
@@ -4036,14 +4036,14 @@ 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_MEX
|
check_package_version_ge_lt_DEB python${PYTHON_VERSION_SHORT}-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/')
|
install_packages_DEB python${PYTHON_VERSION_SHORT}-dev
|
||||||
|
|
||||||
install_packages_DEB python3-dev
|
|
||||||
clean_Python
|
clean_Python
|
||||||
PRINT ""
|
PRINT ""
|
||||||
|
|
||||||
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python${PYTHON_VERSION_SHORT}-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
for module in "${PYTHON_MODULES_PACKAGES[@]}"
|
for module in "${PYTHON_MODULES_PACKAGES[@]}"
|
||||||
do
|
do
|
||||||
module=($module)
|
module=($module)
|
||||||
@@ -4681,11 +4681,11 @@ install_RPM() {
|
|||||||
else
|
else
|
||||||
check_package_version_ge_lt_RPM python3-devel $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
|
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/')
|
|
||||||
|
|
||||||
install_packages_RPM python3-devel
|
install_packages_RPM python3-devel
|
||||||
clean_Python
|
clean_Python
|
||||||
|
|
||||||
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
for module in "${PYTHON_MODULES_PACKAGES[@]}"
|
for module in "${PYTHON_MODULES_PACKAGES[@]}"
|
||||||
do
|
do
|
||||||
module=($module)
|
module=($module)
|
||||||
@@ -5224,12 +5224,12 @@ install_ARCH() {
|
|||||||
else
|
else
|
||||||
check_package_version_ge_lt_ARCH python $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
|
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/')
|
|
||||||
|
|
||||||
install_packages_ARCH python
|
install_packages_ARCH python
|
||||||
clean_Python
|
clean_Python
|
||||||
PRINT ""
|
PRINT ""
|
||||||
|
|
||||||
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
for module in "${PYTHON_MODULES_PACKAGES[@]}"
|
for module in "${PYTHON_MODULES_PACKAGES[@]}"
|
||||||
do
|
do
|
||||||
module=($module)
|
module=($module)
|
||||||
@@ -5721,76 +5721,6 @@ install_OTHER() {
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Printing User Info
|
# Printing User Info
|
||||||
|
|
||||||
print_info_ffmpeglink_DEB() {
|
|
||||||
dpkg -L $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
|
|
||||||
}
|
|
||||||
|
|
||||||
print_info_ffmpeglink_RPM() {
|
|
||||||
rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
|
|
||||||
}
|
|
||||||
|
|
||||||
print_info_ffmpeglink_ARCH() {
|
|
||||||
pacman -Ql $_packages | grep -e ".*\/lib[^\/]\+\.so$" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
|
|
||||||
}
|
|
||||||
|
|
||||||
print_info_ffmpeglink() {
|
|
||||||
# This func must only print a ';'-separated list of libs...
|
|
||||||
if [ -z "$DISTRO" ]; then
|
|
||||||
ERROR "Failed to detect distribution type"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create list of packages from which to get libs names...
|
|
||||||
_packages=""
|
|
||||||
|
|
||||||
if [ "$THEORA_USE" = true ]; then
|
|
||||||
_packages="$_packages $THEORA_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$VORBIS_USE" = true ]; then
|
|
||||||
_packages="$_packages $VORBIS_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$OGG_USE" = true ]; then
|
|
||||||
_packages="$_packages $OGG_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$XVID_USE" = true ]; then
|
|
||||||
_packages="$_packages $XVID_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$VPX_USE" = true ]; then
|
|
||||||
_packages="$_packages $VPX_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$OPUS_USE" = true ]; then
|
|
||||||
_packages="$_packages $OPUS_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$MP3LAME_USE" = true ]; then
|
|
||||||
_packages="$_packages $MP3LAME_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$X264_USE" = true ]; then
|
|
||||||
_packages="$_packages $X264_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$OPENJPEG_USE" = true ]; then
|
|
||||||
_packages="$_packages $OPENJPEG_DEV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$DISTRO" = "DEB" ]; then
|
|
||||||
print_info_ffmpeglink_DEB
|
|
||||||
elif [ "$DISTRO" = "RPM" ]; then
|
|
||||||
print_info_ffmpeglink_RPM
|
|
||||||
elif [ "$DISTRO" = "ARCH" ]; then
|
|
||||||
print_info_ffmpeglink_ARCH
|
|
||||||
# XXX TODO!
|
|
||||||
else
|
|
||||||
PRINT "<Could not determine additional link libraries needed for ffmpeg, replace this by valid list of libs...>"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
print_info() {
|
print_info() {
|
||||||
PRINT ""
|
PRINT ""
|
||||||
PRINT ""
|
PRINT ""
|
||||||
@@ -5801,7 +5731,7 @@ print_info() {
|
|||||||
PRINT "If you're using CMake add this to your configuration flags:"
|
PRINT "If you're using CMake add this to your configuration flags:"
|
||||||
|
|
||||||
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*"
|
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*"
|
||||||
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
|
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CLANG* -U *CYCLES*"
|
||||||
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
|
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
|
||||||
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*"
|
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*"
|
||||||
|
|
||||||
@@ -6002,12 +5932,10 @@ print_info() {
|
|||||||
|
|
||||||
if [ "$FFMPEG_SKIP" = false ]; then
|
if [ "$FFMPEG_SKIP" = false ]; then
|
||||||
_1="-D WITH_CODEC_FFMPEG=ON"
|
_1="-D WITH_CODEC_FFMPEG=ON"
|
||||||
_2="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;`print_info_ffmpeglink`'"
|
|
||||||
PRINT " $_1"
|
PRINT " $_1"
|
||||||
PRINT " $_2"
|
_buildargs="$_buildargs $_1"
|
||||||
_buildargs="$_buildargs $_1 $_2"
|
|
||||||
if [ -d $INST/ffmpeg ]; then
|
if [ -d $INST/ffmpeg ]; then
|
||||||
_1="-D FFMPEG=$INST/ffmpeg"
|
_1="-D FFMPEG_ROOT_DIR=$INST/ffmpeg"
|
||||||
PRINT " $_1"
|
PRINT " $_1"
|
||||||
_buildargs="$_buildargs $_1"
|
_buildargs="$_buildargs $_1"
|
||||||
fi
|
fi
|
||||||
|
@@ -197,3 +197,38 @@ index 67ec0d15f..6dc3e85a0 100644
|
|||||||
#else
|
#else
|
||||||
#error Unknown architecture.
|
#error Unknown architecture.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
diff --git a/pxr/base/arch/demangle.cpp b/pxr/base/arch/demangle.cpp
|
||||||
|
index 67ec0d15f..6dc3e85a0 100644
|
||||||
|
--- a/pxr/base/arch/demangle.cpp
|
||||||
|
+++ b/pxr/base/arch/demangle.cpp
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
#if (ARCH_COMPILER_GCC_MAJOR == 3 && ARCH_COMPILER_GCC_MINOR >= 1) || \
|
||||||
|
ARCH_COMPILER_GCC_MAJOR > 3 || defined(ARCH_COMPILER_CLANG)
|
||||||
|
#define _AT_LEAST_GCC_THREE_ONE_OR_CLANG
|
||||||
|
+#include <cxxabi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
PXR_NAMESPACE_OPEN_SCOPE
|
||||||
|
@@ -138,7 +139,6 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_AT_LEAST_GCC_THREE_ONE_OR_CLANG)
|
||||||
|
-#include <cxxabi.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This routine doesn't work when you get to gcc3.4.
|
||||||
|
|
||||||
|
diff --git a/pxr/base/work/singularTask.h b/pxr/base/work/singularTask.h
|
||||||
|
index 67ec0d15f..6dc3e85a0 100644
|
||||||
|
--- a/pxr/base/work/singularTask.h
|
||||||
|
+++ b/pxr/base/work/singularTask.h
|
||||||
|
@@ -120,7 +120,7 @@
|
||||||
|
// case we go again to ensure the task can do whatever it
|
||||||
|
// was awakened to do. Once we successfully take the count
|
||||||
|
// to zero, we stop.
|
||||||
|
- size_t old = count;
|
||||||
|
+ std::size_t old = count;
|
||||||
|
do { _fn(); } while (
|
||||||
|
!count.compare_exchange_strong(old, 0));
|
||||||
|
});
|
||||||
|
@@ -1,64 +1,39 @@
|
|||||||
@echo off
|
@echo off
|
||||||
if NOT "%1" == "" (
|
if NOT "%1" == "" (
|
||||||
if "%1" == "2013" (
|
|
||||||
echo "Building for VS2013"
|
|
||||||
set VSVER=12.0
|
|
||||||
set VSVER_SHORT=12
|
|
||||||
set BuildDir=VS12
|
|
||||||
goto par2
|
|
||||||
)
|
|
||||||
if "%1" == "2015" (
|
|
||||||
echo "Building for VS2015"
|
|
||||||
set VSVER=14.0
|
|
||||||
set VSVER_SHORT=14
|
|
||||||
set BuildDir=VS14
|
|
||||||
goto par2
|
|
||||||
)
|
|
||||||
if "%1" == "2017" (
|
if "%1" == "2017" (
|
||||||
echo "Building for VS2017"
|
echo "Building for VS2017"
|
||||||
set VSVER=15.0
|
set VSVER=15.0
|
||||||
set VSVER_SHORT=15
|
set VSVER_SHORT=15
|
||||||
set BuildDir=VS15
|
set BuildDir=VS15
|
||||||
goto par2
|
goto par2
|
||||||
|
)
|
||||||
|
if "%1" == "2019" (
|
||||||
|
echo "Building for VS2019"
|
||||||
|
set VSVER=15.0
|
||||||
|
set VSVER_SHORT=15
|
||||||
|
set BuildDir=VS15
|
||||||
|
goto par2
|
||||||
)
|
)
|
||||||
|
|
||||||
)
|
)
|
||||||
:usage
|
:usage
|
||||||
|
|
||||||
Echo Usage build_deps 2013/2015/2017 x64/x86
|
Echo Usage build_deps 2017/2019 x64
|
||||||
goto exit
|
goto exit
|
||||||
:par2
|
:par2
|
||||||
if NOT "%2" == "" (
|
if NOT "%2" == "" (
|
||||||
if "%2" == "x86" (
|
|
||||||
echo "Building for x86"
|
|
||||||
set HARVESTROOT=Windows_vc
|
|
||||||
set ARCH=86
|
|
||||||
if "%1" == "2013" (
|
|
||||||
set CMAKE_BUILDER=Visual Studio 12 2013
|
|
||||||
)
|
|
||||||
if "%1" == "2015" (
|
|
||||||
set CMAKE_BUILDER=Visual Studio 14 2015
|
|
||||||
)
|
|
||||||
if "%1" == "2017" (
|
|
||||||
set CMAKE_BUILDER=Visual Studio 15 2017
|
|
||||||
)
|
|
||||||
|
|
||||||
goto start
|
|
||||||
)
|
|
||||||
if "%2" == "x64" (
|
if "%2" == "x64" (
|
||||||
echo "Building for x64"
|
echo "Building for x64"
|
||||||
set HARVESTROOT=Win64_vc
|
set HARVESTROOT=Win64_vc
|
||||||
set ARCH=64
|
set ARCH=64
|
||||||
if "%1" == "2013" (
|
if "%1" == "2019" (
|
||||||
set CMAKE_BUILDER=Visual Studio 12 2013 Win64
|
set CMAKE_BUILDER=Visual Studio 16 2019
|
||||||
)
|
set CMAKE_BUILD_ARCH=-A x64
|
||||||
if "%1" == "2015" (
|
|
||||||
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
|
||||||
)
|
)
|
||||||
if "%1" == "2017" (
|
if "%1" == "2017" (
|
||||||
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
|
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
|
||||||
|
set CMAKE_BUILD_ARCH=
|
||||||
)
|
)
|
||||||
|
|
||||||
goto start
|
goto start
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -120,7 +95,7 @@ set path=%BUILD_DIR%\downloads\mingw\mingw64\msys\1.0\bin\;%BUILD_DIR%\downloads
|
|||||||
mkdir %STAGING%\%BuildDir%%ARCH%R
|
mkdir %STAGING%\%BuildDir%%ARCH%R
|
||||||
cd %Staging%\%BuildDir%%ARCH%R
|
cd %Staging%\%BuildDir%%ARCH%R
|
||||||
echo %DATE% %TIME% : Start > %StatusFile%
|
echo %DATE% %TIME% : Start > %StatusFile%
|
||||||
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
|
cmake -G "%CMAKE_BUILDER%" %CMAKE_BUILD_ARCH% -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
|
||||||
echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
|
echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
|
||||||
if "%dobuild%" == "1" (
|
if "%dobuild%" == "1" (
|
||||||
msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
|
msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
|
||||||
@@ -133,7 +108,7 @@ if "%NODEBUG%" == "1" goto exit
|
|||||||
cd %BUILD_DIR%
|
cd %BUILD_DIR%
|
||||||
mkdir %STAGING%\%BuildDir%%ARCH%D
|
mkdir %STAGING%\%BuildDir%%ARCH%D
|
||||||
cd %Staging%\%BuildDir%%ARCH%D
|
cd %Staging%\%BuildDir%%ARCH%D
|
||||||
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
|
cmake -G "%CMAKE_BUILDER%" %CMAKE_BUILD_ARCH% -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
|
||||||
echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
|
echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
|
||||||
if "%dobuild%" == "1" (
|
if "%dobuild%" == "1" (
|
||||||
msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal
|
msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal
|
||||||
|
83
build_files/cmake/Modules/FindBrotli.cmake
Normal file
83
build_files/cmake/Modules/FindBrotli.cmake
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# - Find Brotli library (compression for freetype/woff2).
|
||||||
|
# This module defines
|
||||||
|
# BROTLI_INCLUDE_DIRS, where to find Brotli headers, Set when
|
||||||
|
# BROTLI_INCLUDE_DIR is found.
|
||||||
|
# BROTLI_LIBRARIES, libraries to link against to use Brotli.
|
||||||
|
# BROTLI_ROOT_DIR, The base directory to search for Brotli.
|
||||||
|
# This can also be an environment variable.
|
||||||
|
# BROTLI_FOUND, If false, do not try to use Brotli.
|
||||||
|
#
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2022 Blender Foundation.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||||
|
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
# If BROTLI_ROOT_DIR was defined in the environment, use it.
|
||||||
|
IF(NOT BROTLI_ROOT_DIR AND NOT $ENV{BROTLI_ROOT_DIR} STREQUAL "")
|
||||||
|
SET(BROTLI_ROOT_DIR $ENV{BROTLI_ROOT_DIR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(_BROTLI_SEARCH_DIRS
|
||||||
|
${BROTLI_ROOT_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(BROTLI_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
brotli/decode.h
|
||||||
|
HINTS
|
||||||
|
${_BROTLI_SEARCH_DIRS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
include
|
||||||
|
DOC "Brotli header files"
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(BROTLI_LIBRARY_COMMON
|
||||||
|
NAMES
|
||||||
|
# Some builds use a special `-static` postfix in their static libraries names.
|
||||||
|
brotlicommon-static
|
||||||
|
brotlicommon
|
||||||
|
HINTS
|
||||||
|
${_BROTLI_SEARCH_DIRS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
lib64 lib lib/static
|
||||||
|
DOC "Brotli static common library"
|
||||||
|
)
|
||||||
|
FIND_LIBRARY(BROTLI_LIBRARY_DEC
|
||||||
|
NAMES
|
||||||
|
# Some builds use a special `-static` postfix in their static libraries names.
|
||||||
|
brotlidec-static
|
||||||
|
brotlidec
|
||||||
|
HINTS
|
||||||
|
${_BROTLI_SEARCH_DIRS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
lib64 lib lib/static
|
||||||
|
DOC "Brotli static decode library"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
IF(${BROTLI_LIBRARY_COMMON_NOTFOUND} or ${BROTLI_LIBRARY_DEC_NOTFOUND})
|
||||||
|
set(BROTLI_FOUND FALSE)
|
||||||
|
ELSE()
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set BROTLI_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Brotli DEFAULT_MSG BROTLI_LIBRARY_COMMON BROTLI_LIBRARY_DEC BROTLI_INCLUDE_DIR)
|
||||||
|
|
||||||
|
IF(BROTLI_FOUND)
|
||||||
|
get_filename_component(BROTLI_LIBRARY_DIR ${BROTLI_LIBRARY_COMMON} DIRECTORY)
|
||||||
|
SET(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
|
||||||
|
SET(BROTLI_LIBRARIES ${BROTLI_LIBRARY_DEC} ${BROTLI_LIBRARY_COMMON})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
BROTLI_INCLUDE_DIR
|
||||||
|
BROTLI_LIBRARY_COMMON
|
||||||
|
BROTLI_LIBRARY_DEC
|
||||||
|
BROTLI_LIBRARY_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
UNSET(_BROTLI_SEARCH_DIRS)
|
@@ -33,6 +33,8 @@ if(NOT FFMPEG_FIND_COMPONENTS)
|
|||||||
avfilter
|
avfilter
|
||||||
avformat
|
avformat
|
||||||
avutil
|
avutil
|
||||||
|
swscale
|
||||||
|
swresample
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -50,9 +52,9 @@ foreach(_component ${FFMPEG_FIND_COMPONENTS})
|
|||||||
string(TOUPPER ${_component} _upper_COMPONENT)
|
string(TOUPPER ${_component} _upper_COMPONENT)
|
||||||
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
|
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
|
||||||
NAMES
|
NAMES
|
||||||
${_upper_COMPONENT}
|
${_component}
|
||||||
HINTS
|
HINTS
|
||||||
${LIBDIR}/ffmpeg
|
${_ffmpeg_SEARCH_DIRS}
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
lib64 lib
|
lib64 lib
|
||||||
)
|
)
|
||||||
|
@@ -21,7 +21,7 @@ ENDIF()
|
|||||||
|
|
||||||
SET(_optix_SEARCH_DIRS
|
SET(_optix_SEARCH_DIRS
|
||||||
${OPTIX_ROOT_DIR}
|
${OPTIX_ROOT_DIR}
|
||||||
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.0.0"
|
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_PATH(OPTIX_INCLUDE_DIR
|
FIND_PATH(OPTIX_INCLUDE_DIR
|
||||||
|
@@ -34,7 +34,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
|
|||||||
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
|
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(PYTHON_VERSION 3.9 CACHE STRING "Python Version (major and minor only)")
|
SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
|
||||||
MARK_AS_ADVANCED(PYTHON_VERSION)
|
MARK_AS_ADVANCED(PYTHON_VERSION)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -114,7 +114,7 @@ def is_c_header(filename: str) -> bool:
|
|||||||
|
|
||||||
def is_c(filename: str) -> bool:
|
def is_c(filename: str) -> bool:
|
||||||
ext = splitext(filename)[1]
|
ext = splitext(filename)[1]
|
||||||
return (ext in {".c", ".cpp", ".cxx", ".m", ".mm", ".rc", ".cc", ".inl"})
|
return (ext in {".c", ".cpp", ".cxx", ".m", ".mm", ".rc", ".cc", ".inl", ".metal"})
|
||||||
|
|
||||||
|
|
||||||
def is_c_any(filename: str) -> bool:
|
def is_c_any(filename: str) -> bool:
|
||||||
|
@@ -19,9 +19,6 @@ set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
|
|||||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_COREAUDIO OFF CACHE BOOL "" FORCE)
|
set(WITH_COREAUDIO OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
|
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
|
|
||||||
set(WITH_CYCLES_EMBREE OFF CACHE BOOL "" FORCE)
|
|
||||||
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
|
|
||||||
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
|
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||||
|
@@ -61,6 +61,7 @@ set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
|||||||
# platform dependent options
|
# platform dependent options
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(WITH_COREAUDIO ON CACHE BOOL "" FORCE)
|
set(WITH_COREAUDIO ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_CYCLES_DEVICE_METAL ON CACHE BOOL "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
|
@@ -488,7 +488,6 @@ function(blender_add_test_executable
|
|||||||
|
|
||||||
include_directories(${includes})
|
include_directories(${includes})
|
||||||
include_directories(${includes_sys})
|
include_directories(${includes_sys})
|
||||||
setup_libdirs()
|
|
||||||
|
|
||||||
BLENDER_SRC_GTEST_EX(
|
BLENDER_SRC_GTEST_EX(
|
||||||
NAME ${name}
|
NAME ${name}
|
||||||
@@ -525,83 +524,6 @@ function(setup_heavy_lib_pool)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(SETUP_LIBDIRS)
|
|
||||||
|
|
||||||
# NOTE: For all new libraries, use absolute library paths.
|
|
||||||
# This should eventually be phased out.
|
|
||||||
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
|
|
||||||
if(NOT MSVC AND NOT APPLE)
|
|
||||||
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
|
|
||||||
|
|
||||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
|
||||||
link_directories(${PYTHON_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
|
|
||||||
link_directories(${SDL_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_CODEC_FFMPEG)
|
|
||||||
link_directories(${FFMPEG_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_IMAGE_OPENEXR)
|
|
||||||
link_directories(${OPENEXR_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_IMAGE_TIFF)
|
|
||||||
link_directories(${TIFF_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_BOOST)
|
|
||||||
link_directories(${BOOST_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENIMAGEIO)
|
|
||||||
link_directories(${OPENIMAGEIO_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENIMAGEDENOISE)
|
|
||||||
link_directories(${OPENIMAGEDENOISE_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENCOLORIO)
|
|
||||||
link_directories(${OPENCOLORIO_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENVDB)
|
|
||||||
link_directories(${OPENVDB_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENAL)
|
|
||||||
link_directories(${OPENAL_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_JACK AND NOT WITH_JACK_DYNLOAD)
|
|
||||||
link_directories(${JACK_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_PULSEAUDIO AND NOT WITH_PULSEAUDIO_DYNLOAD)
|
|
||||||
link_directories(${LIBPULSE_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_CODEC_SNDFILE)
|
|
||||||
link_directories(${LIBSNDFILE_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_FFTW3)
|
|
||||||
link_directories(${FFTW3_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENCOLLADA)
|
|
||||||
link_directories(${OPENCOLLADA_LIBPATH})
|
|
||||||
# # Never set
|
|
||||||
# link_directories(${PCRE_LIBPATH})
|
|
||||||
# link_directories(${EXPAT_LIBPATH})
|
|
||||||
endif()
|
|
||||||
if(WITH_LLVM)
|
|
||||||
link_directories(${LLVM_LIBPATH})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_ALEMBIC)
|
|
||||||
link_directories(${ALEMBIC_LIBPATH})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_GMP)
|
|
||||||
link_directories(${GMP_LIBPATH})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32 AND NOT UNIX)
|
|
||||||
link_directories(${PTHREADS_LIBPATH})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# Platform specific linker flags for targets.
|
# Platform specific linker flags for targets.
|
||||||
function(setup_platform_linker_flags
|
function(setup_platform_linker_flags
|
||||||
target)
|
target)
|
||||||
@@ -1275,43 +1197,20 @@ endfunction()
|
|||||||
macro(openmp_delayload
|
macro(openmp_delayload
|
||||||
projectname
|
projectname
|
||||||
)
|
)
|
||||||
if(MSVC)
|
|
||||||
if(WITH_OPENMP)
|
|
||||||
if(MSVC_CLANG)
|
|
||||||
set(OPENMP_DLL_NAME "libomp")
|
|
||||||
elseif(MSVC_VERSION EQUAL 1800)
|
|
||||||
set(OPENMP_DLL_NAME "vcomp120")
|
|
||||||
else()
|
|
||||||
set(OPENMP_DLL_NAME "vcomp140")
|
|
||||||
endif()
|
|
||||||
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
|
|
||||||
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
|
|
||||||
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
|
|
||||||
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(blender_precompile_headers target cpp header)
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# get the name for the pch output file
|
if(WITH_OPENMP)
|
||||||
get_filename_component(pchbase ${cpp} NAME_WE)
|
if(MSVC_CLANG)
|
||||||
set(pchfinal "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${pchbase}.pch")
|
set(OPENMP_DLL_NAME "libomp")
|
||||||
|
elseif(MSVC_VERSION EQUAL 1800)
|
||||||
# mark the cpp as the one outputting the pch
|
set(OPENMP_DLL_NAME "vcomp120")
|
||||||
set_property(SOURCE ${cpp} APPEND PROPERTY OBJECT_OUTPUTS "${pchfinal}")
|
else()
|
||||||
|
set(OPENMP_DLL_NAME "vcomp140")
|
||||||
# get all sources for the target
|
endif()
|
||||||
get_target_property(sources ${target} SOURCES)
|
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
|
||||||
|
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
|
||||||
# make all sources depend on the pch to enforce the build order
|
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
|
||||||
foreach(src ${sources})
|
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
|
||||||
set_property(SOURCE ${src} APPEND PROPERTY OBJECT_DEPENDS "${pchfinal}")
|
endif()
|
||||||
endforeach()
|
|
||||||
|
|
||||||
target_sources(${target} PRIVATE ${cpp} ${header})
|
|
||||||
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/Yu${header} /Fp${pchfinal} /FI${header}")
|
|
||||||
set_source_files_properties(${cpp} PROPERTIES COMPILE_FLAGS "/Yc${header} /Fp${pchfinal}")
|
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
@@ -128,25 +128,20 @@ if(WITH_CODEC_SNDFILE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_PYTHON)
|
if(WITH_PYTHON)
|
||||||
# we use precompiled libraries for py 3.9 and up by default
|
# Use precompiled libraries by default.
|
||||||
set(PYTHON_VERSION 3.9)
|
set(PYTHON_VERSION 3.10)
|
||||||
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
||||||
# normally cached but not since we include them with blender
|
# Normally cached but not since we include them with blender.
|
||||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
||||||
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}")
|
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}")
|
||||||
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}.a)
|
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}.a)
|
||||||
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
||||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
|
||||||
else()
|
else()
|
||||||
# module must be compiled against Python framework
|
# Module must be compiled against Python framework.
|
||||||
set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
|
set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
|
||||||
|
|
||||||
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}")
|
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}")
|
||||||
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}")
|
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}")
|
||||||
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}")
|
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}")
|
||||||
# set(PYTHON_LIBRARY python${PYTHON_VERSION})
|
|
||||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
|
|
||||||
|
|
||||||
unset(_py_framework)
|
unset(_py_framework)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -166,13 +161,18 @@ if(WITH_FFTW3)
|
|||||||
find_package(Fftw3)
|
find_package(Fftw3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# FreeType compiled with Brotli compression for woff2.
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
|
list(APPEND FREETYPE_LIBRARIES
|
||||||
|
${LIBDIR}/brotli/lib/libbrotlicommon-static.a
|
||||||
|
${LIBDIR}/brotli/lib/libbrotlidec-static.a)
|
||||||
|
|
||||||
if(WITH_IMAGE_OPENEXR)
|
if(WITH_IMAGE_OPENEXR)
|
||||||
find_package(OpenEXR)
|
find_package(OpenEXR)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CODEC_FFMPEG)
|
if(WITH_CODEC_FFMPEG)
|
||||||
|
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
|
||||||
set(FFMPEG_FIND_COMPONENTS
|
set(FFMPEG_FIND_COMPONENTS
|
||||||
avcodec avdevice avformat avutil
|
avcodec avdevice avformat avutil
|
||||||
mp3lame ogg opus swresample swscale
|
mp3lame ogg opus swresample swscale
|
||||||
@@ -257,9 +257,6 @@ if(WITH_BOOST)
|
|||||||
if(WITH_INTERNATIONAL)
|
if(WITH_INTERNATIONAL)
|
||||||
list(APPEND _boost_FIND_COMPONENTS locale)
|
list(APPEND _boost_FIND_COMPONENTS locale)
|
||||||
endif()
|
endif()
|
||||||
if(WITH_CYCLES_NETWORK)
|
|
||||||
list(APPEND _boost_FIND_COMPONENTS serialization)
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENVDB)
|
if(WITH_OPENVDB)
|
||||||
list(APPEND _boost_FIND_COMPONENTS iostreams)
|
list(APPEND _boost_FIND_COMPONENTS iostreams)
|
||||||
endif()
|
endif()
|
||||||
@@ -339,7 +336,7 @@ if(WITH_LLVM)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||||
set(CYCLES_OSL ${LIBDIR}/osl)
|
set(CYCLES_OSL ${LIBDIR}/osl)
|
||||||
|
|
||||||
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
|
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
|
||||||
@@ -359,7 +356,7 @@ if(WITH_CYCLES_OSL)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_EMBREE)
|
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||||
find_package(Embree 3.8.0 REQUIRED)
|
find_package(Embree 3.8.0 REQUIRED)
|
||||||
# Increase stack size for Embree, only works for executables.
|
# Increase stack size for Embree, only works for executables.
|
||||||
if(NOT WITH_PYTHON_MODULE)
|
if(NOT WITH_PYTHON_MODULE)
|
||||||
@@ -482,8 +479,11 @@ string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
|
|||||||
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
||||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
# llvm-ranlib doesn't support this flag. Xcode's libtool does.
|
||||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
if(NOT ${CMAKE_RANLIB} MATCHES ".*llvm-ranlib$")
|
||||||
|
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||||
|
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_COMPILER_CCACHE)
|
if(WITH_COMPILER_CCACHE)
|
||||||
if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
|
if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
|
||||||
@@ -510,3 +510,6 @@ list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
|
|||||||
|
|
||||||
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
|
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
|
||||||
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
|
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
|
||||||
|
|
||||||
|
# Same as `CFBundleIdentifier` in Info.plist.
|
||||||
|
set(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.blenderfoundation.blender")
|
||||||
|
@@ -96,7 +96,7 @@ else()
|
|||||||
# Detect SDK version to use.
|
# Detect SDK version to use.
|
||||||
if(NOT DEFINED OSX_SYSTEM)
|
if(NOT DEFINED OSX_SYSTEM)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND xcrun --show-sdk-version
|
COMMAND xcrun --sdk macosx --show-sdk-version
|
||||||
OUTPUT_VARIABLE OSX_SYSTEM
|
OUTPUT_VARIABLE OSX_SYSTEM
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# ***** END GPL LICENSE BLOCK *****
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
# Libraries configuration for any *nix system including Linux and Unix.
|
# Libraries configuration for any *nix system including Linux and Unix (excluding APPLE).
|
||||||
|
|
||||||
# Detect precompiled library directory
|
# Detect precompiled library directory
|
||||||
if(NOT DEFINED LIBDIR)
|
if(NOT DEFINED LIBDIR)
|
||||||
@@ -48,6 +48,9 @@ if(NOT DEFINED LIBDIR)
|
|||||||
unset(LIBDIR_CENTOS7_ABI)
|
unset(LIBDIR_CENTOS7_ABI)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Support restoring this value once pre-compiled libraries have been handled.
|
||||||
|
set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS})
|
||||||
|
|
||||||
if(EXISTS ${LIBDIR})
|
if(EXISTS ${LIBDIR})
|
||||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||||
|
|
||||||
@@ -100,7 +103,22 @@ find_package_wrapper(JPEG REQUIRED)
|
|||||||
find_package_wrapper(PNG REQUIRED)
|
find_package_wrapper(PNG REQUIRED)
|
||||||
find_package_wrapper(ZLIB REQUIRED)
|
find_package_wrapper(ZLIB REQUIRED)
|
||||||
find_package_wrapper(Zstd REQUIRED)
|
find_package_wrapper(Zstd REQUIRED)
|
||||||
find_package_wrapper(Freetype REQUIRED)
|
|
||||||
|
if(NOT WITH_SYSTEM_FREETYPE)
|
||||||
|
# FreeType compiled with Brotli compression for woff2.
|
||||||
|
find_package_wrapper(Freetype REQUIRED)
|
||||||
|
if(EXISTS ${LIBDIR})
|
||||||
|
find_package_wrapper(Brotli REQUIRED)
|
||||||
|
|
||||||
|
# NOTE: This is done on WIN32 & APPLE but fails on some Linux systems.
|
||||||
|
# See: https://devtalk.blender.org/t/22536
|
||||||
|
# So `BROTLI_LIBRARIES` need to be added directly after `FREETYPE_LIBRARIES`.
|
||||||
|
#
|
||||||
|
# list(APPEND FREETYPE_LIBRARIES
|
||||||
|
# ${BROTLI_LIBRARIES}
|
||||||
|
# )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_PYTHON)
|
if(WITH_PYTHON)
|
||||||
# No way to set py35, remove for now.
|
# No way to set py35, remove for now.
|
||||||
@@ -178,26 +196,30 @@ endif()
|
|||||||
|
|
||||||
if(WITH_CODEC_FFMPEG)
|
if(WITH_CODEC_FFMPEG)
|
||||||
if(EXISTS ${LIBDIR})
|
if(EXISTS ${LIBDIR})
|
||||||
# For precompiled lib directory, all ffmpeg dependencies are in the same folder
|
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
|
||||||
file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a)
|
# Override FFMPEG components to also include static library dependencies
|
||||||
set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
|
# included with precompiled libraries, and to ensure correct link order.
|
||||||
set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries")
|
set(FFMPEG_FIND_COMPONENTS
|
||||||
else()
|
avformat avcodec avdevice avutil swresample swscale
|
||||||
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
|
sndfile
|
||||||
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
FLAC
|
||||||
|
mp3lame
|
||||||
|
opus
|
||||||
|
theora theoradec theoraenc
|
||||||
|
vorbis vorbisenc vorbisfile ogg
|
||||||
|
vpx
|
||||||
|
x264
|
||||||
|
xvidcore)
|
||||||
|
elseif(FFMPEG)
|
||||||
|
# Old cache variable used for root dir, convert to new standard.
|
||||||
|
set(FFMPEG_ROOT_DIR ${FFMPEG})
|
||||||
endif()
|
endif()
|
||||||
|
find_package(FFmpeg)
|
||||||
|
|
||||||
mark_as_advanced(FFMPEG)
|
if(NOT FFMPEG_FOUND)
|
||||||
|
set(WITH_CODEC_FFMPEG OFF)
|
||||||
# lame, but until we have proper find module for ffmpeg
|
message(STATUS "FFmpeg not found, disabling it")
|
||||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
|
|
||||||
if(EXISTS "${FFMPEG}/include/ffmpeg/")
|
|
||||||
list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
|
|
||||||
endif()
|
endif()
|
||||||
# end lameness
|
|
||||||
|
|
||||||
mark_as_advanced(FFMPEG_LIBRARIES)
|
|
||||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_FFTW3)
|
if(WITH_FFTW3)
|
||||||
@@ -241,7 +263,7 @@ if(WITH_INPUT_NDOF)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||||
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
||||||
if(EXISTS ${CYCLES_OSL} AND NOT OSL_ROOT)
|
if(EXISTS ${CYCLES_OSL} AND NOT OSL_ROOT)
|
||||||
set(OSL_ROOT ${CYCLES_OSL})
|
set(OSL_ROOT ${CYCLES_OSL})
|
||||||
@@ -314,7 +336,7 @@ if(WITH_BOOST)
|
|||||||
endif()
|
endif()
|
||||||
set(Boost_USE_MULTITHREADED ON)
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
set(__boost_packages filesystem regex thread date_time)
|
set(__boost_packages filesystem regex thread date_time)
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||||
if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
|
if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
|
||||||
list(APPEND __boost_packages wave)
|
list(APPEND __boost_packages wave)
|
||||||
else()
|
else()
|
||||||
@@ -323,9 +345,6 @@ if(WITH_BOOST)
|
|||||||
if(WITH_INTERNATIONAL)
|
if(WITH_INTERNATIONAL)
|
||||||
list(APPEND __boost_packages locale)
|
list(APPEND __boost_packages locale)
|
||||||
endif()
|
endif()
|
||||||
if(WITH_CYCLES_NETWORK)
|
|
||||||
list(APPEND __boost_packages serialization)
|
|
||||||
endif()
|
|
||||||
if(WITH_OPENVDB)
|
if(WITH_OPENVDB)
|
||||||
list(APPEND __boost_packages iostreams)
|
list(APPEND __boost_packages iostreams)
|
||||||
endif()
|
endif()
|
||||||
@@ -403,7 +422,7 @@ if(WITH_OPENCOLORIO)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_EMBREE)
|
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||||
find_package(Embree 3.8.0 REQUIRED)
|
find_package(Embree 3.8.0 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -535,6 +554,21 @@ add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
|||||||
#
|
#
|
||||||
# Keep last, so indirectly linked libraries don't override our own pre-compiled libs.
|
# Keep last, so indirectly linked libraries don't override our own pre-compiled libs.
|
||||||
|
|
||||||
|
if(EXISTS ${LIBDIR})
|
||||||
|
# Clear the prefix path as it causes the `LIBDIR` to override system locations.
|
||||||
|
unset(CMAKE_PREFIX_PATH)
|
||||||
|
|
||||||
|
# Since the pre-compiled `LIBDIR` directories have been handled, don't prefer static libraries.
|
||||||
|
set(WITH_STATIC_LIBS ${WITH_STATIC_LIBS_INIT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_SYSTEM_FREETYPE)
|
||||||
|
find_package_wrapper(Freetype)
|
||||||
|
if(NOT FREETYPE_FOUND)
|
||||||
|
message(FATAL_ERROR "Failed finding system FreeType version!")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_LZO AND WITH_SYSTEM_LZO)
|
if(WITH_LZO AND WITH_SYSTEM_LZO)
|
||||||
find_package_wrapper(LZO)
|
find_package_wrapper(LZO)
|
||||||
if(NOT LZO_FOUND)
|
if(NOT LZO_FOUND)
|
||||||
@@ -647,6 +681,9 @@ endif()
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Compilers
|
# Compilers
|
||||||
|
|
||||||
|
# Only set the linker once.
|
||||||
|
set(_IS_LINKER_DEFAULT ON)
|
||||||
|
|
||||||
# GNU Compiler
|
# GNU Compiler
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
# ffp-contract=off:
|
# ffp-contract=off:
|
||||||
@@ -665,26 +702,89 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
string(PREPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ")
|
string(PREPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ")
|
||||||
unset(GCC_EXTRA_FLAGS_RELEASE)
|
unset(GCC_EXTRA_FLAGS_RELEASE)
|
||||||
|
|
||||||
if(WITH_LINKER_GOLD)
|
# NOTE(@campbellbarton): Eventually mold will be able to use `-fuse-ld=mold`,
|
||||||
|
# however at the moment this only works for GCC 12.1+ (unreleased at time of writing).
|
||||||
|
# So a workaround is used here "-B" which points to another path to find system commands
|
||||||
|
# such as `ld`.
|
||||||
|
if(WITH_LINKER_MOLD AND _IS_LINKER_DEFAULT)
|
||||||
|
find_program(MOLD_BIN "mold")
|
||||||
|
mark_as_advanced(MOLD_BIN)
|
||||||
|
if(NOT MOLD_BIN)
|
||||||
|
message(STATUS "The \"mold\" binary could not be found, using system linker.")
|
||||||
|
set(WITH_LINKER_MOLD OFF)
|
||||||
|
else()
|
||||||
|
# By default mold installs the binary to:
|
||||||
|
# - `{PREFIX}/bin/mold` as well as a symbolic-link in...
|
||||||
|
# - `{PREFIX}/lib/mold/ld`.
|
||||||
|
# (where `PREFIX` is typically `/usr/`).
|
||||||
|
#
|
||||||
|
# This block of code finds `{PREFIX}/lib/mold` from the `mold` binary.
|
||||||
|
# Other methods of searching for the path could also be made to work,
|
||||||
|
# we could even make our own directory and symbolic-link, however it's more
|
||||||
|
# convenient to use the one provided by mold.
|
||||||
|
#
|
||||||
|
# Use the binary path to "mold", to find the common prefix which contains "lib/mold".
|
||||||
|
# The parent directory: e.g. `/usr/bin/mold` -> `/usr/bin/`.
|
||||||
|
get_filename_component(MOLD_PREFIX "${MOLD_BIN}" DIRECTORY)
|
||||||
|
# The common prefix path: e.g. `/usr/bin/` -> `/usr/` to use as a hint.
|
||||||
|
get_filename_component(MOLD_PREFIX "${MOLD_PREFIX}" DIRECTORY)
|
||||||
|
# Find `{PREFIX}/lib/mold/ld`, store the directory component (without the `ld`).
|
||||||
|
# Then pass `-B {PREFIX}/lib/mold` to GCC so the `ld` located there overrides the default.
|
||||||
|
find_path(
|
||||||
|
MOLD_BIN_DIR "ld"
|
||||||
|
HINTS "${MOLD_PREFIX}"
|
||||||
|
# The default path is `libexec`, Arch Linux for e.g.
|
||||||
|
# replaces this with `lib` so check both.
|
||||||
|
PATH_SUFFIXES "libexec/mold" "lib/mold" "lib64/mold"
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
NO_CACHE
|
||||||
|
)
|
||||||
|
if(NOT MOLD_BIN_DIR)
|
||||||
|
message(STATUS
|
||||||
|
"The mold linker could not find the directory containing the linker command "
|
||||||
|
"(typically "
|
||||||
|
"\"${MOLD_PREFIX}/libexec/mold/ld\") or "
|
||||||
|
"\"${MOLD_PREFIX}/lib/mold/ld\") using system linker.")
|
||||||
|
set(WITH_LINKER_MOLD OFF)
|
||||||
|
endif()
|
||||||
|
unset(MOLD_PREFIX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_LINKER_MOLD)
|
||||||
|
# GCC will search for `ld` in this directory first.
|
||||||
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
|
||||||
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
|
||||||
|
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
|
||||||
|
set(_IS_LINKER_DEFAULT OFF)
|
||||||
|
endif()
|
||||||
|
unset(MOLD_BIN)
|
||||||
|
unset(MOLD_BIN_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_LINKER_GOLD AND _IS_LINKER_DEFAULT)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
|
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
|
||||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||||
string(APPEND CMAKE_C_FLAGS " -fuse-ld=gold")
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=gold")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -fuse-ld=gold")
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=gold")
|
||||||
|
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=gold")
|
||||||
|
set(_IS_LINKER_DEFAULT OFF)
|
||||||
else()
|
else()
|
||||||
message(STATUS "GNU gold linker isn't available, using the default system linker.")
|
message(STATUS "GNU gold linker isn't available, using the default system linker.")
|
||||||
endif()
|
endif()
|
||||||
unset(LD_VERSION)
|
unset(LD_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_LINKER_LLD)
|
if(WITH_LINKER_LLD AND _IS_LINKER_DEFAULT)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
|
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
|
||||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
if("${LD_VERSION}" MATCHES "LLD")
|
if("${LD_VERSION}" MATCHES "LLD")
|
||||||
string(APPEND CMAKE_C_FLAGS " -fuse-ld=lld")
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=lld")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -fuse-ld=lld")
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=lld")
|
||||||
|
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=lld")
|
||||||
|
set(_IS_LINKER_DEFAULT OFF)
|
||||||
else()
|
else()
|
||||||
message(STATUS "LLD linker isn't available, using the default system linker.")
|
message(STATUS "LLD linker isn't available, using the default system linker.")
|
||||||
endif()
|
endif()
|
||||||
@@ -694,6 +794,28 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
# CLang is the same as GCC for now.
|
# CLang is the same as GCC for now.
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||||
|
|
||||||
|
if(WITH_LINKER_MOLD AND _IS_LINKER_DEFAULT)
|
||||||
|
find_program(MOLD_BIN "mold")
|
||||||
|
mark_as_advanced(MOLD_BIN)
|
||||||
|
if(NOT MOLD_BIN)
|
||||||
|
message(STATUS "The \"mold\" binary could not be found, using system linker.")
|
||||||
|
set(WITH_LINKER_MOLD OFF)
|
||||||
|
else()
|
||||||
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
|
||||||
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " --ld-path=\"${MOLD_BIN}\"")
|
||||||
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " --ld-path=\"${MOLD_BIN}\"")
|
||||||
|
string(APPEND CMAKE_MODULE_LINKER_FLAGS " --ld-path=\"${MOLD_BIN}\"")
|
||||||
|
else()
|
||||||
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=\"${MOLD_BIN}\"")
|
||||||
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=\"${MOLD_BIN}\"")
|
||||||
|
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=\"${MOLD_BIN}\"")
|
||||||
|
endif()
|
||||||
|
set(_IS_LINKER_DEFAULT OFF)
|
||||||
|
endif()
|
||||||
|
unset(MOLD_BIN)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Intel C++ Compiler
|
# Intel C++ Compiler
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
# think these next two are broken
|
# think these next two are broken
|
||||||
@@ -717,6 +839,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
|||||||
string(APPEND PLATFORM_LINKFLAGS " -static-intel")
|
string(APPEND PLATFORM_LINKFLAGS " -static-intel")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
unset(_IS_LINKER_DEFAULT)
|
||||||
|
|
||||||
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
|
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
|
||||||
# use the same libraries as Blender with a different version or build options.
|
# use the same libraries as Blender with a different version or build options.
|
||||||
set(PLATFORM_LINKFLAGS
|
set(PLATFORM_LINKFLAGS
|
||||||
|
@@ -55,6 +55,10 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|||||||
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()
|
||||||
|
else()
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28.29921) # MSVC 2019 16.9.16
|
||||||
|
message(FATAL_ERROR "Compiler is unsupported, MSVC 2019 16.9.16 or newer is required for building blender.")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT WITH_PYTHON_MODULE)
|
if(NOT WITH_PYTHON_MODULE)
|
||||||
@@ -265,12 +269,6 @@ if(NOT DEFINED LIBDIR)
|
|||||||
elseif(MSVC_VERSION GREATER 1919)
|
elseif(MSVC_VERSION GREATER 1919)
|
||||||
message(STATUS "Visual Studio 2019 detected.")
|
message(STATUS "Visual Studio 2019 detected.")
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
||||||
elseif(MSVC_VERSION GREATER 1909)
|
|
||||||
message(STATUS "Visual Studio 2017 detected.")
|
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
|
||||||
elseif(MSVC_VERSION EQUAL 1900)
|
|
||||||
message(STATUS "Visual Studio 2015 detected.")
|
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||||
@@ -347,7 +345,11 @@ set(FREETYPE_INCLUDE_DIRS
|
|||||||
${LIBDIR}/freetype/include
|
${LIBDIR}/freetype/include
|
||||||
${LIBDIR}/freetype/include/freetype2
|
${LIBDIR}/freetype/include/freetype2
|
||||||
)
|
)
|
||||||
set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
|
set(FREETYPE_LIBRARIES
|
||||||
|
${LIBDIR}/freetype/lib/freetype2ST.lib
|
||||||
|
${LIBDIR}/brotli/lib/brotlidec-static.lib
|
||||||
|
${LIBDIR}/brotli/lib/brotlicommon-static.lib
|
||||||
|
)
|
||||||
windows_find_package(freetype REQUIRED)
|
windows_find_package(freetype REQUIRED)
|
||||||
|
|
||||||
if(WITH_FFTW3)
|
if(WITH_FFTW3)
|
||||||
@@ -461,7 +463,7 @@ if(WITH_JACK)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_PYTHON)
|
if(WITH_PYTHON)
|
||||||
set(PYTHON_VERSION 3.9) # CACHE STRING)
|
set(PYTHON_VERSION 3.10) # CACHE STRING)
|
||||||
|
|
||||||
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
||||||
set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)
|
set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)
|
||||||
@@ -477,7 +479,7 @@ if(WITH_PYTHON)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_BOOST)
|
if(WITH_BOOST)
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||||
set(boost_extra_libs wave)
|
set(boost_extra_libs wave)
|
||||||
endif()
|
endif()
|
||||||
if(WITH_INTERNATIONAL)
|
if(WITH_INTERNATIONAL)
|
||||||
@@ -520,7 +522,7 @@ if(WITH_BOOST)
|
|||||||
debug ${BOOST_LIBPATH}/libboost_thread-${BOOST_DEBUG_POSTFIX}
|
debug ${BOOST_LIBPATH}/libboost_thread-${BOOST_DEBUG_POSTFIX}
|
||||||
debug ${BOOST_LIBPATH}/libboost_chrono-${BOOST_DEBUG_POSTFIX}
|
debug ${BOOST_LIBPATH}/libboost_chrono-${BOOST_DEBUG_POSTFIX}
|
||||||
)
|
)
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||||
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
|
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
|
||||||
optimized ${BOOST_LIBPATH}/libboost_wave-${BOOST_POSTFIX}
|
optimized ${BOOST_LIBPATH}/libboost_wave-${BOOST_POSTFIX}
|
||||||
debug ${BOOST_LIBPATH}/libboost_wave-${BOOST_DEBUG_POSTFIX})
|
debug ${BOOST_LIBPATH}/libboost_wave-${BOOST_DEBUG_POSTFIX})
|
||||||
@@ -708,7 +710,7 @@ if(WITH_CODEC_SNDFILE)
|
|||||||
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
|
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||||
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
||||||
set(OSL_SHADER_DIR ${CYCLES_OSL}/shaders)
|
set(OSL_SHADER_DIR ${CYCLES_OSL}/shaders)
|
||||||
# Shaders have moved around a bit between OSL versions, check multiple locations
|
# Shaders have moved around a bit between OSL versions, check multiple locations
|
||||||
@@ -741,7 +743,7 @@ if(WITH_CYCLES_OSL)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_EMBREE)
|
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||||
windows_find_package(Embree)
|
windows_find_package(Embree)
|
||||||
if(NOT EMBREE_FOUND)
|
if(NOT EMBREE_FOUND)
|
||||||
set(EMBREE_INCLUDE_DIRS ${LIBDIR}/embree/include)
|
set(EMBREE_INCLUDE_DIRS ${LIBDIR}/embree/include)
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
update-code:
|
update-code:
|
||||||
git:
|
git:
|
||||||
submodules:
|
submodules:
|
||||||
- branch: master
|
- branch: gltf_vtree
|
||||||
commit_id: HEAD
|
commit_id: HEAD
|
||||||
path: release/scripts/addons
|
path: release/scripts/addons
|
||||||
- branch: master
|
- branch: master
|
||||||
|
@@ -3,9 +3,6 @@ echo No explicit msvc version requested, autodetecting version.
|
|||||||
call "%~dp0\detect_msvc2019.cmd"
|
call "%~dp0\detect_msvc2019.cmd"
|
||||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
call "%~dp0\detect_msvc2017.cmd"
|
|
||||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
|
||||||
|
|
||||||
call "%~dp0\detect_msvc2022.cmd"
|
call "%~dp0\detect_msvc2022.cmd"
|
||||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
|
|
||||||
if "%BUILD_VS_YEAR%"=="2019" 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
|
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
|
||||||
|
@@ -19,12 +19,6 @@ if "%WITH_PYDEBUG%"=="1" (
|
|||||||
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
|
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%BUILD_VS_YEAR%"=="2017" (
|
|
||||||
set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
|
|
||||||
) else (
|
|
||||||
set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
|
|
||||||
)
|
|
||||||
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
|
||||||
|
|
||||||
if NOT EXIST %BUILD_DIR%\nul (
|
if NOT EXIST %BUILD_DIR%\nul (
|
||||||
|
@@ -37,15 +37,9 @@ set LLVM_DIR=
|
|||||||
:DetectionComplete
|
:DetectionComplete
|
||||||
set CC=%LLVM_DIR%\bin\clang-cl
|
set CC=%LLVM_DIR%\bin\clang-cl
|
||||||
set CXX=%LLVM_DIR%\bin\clang-cl
|
set CXX=%LLVM_DIR%\bin\clang-cl
|
||||||
if "%BUILD_VS_YEAR%" == "2019" (
|
rem build and tested against 2019 16.2
|
||||||
rem build and tested against 2019 16.2
|
set CFLAGS=-m64 -fmsc-version=1922
|
||||||
set CFLAGS=-m64 -fmsc-version=1922
|
set CXXFLAGS=-m64 -fmsc-version=1922
|
||||||
set CXXFLAGS=-m64 -fmsc-version=1922
|
|
||||||
) else (
|
|
||||||
rem build and tested against 2017 15.7
|
|
||||||
set CFLAGS=-m64 -fmsc-version=1914
|
|
||||||
set CXXFLAGS=-m64 -fmsc-version=1914
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%WITH_ASAN%"=="1" (
|
if "%WITH_ASAN%"=="1" (
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
set BUILD_VS_VER=15
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
call "%~dp0\detect_msvc_vswhere.cmd"
|
|
@@ -3,7 +3,32 @@ 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)
|
||||||
|
REM For python, default on 39 but if that does not exist also check
|
||||||
|
REM the 310,311 and 312 folders to see if those are there, it checks
|
||||||
|
REM this far ahead to ensure good lib folder compatiblity in the future.
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\310\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\311\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\312\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT EXIST %PYTHON% (
|
||||||
|
echo Warning: Python not found, there is likely an issue with the library folder
|
||||||
|
set PYTHON=""
|
||||||
|
)
|
||||||
|
|
||||||
|
:detect_python_done
|
||||||
if NOT "%verbose%" == "" (
|
if NOT "%verbose%" == "" (
|
||||||
echo svn : "%SVN%"
|
echo svn : "%SVN%"
|
||||||
echo cmake : "%CMAKE%"
|
echo cmake : "%CMAKE%"
|
||||||
@@ -11,7 +36,3 @@ if NOT "%verbose%" == "" (
|
|||||||
echo git : "%GIT%"
|
echo git : "%GIT%"
|
||||||
echo python : "%PYTHON%"
|
echo python : "%PYTHON%"
|
||||||
)
|
)
|
||||||
if "%CMAKE%" == "" (
|
|
||||||
echo Cmake not found in path, required for building, exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
@@ -9,17 +9,11 @@ exit /b 1
|
|||||||
:detect_done
|
:detect_done
|
||||||
echo found clang-format in %CF_PATH%
|
echo found clang-format in %CF_PATH%
|
||||||
|
|
||||||
if EXIST %PYTHON% (
|
if NOT EXIST %PYTHON% (
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
echo python not found, required for this operation
|
||||||
goto detect_python_done
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
echo python not found in lib folder
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
|
||||||
echo found python (%PYTHON%)
|
|
||||||
|
|
||||||
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
|
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
|
||||||
|
|
||||||
REM The formatting script expects clang-format to be in the current PATH.
|
REM The formatting script expects clang-format to be in the current PATH.
|
||||||
|
@@ -1,18 +1,8 @@
|
|||||||
if EXIST "%PYTHON%" (
|
if NOT EXIST %PYTHON% (
|
||||||
goto detect_python_done
|
echo python not found, required for this operation
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
|
||||||
if EXIST %PYTHON% (
|
|
||||||
goto detect_python_done
|
|
||||||
)
|
|
||||||
|
|
||||||
echo python not found at %PYTHON%
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
|
||||||
echo found python (%PYTHON%)
|
|
||||||
|
|
||||||
call "%~dp0\find_inkscape.cmd"
|
call "%~dp0\find_inkscape.cmd"
|
||||||
|
|
||||||
if EXIST "%INKSCAPE_BIN%" (
|
if EXIST "%INKSCAPE_BIN%" (
|
||||||
|
@@ -1,18 +1,8 @@
|
|||||||
if EXIST %PYTHON% (
|
if NOT EXIST %PYTHON% (
|
||||||
goto detect_python_done
|
echo python not found, required for this operation
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
|
||||||
if EXIST %PYTHON% (
|
|
||||||
goto detect_python_done
|
|
||||||
)
|
|
||||||
|
|
||||||
echo python not found at %PYTHON%
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
|
||||||
echo found python (%PYTHON%)
|
|
||||||
|
|
||||||
call "%~dp0\find_blender.cmd"
|
call "%~dp0\find_blender.cmd"
|
||||||
|
|
||||||
if EXIST "%BLENDER_BIN%" (
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
@@ -50,14 +50,6 @@ if NOT "%1" == "" (
|
|||||||
goto ERR
|
goto ERR
|
||||||
) else if "%1" == "x64" (
|
) else if "%1" == "x64" (
|
||||||
set BUILD_ARCH=x64
|
set BUILD_ARCH=x64
|
||||||
) else if "%1" == "2017" (
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
) else if "%1" == "2017pre" (
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
set VSWHERE_ARGS=-prerelease
|
|
||||||
) else if "%1" == "2017b" (
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
|
||||||
) else if "%1" == "2019" (
|
) else if "%1" == "2019" (
|
||||||
set BUILD_VS_YEAR=2019
|
set BUILD_VS_YEAR=2019
|
||||||
) else if "%1" == "2019pre" (
|
) else if "%1" == "2019pre" (
|
||||||
|
@@ -24,12 +24,12 @@ echo - nobuildinfo ^(disable buildinfo^)
|
|||||||
echo - debug ^(Build an unoptimized debuggable build^)
|
echo - debug ^(Build an unoptimized debuggable build^)
|
||||||
echo - packagename [newname] ^(override default cpack package name^)
|
echo - packagename [newname] ^(override default cpack package name^)
|
||||||
echo - builddir [newdir] ^(override default build folder^)
|
echo - builddir [newdir] ^(override default build folder^)
|
||||||
echo - 2017 ^(build with visual studio 2017^)
|
|
||||||
echo - 2017pre ^(build with visual studio 2017 pre-release^)
|
|
||||||
echo - 2017b ^(build with visual studio 2017 Build Tools^)
|
|
||||||
echo - 2019 ^(build with visual studio 2019^)
|
echo - 2019 ^(build with visual studio 2019^)
|
||||||
echo - 2019pre ^(build with visual studio 2019 pre-release^)
|
echo - 2019pre ^(build with visual studio 2019 pre-release^)
|
||||||
echo - 2019b ^(build with visual studio 2019 Build Tools^)
|
echo - 2019b ^(build with visual studio 2019 Build Tools^)
|
||||||
|
echo - 2022 ^(build with visual studio 2022^)
|
||||||
|
echo - 2022pre ^(build with visual studio 2022 pre-release^)
|
||||||
|
echo - 2022b ^(build with visual studio 2022 Build Tools^)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Documentation Targets ^(Not associated with building^)
|
echo Documentation Targets ^(Not associated with building^)
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
|
|
||||||
if "%BUILD_VS_YEAR%"=="2019" 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
|
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
|
||||||
|
@@ -1,10 +1,7 @@
|
|||||||
if EXIST %PYTHON% (
|
if NOT EXIST %PYTHON% (
|
||||||
goto detect_python_done
|
echo python not found, required for this operation
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
echo python not found in lib folder
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
:detect_python_done
|
||||||
|
|
||||||
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
|
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
|
||||||
|
@@ -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.1
|
PROJECT_NUMBER = V3.2
|
||||||
|
|
||||||
# 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
|
||||||
|
@@ -6,91 +6,87 @@
|
|||||||
* as part of the normal development process.
|
* as part of the normal development process.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup MEM Guarded memory (de)allocation
|
/* TODO: other modules.
|
||||||
* \ingroup intern
|
* - `libmv`
|
||||||
|
* - `cycles`
|
||||||
|
* - `opencolorio`
|
||||||
|
* - `opensubdiv`
|
||||||
|
* - `openvdb`
|
||||||
|
* - `quadriflow`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup clog C-Logging (CLOG)
|
/** \defgroup intern_atomic Atomic Operations
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup ctr container
|
/** \defgroup intern_clog C-Logging (CLOG)
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup iksolver iksolver
|
/** \defgroup intern_eigen Eigen
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup itasc itasc
|
/** \defgroup intern_glew-mx GLEW with Multiple Rendering Context's
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup memutil memutil
|
/** \defgroup intern_iksolver Inverse Kinematics (Solver)
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup mikktspace mikktspace
|
/** \defgroup intern_itasc Inverse Kinematics (ITASC)
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup moto moto
|
/** \defgroup intern_libc_compat libc Compatibility For Linux
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup eigen eigen
|
/** \defgroup intern_locale Locale
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup smoke smoke
|
/** \defgroup intern_mantaflow Manta-Flow Fluid Simulation
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup string string
|
/** \defgroup intern_mem Guarded Memory (de)allocation
|
||||||
* \ingroup intern
|
* \ingroup intern */
|
||||||
*/
|
|
||||||
|
/** \defgroup intern_memutil Memory Utilities (memutil)
|
||||||
|
* \ingroup intern */
|
||||||
|
|
||||||
|
/** \defgroup intern_mikktspace MikktSpace
|
||||||
|
* \ingroup intern */
|
||||||
|
|
||||||
|
/** \defgroup intern_rigidbody Rigid-Body C-API
|
||||||
|
* \ingroup intern */
|
||||||
|
|
||||||
|
/** \defgroup intern_sky_model Sky Model
|
||||||
|
* \ingroup intern */
|
||||||
|
|
||||||
|
/** \defgroup intern_utf_conv UTF-8/16 Conversion (utfconv)
|
||||||
|
* \ingroup intern */
|
||||||
|
|
||||||
/** \defgroup audaspace Audaspace
|
/** \defgroup audaspace Audaspace
|
||||||
* \ingroup intern undoc
|
* \ingroup intern undoc
|
||||||
* \todo add to doxygen
|
* \todo add to doxygen */
|
||||||
*/
|
|
||||||
/** \defgroup audcoreaudio Audaspace CoreAudio
|
/** \defgroup audcoreaudio Audaspace CoreAudio
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audfx Audaspace FX
|
/** \defgroup audfx Audaspace FX
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audopenal Audaspace OpenAL
|
/** \defgroup audopenal Audaspace OpenAL
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audpulseaudio Audaspace PulseAudio
|
/** \defgroup audpulseaudio Audaspace PulseAudio
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audwasapi Audaspace WASAPI
|
/** \defgroup audwasapi Audaspace WASAPI
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audpython Audaspace Python
|
/** \defgroup audpython Audaspace Python
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audsdl Audaspace SDL
|
/** \defgroup audsdl Audaspace SDL
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audsrc Audaspace SRC
|
/** \defgroup audsrc Audaspace SRC
|
||||||
*
|
* \ingroup audaspace */
|
||||||
* \ingroup audaspace
|
|
||||||
*/
|
|
||||||
/** \defgroup audffmpeg Audaspace FFMpeg
|
/** \defgroup audffmpeg Audaspace FFMpeg
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audfftw Audaspace FFTW
|
/** \defgroup audfftw Audaspace FFTW
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audjack Audaspace Jack
|
/** \defgroup audjack Audaspace Jack
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
/** \defgroup audsndfile Audaspace sndfile
|
/** \defgroup audsndfile Audaspace sndfile
|
||||||
* \ingroup audaspace
|
* \ingroup audaspace */
|
||||||
*/
|
|
||||||
|
|
||||||
/** \defgroup GHOST GHOST API
|
/** \defgroup GHOST GHOST API
|
||||||
* \ingroup intern GUI
|
* \ingroup intern GUI
|
||||||
|
@@ -5,7 +5,8 @@
|
|||||||
/** \defgroup bmesh BMesh
|
/** \defgroup bmesh BMesh
|
||||||
* \ingroup blender
|
* \ingroup blender
|
||||||
*/
|
*/
|
||||||
/** \defgroup compositor Compositing */
|
/** \defgroup compositor Compositing
|
||||||
|
* \ingroup blender */
|
||||||
|
|
||||||
/** \defgroup python Python
|
/** \defgroup python Python
|
||||||
* \ingroup blender
|
* \ingroup blender
|
||||||
@@ -78,7 +79,8 @@
|
|||||||
* \ingroup blender
|
* \ingroup blender
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup data DNA, RNA and .blend access*/
|
/** \defgroup data DNA, RNA and .blend access
|
||||||
|
* \ingroup blender */
|
||||||
|
|
||||||
/** \defgroup gpu GPU
|
/** \defgroup gpu GPU
|
||||||
* \ingroup blender
|
* \ingroup blender
|
||||||
@@ -101,11 +103,12 @@
|
|||||||
* merged in docs.
|
* merged in docs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup gui GUI */
|
/**
|
||||||
|
* \defgroup gui GUI
|
||||||
|
* \ingroup blender */
|
||||||
|
|
||||||
/** \defgroup wm Window Manager
|
/** \defgroup wm Window Manager
|
||||||
* \ingroup blender gui
|
* \ingroup gui */
|
||||||
*/
|
|
||||||
|
|
||||||
/* ================================ */
|
/* ================================ */
|
||||||
|
|
||||||
@@ -279,7 +282,8 @@
|
|||||||
* \ingroup gui
|
* \ingroup gui
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup externformats External Formats */
|
/** \defgroup externformats External Formats
|
||||||
|
* \ingroup blender */
|
||||||
|
|
||||||
/** \defgroup collada COLLADA
|
/** \defgroup collada COLLADA
|
||||||
* \ingroup externformats
|
* \ingroup externformats
|
||||||
@@ -308,4 +312,7 @@
|
|||||||
/* ================================ */
|
/* ================================ */
|
||||||
|
|
||||||
/** \defgroup undoc Undocumented
|
/** \defgroup undoc Undocumented
|
||||||
* \brief Modules and libraries that are still undocumented, or lacking proper integration into the doxygen system, are marked in this group. */
|
*
|
||||||
|
* \brief Modules and libraries that are still undocumented,
|
||||||
|
* or lacking proper integration into the doxygen system, are marked in this group.
|
||||||
|
*/
|
||||||
|
@@ -61,7 +61,7 @@ def blender_extract_info(blender_bin: str) -> Dict[str, str]:
|
|||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.decode(encoding="utf-8")
|
).stdout.decode(encoding="utf-8")
|
||||||
|
|
||||||
blender_version_ouput = subprocess.run(
|
blender_version_output = subprocess.run(
|
||||||
[blender_bin, "--version"],
|
[blender_bin, "--version"],
|
||||||
env=blender_env,
|
env=blender_env,
|
||||||
check=True,
|
check=True,
|
||||||
@@ -73,7 +73,7 @@ def blender_extract_info(blender_bin: str) -> Dict[str, str]:
|
|||||||
# check for each lines prefix to ensure these aren't included.
|
# check for each lines prefix to ensure these aren't included.
|
||||||
blender_version = ""
|
blender_version = ""
|
||||||
blender_date = ""
|
blender_date = ""
|
||||||
for l in blender_version_ouput.split("\n"):
|
for l in blender_version_output.split("\n"):
|
||||||
if l.startswith("Blender "):
|
if l.startswith("Blender "):
|
||||||
# Remove 'Blender' prefix.
|
# Remove 'Blender' prefix.
|
||||||
blender_version = l.split(" ", 1)[1].strip()
|
blender_version = l.split(" ", 1)[1].strip()
|
||||||
|
@@ -8,27 +8,42 @@ def set_pose_matrices(obj, matrix_map):
|
|||||||
"Assign pose space matrices of all bones at once, ignoring constraints."
|
"Assign pose space matrices of all bones at once, ignoring constraints."
|
||||||
|
|
||||||
def rec(pbone, parent_matrix):
|
def rec(pbone, parent_matrix):
|
||||||
matrix = matrix_map[pbone.name]
|
if pbone.name in matrix_map:
|
||||||
|
matrix = matrix_map[pbone.name]
|
||||||
|
|
||||||
## Instead of:
|
## Instead of:
|
||||||
# pbone.matrix = matrix
|
# pbone.matrix = matrix
|
||||||
# bpy.context.view_layer.update()
|
# bpy.context.view_layer.update()
|
||||||
|
|
||||||
# Compute and assign local matrix, using the new parent matrix
|
# Compute and assign local matrix, using the new parent matrix
|
||||||
if pbone.parent:
|
if pbone.parent:
|
||||||
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
|
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
|
||||||
matrix,
|
matrix,
|
||||||
pbone.bone.matrix_local,
|
pbone.bone.matrix_local,
|
||||||
parent_matrix=parent_matrix,
|
parent_matrix=parent_matrix,
|
||||||
parent_matrix_local=pbone.parent.bone.matrix_local,
|
parent_matrix_local=pbone.parent.bone.matrix_local,
|
||||||
invert=True
|
invert=True
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
|
||||||
|
matrix,
|
||||||
|
pbone.bone.matrix_local,
|
||||||
|
invert=True
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
|
# Compute the updated pose matrix from local and new parent matrix
|
||||||
matrix,
|
if pbone.parent:
|
||||||
pbone.bone.matrix_local,
|
matrix = pbone.bone.convert_local_to_pose(
|
||||||
invert=True
|
pbone.matrix_basis,
|
||||||
)
|
pbone.bone.matrix_local,
|
||||||
|
parent_matrix=parent_matrix,
|
||||||
|
parent_matrix_local=pbone.parent.bone.matrix_local,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
matrix = pbone.bone.convert_local_to_pose(
|
||||||
|
pbone.matrix_basis,
|
||||||
|
pbone.bone.matrix_local,
|
||||||
|
)
|
||||||
|
|
||||||
# Recursively process children, passing the new matrix through
|
# Recursively process children, passing the new matrix through
|
||||||
for child in pbone.children:
|
for child in pbone.children:
|
||||||
|
@@ -743,7 +743,7 @@ will re-allocate objects data,
|
|||||||
any references to a meshes vertices/polygons/UVs, armatures bones,
|
any references to a meshes vertices/polygons/UVs, armatures bones,
|
||||||
curves points, etc. cannot be accessed after switching mode.
|
curves points, etc. cannot be accessed after switching mode.
|
||||||
|
|
||||||
Only the reference to the data its self can be re-accessed, the following example will crash.
|
Only the reference to the data itself can be re-accessed, the following example will crash.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@@ -1103,6 +1103,7 @@ context_type_map = {
|
|||||||
"selectable_objects": ("Object", True),
|
"selectable_objects": ("Object", True),
|
||||||
"selected_asset_files": ("FileSelectEntry", True),
|
"selected_asset_files": ("FileSelectEntry", True),
|
||||||
"selected_bones": ("EditBone", True),
|
"selected_bones": ("EditBone", True),
|
||||||
|
"selected_editable_actions": ("Action", 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),
|
||||||
@@ -1118,12 +1119,13 @@ context_type_map = {
|
|||||||
"selected_pose_bones": ("PoseBone", True),
|
"selected_pose_bones": ("PoseBone", True),
|
||||||
"selected_pose_bones_from_active_object": ("PoseBone", True),
|
"selected_pose_bones_from_active_object": ("PoseBone", True),
|
||||||
"selected_sequences": ("Sequence", True),
|
"selected_sequences": ("Sequence", True),
|
||||||
|
"selected_visible_actions": ("Action", True),
|
||||||
"selected_visible_fcurves": ("FCurve", True),
|
"selected_visible_fcurves": ("FCurve", True),
|
||||||
"sequences": ("Sequence", True),
|
"sequences": ("Sequence", True),
|
||||||
"soft_body": ("SoftBodyModifier", False),
|
"soft_body": ("SoftBodyModifier", False),
|
||||||
"speaker": ("Speaker", False),
|
"speaker": ("Speaker", False),
|
||||||
"texture": ("Texture", False),
|
"texture": ("Texture", False),
|
||||||
"texture_slot": ("MaterialTextureSlot", False),
|
"texture_slot": ("TextureSlot", False),
|
||||||
"texture_user": ("ID", False),
|
"texture_user": ("ID", False),
|
||||||
"texture_user_property": ("Property", False),
|
"texture_user_property": ("Property", False),
|
||||||
"ui_list": ("UIList", False),
|
"ui_list": ("UIList", False),
|
||||||
@@ -1760,6 +1762,7 @@ except ModuleNotFoundError:
|
|||||||
fw("html_show_sphinx = False\n")
|
fw("html_show_sphinx = False\n")
|
||||||
fw("html_baseurl = 'https://docs.blender.org/api/current/'\n")
|
fw("html_baseurl = 'https://docs.blender.org/api/current/'\n")
|
||||||
fw("html_use_opensearch = 'https://docs.blender.org/api/current'\n")
|
fw("html_use_opensearch = 'https://docs.blender.org/api/current'\n")
|
||||||
|
fw("html_show_search_summary = True\n")
|
||||||
fw("html_split_index = True\n")
|
fw("html_split_index = True\n")
|
||||||
fw("html_static_path = ['static']\n")
|
fw("html_static_path = ['static']\n")
|
||||||
fw("html_extra_path = ['static/favicon.ico', 'static/blender_logo.svg']\n")
|
fw("html_extra_path = ['static/favicon.ico', 'static/blender_logo.svg']\n")
|
||||||
|
2
extern/CMakeLists.txt
vendored
2
extern/CMakeLists.txt
vendored
@@ -113,6 +113,6 @@ if(WITH_MOD_FLUID)
|
|||||||
add_subdirectory(mantaflow)
|
add_subdirectory(mantaflow)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_COMPOSITOR)
|
if(WITH_COMPOSITOR)
|
||||||
add_subdirectory(smaa_areatex)
|
add_subdirectory(smaa_areatex)
|
||||||
endif()
|
endif()
|
||||||
|
6
extern/audaspace/CMakeLists.txt
vendored
6
extern/audaspace/CMakeLists.txt
vendored
@@ -1092,12 +1092,12 @@ if(WITH_PYTHON)
|
|||||||
configure_file(${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py ESCAPE_QUOTES @ONLY)
|
configure_file(${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py ESCAPE_QUOTES @ONLY)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
add_custom_command(OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
|
add_custom_command(OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(ENV{VS100COMNTOOLS} $ENV{VS120COMNTOOLS})
|
set(ENV{VS100COMNTOOLS} $ENV{VS120COMNTOOLS})
|
||||||
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
|
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
|
||||||
else()
|
else()
|
||||||
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
|
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
|
||||||
endif()
|
endif()
|
||||||
add_custom_target(pythonmodule ALL DEPENDS build SOURCES ${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${PYTHON_SRC} ${PYTHON_HDR})
|
add_custom_target(pythonmodule ALL DEPENDS build SOURCES ${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${PYTHON_SRC} ${PYTHON_HDR})
|
||||||
add_dependencies(pythonmodule audaspace)
|
add_dependencies(pythonmodule audaspace)
|
||||||
|
27
extern/audaspace/bindings/python/setup.py.in
vendored
27
extern/audaspace/bindings/python/setup.py.in
vendored
@@ -8,20 +8,20 @@ import numpy
|
|||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
|
|
||||||
if len(sys.argv) > 2 and sys.argv[1] == '--build-docs':
|
if len(sys.argv) > 2 and sys.argv[1] == '--build-docs':
|
||||||
import subprocess
|
import subprocess
|
||||||
from distutils.core import Distribution
|
from distutils.core import Distribution
|
||||||
from distutils.command.build import build
|
from distutils.command.build import build
|
||||||
|
|
||||||
dist = Distribution()
|
dist = Distribution()
|
||||||
cmd = build(dist)
|
cmd = build(dist)
|
||||||
cmd.finalize_options()
|
cmd.finalize_options()
|
||||||
#print(cmd.build_platlib)
|
#print(cmd.build_platlib)
|
||||||
|
|
||||||
os.environ['PYTHONPATH'] = os.path.join(os.getcwd(), cmd.build_platlib)
|
os.environ['PYTHONPATH'] = os.path.join(os.getcwd(), cmd.build_platlib)
|
||||||
os.environ['LD_LIBRARY_PATH'] = os.getcwd()
|
os.environ['LD_LIBRARY_PATH'] = os.getcwd()
|
||||||
|
|
||||||
ret = subprocess.call(sys.argv[2:])
|
ret = subprocess.call(sys.argv[2:])
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
|
|
||||||
|
|
||||||
# the following line is not working due to https://bugs.python.org/issue9023
|
# the following line is not working due to https://bugs.python.org/issue9023
|
||||||
@@ -43,7 +43,8 @@ audaspace = Extension(
|
|||||||
library_dirs = ['.', 'Release', 'Debug'],
|
library_dirs = ['.', 'Release', 'Debug'],
|
||||||
language = 'c++',
|
language = 'c++',
|
||||||
extra_compile_args = extra_args,
|
extra_compile_args = extra_args,
|
||||||
sources = [os.path.join(source_directory, file) for file in ['PyAPI.cpp', 'PyDevice.cpp', 'PyHandle.cpp', 'PySound.cpp', 'PySequenceEntry.cpp', 'PySequence.cpp', 'PyPlaybackManager.cpp', 'PyDynamicMusic.cpp', 'PyThreadPool.cpp', 'PySource.cpp'] + (['PyImpulseResponse.cpp', 'PyHRTF.cpp'] if '@WITH_FFTW@' == 'ON' else [])]
|
define_macros = [('WITH_CONVOLUTION', None)] if '@WITH_FFTW@' == 'ON' else [],
|
||||||
|
sources = [os.path.join(source_directory, file) for file in ['PyAPI.cpp', 'PyDevice.cpp', 'PyHandle.cpp', 'PySound.cpp', 'PySequenceEntry.cpp', 'PySequence.cpp', 'PyPlaybackManager.cpp', 'PyDynamicMusic.cpp', 'PyThreadPool.cpp', 'PySource.cpp'] + (['PyImpulseResponse.cpp', 'PyHRTF.cpp'] if '@WITH_FFTW@' == 'ON' else [])]
|
||||||
)
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@@ -56,6 +57,6 @@ setup(
|
|||||||
license = 'Apache License 2.0',
|
license = 'Apache License 2.0',
|
||||||
long_description = codecs.open(os.path.join(source_directory, '../../README.md'), 'r', 'utf-8').read(),
|
long_description = codecs.open(os.path.join(source_directory, '../../README.md'), 'r', 'utf-8').read(),
|
||||||
ext_modules = [audaspace],
|
ext_modules = [audaspace],
|
||||||
headers = [os.path.join(source_directory, file) for file in ['PyAPI.h', 'PyDevice.h', 'PyHandle.h', 'PySound.h', 'PySequenceEntry.h', 'PySequence.h', 'PyPlaybackManager.h', 'PyDynamicMusic.h', 'PyThreadPool.h', 'PySource.h'] + (['PyImpulseResponse.h', 'PyHRTF.h'] if '@WITH_FFTW@' == 'ON' else [])] + ['Audaspace.h']
|
headers = [os.path.join(source_directory, file) for file in ['PyAPI.h', 'PyDevice.h', 'PyHandle.h', 'PySound.h', 'PySequenceEntry.h', 'PySequence.h', 'PyPlaybackManager.h', 'PyDynamicMusic.h', 'PyThreadPool.h', 'PySource.h'] + (['PyImpulseResponse.h', 'PyHRTF.h'] if '@WITH_FFTW@' == 'ON' else [])] + ['Audaspace.h']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
80
extern/audaspace/plugins/wasapi/WASAPIDevice.cpp
vendored
80
extern/audaspace/plugins/wasapi/WASAPIDevice.cpp
vendored
@@ -95,6 +95,13 @@ void WASAPIDevice::runMixingThread()
|
|||||||
sleep_duration = std::chrono::milliseconds(buffer_size * 1000 / int(m_specs.rate) / 2);
|
sleep_duration = std::chrono::milliseconds(buffer_size * 1000 / int(m_specs.rate) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(m_default_device_changed)
|
||||||
|
{
|
||||||
|
m_default_device_changed = false;
|
||||||
|
result = AUDCLNT_E_DEVICE_INVALIDATED;
|
||||||
|
goto stop_thread;
|
||||||
|
}
|
||||||
|
|
||||||
if(FAILED(result = m_audio_client->GetCurrentPadding(&padding)))
|
if(FAILED(result = m_audio_client->GetCurrentPadding(&padding)))
|
||||||
goto stop_thread;
|
goto stop_thread;
|
||||||
|
|
||||||
@@ -296,13 +303,78 @@ bool WASAPIDevice::setupDevice(DeviceSpecs &specs)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONG WASAPIDevice::AddRef()
|
||||||
|
{
|
||||||
|
return InterlockedIncrement(&m_reference_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WASAPIDevice::Release()
|
||||||
|
{
|
||||||
|
ULONG reference_count = InterlockedDecrement(&m_reference_count);
|
||||||
|
|
||||||
|
if(0 == reference_count)
|
||||||
|
delete this;
|
||||||
|
|
||||||
|
return reference_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WASAPIDevice::QueryInterface(REFIID riid, void **ppvObject)
|
||||||
|
{
|
||||||
|
if(riid == __uuidof(IMMNotificationClient))
|
||||||
|
{
|
||||||
|
*ppvObject = reinterpret_cast<IMMNotificationClient*>(this);
|
||||||
|
AddRef();
|
||||||
|
}
|
||||||
|
else if(riid == IID_IUnknown)
|
||||||
|
{
|
||||||
|
*ppvObject = reinterpret_cast<IUnknown*>(this);
|
||||||
|
AddRef();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ppvObject = nullptr;
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WASAPIDevice::OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState)
|
||||||
|
{
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WASAPIDevice::OnDeviceAdded(LPCWSTR pwstrDeviceId)
|
||||||
|
{
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WASAPIDevice::OnDeviceRemoved(LPCWSTR pwstrDeviceId)
|
||||||
|
{
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WASAPIDevice::OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId)
|
||||||
|
{
|
||||||
|
if(flow != EDataFlow::eCapture)
|
||||||
|
m_default_device_changed = true;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WASAPIDevice::OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key)
|
||||||
|
{
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
|
WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
|
||||||
m_buffersize(buffersize),
|
m_buffersize(buffersize),
|
||||||
m_imm_device_enumerator(nullptr),
|
m_imm_device_enumerator(nullptr),
|
||||||
m_imm_device(nullptr),
|
m_imm_device(nullptr),
|
||||||
m_audio_client(nullptr),
|
m_audio_client(nullptr),
|
||||||
|
m_wave_format_extensible({}),
|
||||||
m_wave_format_extensible({})
|
m_default_device_changed(false),
|
||||||
|
m_reference_count(1)
|
||||||
{
|
{
|
||||||
// initialize COM if it hasn't happened yet
|
// initialize COM if it hasn't happened yet
|
||||||
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||||
@@ -327,6 +399,8 @@ WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
|
|||||||
|
|
||||||
create();
|
create();
|
||||||
|
|
||||||
|
m_imm_device_enumerator->RegisterEndpointNotificationCallback(this);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -340,6 +414,8 @@ WASAPIDevice::~WASAPIDevice()
|
|||||||
{
|
{
|
||||||
stopMixingThread();
|
stopMixingThread();
|
||||||
|
|
||||||
|
m_imm_device_enumerator->UnregisterEndpointNotificationCallback(this);
|
||||||
|
|
||||||
SafeRelease(&m_audio_client);
|
SafeRelease(&m_audio_client);
|
||||||
SafeRelease(&m_imm_device);
|
SafeRelease(&m_imm_device);
|
||||||
SafeRelease(&m_imm_device_enumerator);
|
SafeRelease(&m_imm_device_enumerator);
|
||||||
|
15
extern/audaspace/plugins/wasapi/WASAPIDevice.h
vendored
15
extern/audaspace/plugins/wasapi/WASAPIDevice.h
vendored
@@ -40,7 +40,7 @@ AUD_NAMESPACE_BEGIN
|
|||||||
/**
|
/**
|
||||||
* This device plays back through WASAPI, the Windows audio API.
|
* This device plays back through WASAPI, the Windows audio API.
|
||||||
*/
|
*/
|
||||||
class AUD_PLUGIN_API WASAPIDevice : public ThreadedDevice
|
class AUD_PLUGIN_API WASAPIDevice : IMMNotificationClient, public ThreadedDevice
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int m_buffersize;
|
int m_buffersize;
|
||||||
@@ -48,6 +48,8 @@ private:
|
|||||||
IMMDevice* m_imm_device;
|
IMMDevice* m_imm_device;
|
||||||
IAudioClient* m_audio_client;
|
IAudioClient* m_audio_client;
|
||||||
WAVEFORMATEXTENSIBLE m_wave_format_extensible;
|
WAVEFORMATEXTENSIBLE m_wave_format_extensible;
|
||||||
|
bool m_default_device_changed;
|
||||||
|
LONG m_reference_count;
|
||||||
|
|
||||||
AUD_LOCAL HRESULT setupRenderClient(IAudioRenderClient*& render_client, UINT32& buffer_size);
|
AUD_LOCAL HRESULT setupRenderClient(IAudioRenderClient*& render_client, UINT32& buffer_size);
|
||||||
|
|
||||||
@@ -58,6 +60,17 @@ private:
|
|||||||
|
|
||||||
AUD_LOCAL bool setupDevice(DeviceSpecs& specs);
|
AUD_LOCAL bool setupDevice(DeviceSpecs& specs);
|
||||||
|
|
||||||
|
// IUnknown implementation
|
||||||
|
ULONG STDMETHODCALLTYPE AddRef();
|
||||||
|
ULONG STDMETHODCALLTYPE Release();
|
||||||
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
|
||||||
|
// IMMNotificationClient implementation
|
||||||
|
HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState);
|
||||||
|
HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId);
|
||||||
|
HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId);
|
||||||
|
HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId);
|
||||||
|
HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key);
|
||||||
|
|
||||||
// delete copy constructor and operator=
|
// delete copy constructor and operator=
|
||||||
WASAPIDevice(const WASAPIDevice&) = delete;
|
WASAPIDevice(const WASAPIDevice&) = delete;
|
||||||
WASAPIDevice& operator=(const WASAPIDevice&) = delete;
|
WASAPIDevice& operator=(const WASAPIDevice&) = delete;
|
||||||
|
12
extern/hipew/README
vendored
Normal file
12
extern/hipew/README
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
The HIP Extension Wrangler Library (HIPEW) is a cross-platform open-source
|
||||||
|
C/C++ library to dynamically load the HIP library.
|
||||||
|
|
||||||
|
HIP (Heterogeneous-Compute Interface for Portability) is an API for C++
|
||||||
|
programming on AMD GPUs.
|
||||||
|
|
||||||
|
It is maintained as part of the Blender project, but included in extern/
|
||||||
|
for consistency with CUEW and CLEW libraries.
|
||||||
|
|
||||||
|
LICENSE
|
||||||
|
|
||||||
|
HIPEW is released under the Apache 2.0 license.
|
5
extern/hipew/README.blender
vendored
Normal file
5
extern/hipew/README.blender
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Project: Blender
|
||||||
|
URL: https://git.blender.org/blender.git
|
||||||
|
License: Apache 2.0
|
||||||
|
Upstream version: N/A
|
||||||
|
Local modifications: None
|
14
extern/hipew/src/hipew.c
vendored
14
extern/hipew/src/hipew.c
vendored
@@ -219,17 +219,17 @@ static int hipewHasOldDriver(const char *hip_path) {
|
|||||||
DWORD verHandle = 0;
|
DWORD verHandle = 0;
|
||||||
DWORD verSize = GetFileVersionInfoSize(hip_path, &verHandle);
|
DWORD verSize = GetFileVersionInfoSize(hip_path, &verHandle);
|
||||||
int old_driver = 0;
|
int old_driver = 0;
|
||||||
if(verSize != 0) {
|
if (verSize != 0) {
|
||||||
LPSTR verData = (LPSTR)malloc(verSize);
|
LPSTR verData = (LPSTR)malloc(verSize);
|
||||||
if(GetFileVersionInfo(hip_path, verHandle, verSize, verData)) {
|
if (GetFileVersionInfo(hip_path, verHandle, verSize, verData)) {
|
||||||
LPBYTE lpBuffer = NULL;
|
LPBYTE lpBuffer = NULL;
|
||||||
UINT size = 0;
|
UINT size = 0;
|
||||||
if(VerQueryValue(verData, "\\", (VOID FAR * FAR *)&lpBuffer, &size)) {
|
if (VerQueryValue(verData, "\\", (VOID FAR * FAR *)&lpBuffer, &size)) {
|
||||||
if(size) {
|
if (size) {
|
||||||
VS_FIXEDFILEINFO *verInfo = (VS_FIXEDFILEINFO *)lpBuffer;
|
VS_FIXEDFILEINFO *verInfo = (VS_FIXEDFILEINFO *)lpBuffer;
|
||||||
/* Magic value from
|
/* Magic value from
|
||||||
* https://docs.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo */
|
* https://docs.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo */
|
||||||
if(verInfo->dwSignature == 0xfeef04bd) {
|
if (verInfo->dwSignature == 0xfeef04bd) {
|
||||||
unsigned int fileVersionLS0 = (verInfo->dwFileVersionLS >> 16) & 0xffff;
|
unsigned int fileVersionLS0 = (verInfo->dwFileVersionLS >> 16) & 0xffff;
|
||||||
unsigned int fileversionLS1 = (verInfo->dwFileVersionLS >> 0) & 0xffff;
|
unsigned int fileversionLS1 = (verInfo->dwFileVersionLS >> 0) & 0xffff;
|
||||||
/* Corresponds to versions older than AMD Radeon Pro 21.Q4. */
|
/* Corresponds to versions older than AMD Radeon Pro 21.Q4. */
|
||||||
@@ -257,7 +257,7 @@ static int hipewHipInit(void) {
|
|||||||
#endif
|
#endif
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
static int result = 0;
|
static int result = 0;
|
||||||
int error, driver_version;
|
int error;
|
||||||
|
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
return result;
|
return result;
|
||||||
@@ -565,8 +565,6 @@ int hipewCompilerVersion(void) {
|
|||||||
const char *path = hipewCompilerPath();
|
const char *path = hipewCompilerPath();
|
||||||
const char *marker = "Hip compilation tools, release ";
|
const char *marker = "Hip compilation tools, release ";
|
||||||
FILE *pipe;
|
FILE *pipe;
|
||||||
int major, minor;
|
|
||||||
char *versionstr;
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char output[65536] = "\0";
|
char output[65536] = "\0";
|
||||||
char command[65536] = "\0";
|
char command[65536] = "\0";
|
||||||
|
2
extern/nanosvg/README.blender
vendored
2
extern/nanosvg/README.blender
vendored
@@ -1,7 +1,7 @@
|
|||||||
Project: NanoSVG
|
Project: NanoSVG
|
||||||
URL: https://github.com/memononen/nanosvg
|
URL: https://github.com/memononen/nanosvg
|
||||||
License: zlib
|
License: zlib
|
||||||
Upstream version:
|
Upstream version: 3cdd4a9d7886
|
||||||
Local modifications: Added some functionality to manage grease pencil layers
|
Local modifications: Added some functionality to manage grease pencil layers
|
||||||
|
|
||||||
Added a fix to SVG import arc and float errors (https://developer.blender.org/rB11dc674c78b49fc4e0b7c134c375b6c8b8eacbcc)
|
Added a fix to SVG import arc and float errors (https://developer.blender.org/rB11dc674c78b49fc4e0b7c134c375b6c8b8eacbcc)
|
||||||
|
@@ -25,7 +25,6 @@ add_subdirectory(ghost)
|
|||||||
add_subdirectory(guardedalloc)
|
add_subdirectory(guardedalloc)
|
||||||
add_subdirectory(libmv)
|
add_subdirectory(libmv)
|
||||||
add_subdirectory(memutil)
|
add_subdirectory(memutil)
|
||||||
add_subdirectory(numaapi)
|
|
||||||
add_subdirectory(opencolorio)
|
add_subdirectory(opencolorio)
|
||||||
add_subdirectory(opensubdiv)
|
add_subdirectory(opensubdiv)
|
||||||
add_subdirectory(mikktspace)
|
add_subdirectory(mikktspace)
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file
|
/** \file
|
||||||
* \ingroup Atomic
|
* \ingroup intern_atomic
|
||||||
*
|
*
|
||||||
* \brief Provides wrapper around system-specific atomic primitives,
|
* \brief Provides wrapper around system-specific atomic primitives,
|
||||||
* and some extensions (faked-atomic operations over float numbers).
|
* and some extensions (faked-atomic operations over float numbers).
|
||||||
|
@@ -44,6 +44,10 @@
|
|||||||
* The Original Code is: adapted from jemalloc.
|
* The Original Code is: adapted from jemalloc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \file
|
||||||
|
* \ingroup intern_atomic
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __ATOMIC_OPS_EXT_H__
|
#ifndef __ATOMIC_OPS_EXT_H__
|
||||||
#define __ATOMIC_OPS_EXT_H__
|
#define __ATOMIC_OPS_EXT_H__
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved.
|
* Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved.
|
||||||
* Copyright (C) 2009-2013 Facebook, Inc. All rights reserved.
|
* Copyright (C) 2009-2013 Facebook, Inc. All rights reserved.
|
||||||
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright notice(s),
|
* 1. Redistributions of source code must retain the above copyright notice(s),
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright notice(s),
|
* 2. Redistributions in binary form must reproduce the above copyright notice(s),
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
|
||||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
@@ -26,6 +26,10 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \file
|
||||||
|
* \ingroup intern_atomic
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __ATOMIC_OPS_MSVC_H__
|
#ifndef __ATOMIC_OPS_MSVC_H__
|
||||||
#define __ATOMIC_OPS_MSVC_H__
|
#define __ATOMIC_OPS_MSVC_H__
|
||||||
|
|
||||||
|
@@ -44,6 +44,10 @@
|
|||||||
* The Original Code is: adapted from jemalloc.
|
* The Original Code is: adapted from jemalloc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \file
|
||||||
|
* \ingroup intern_atomic
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __ATOMIC_OPS_UNIX_H__
|
#ifndef __ATOMIC_OPS_UNIX_H__
|
||||||
#define __ATOMIC_OPS_UNIX_H__
|
#define __ATOMIC_OPS_UNIX_H__
|
||||||
|
|
||||||
|
@@ -44,6 +44,10 @@
|
|||||||
* The Original Code is: adapted from jemalloc.
|
* The Original Code is: adapted from jemalloc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \file
|
||||||
|
* \ingroup intern_atomic
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __ATOMIC_OPS_UTILS_H__
|
#ifndef __ATOMIC_OPS_UTILS_H__
|
||||||
#define __ATOMIC_OPS_UTILS_H__
|
#define __ATOMIC_OPS_UTILS_H__
|
||||||
|
|
||||||
|
@@ -14,11 +14,8 @@
|
|||||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CLG_LOG_H__
|
|
||||||
#define __CLG_LOG_H__
|
|
||||||
|
|
||||||
/** \file
|
/** \file
|
||||||
* \ingroup clog
|
* \ingroup intern_clog
|
||||||
*
|
*
|
||||||
* C Logging Library (clog)
|
* C Logging Library (clog)
|
||||||
* ========================
|
* ========================
|
||||||
@@ -68,6 +65,9 @@
|
|||||||
* - 4+: May be used for more details than 3, should be avoided but not prevented.
|
* - 4+: May be used for more details than 3, should be avoided but not prevented.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __CLG_LOG_H__
|
||||||
|
#define __CLG_LOG_H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file
|
/** \file
|
||||||
* \ingroup clog
|
* \ingroup intern_clog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -388,7 +388,7 @@ static void clg_ctx_fatal_action(CLogContext *ctx)
|
|||||||
|
|
||||||
static void clg_ctx_backtrace(CLogContext *ctx)
|
static void clg_ctx_backtrace(CLogContext *ctx)
|
||||||
{
|
{
|
||||||
/* Note: we avoid writing to 'FILE', for back-trace we make an exception,
|
/* NOTE: we avoid writing to 'FILE', for back-trace we make an exception,
|
||||||
* if necessary we could have a version of the callback that writes to file
|
* if necessary we could have a version of the callback that writes to file
|
||||||
* descriptor all at once. */
|
* descriptor all at once. */
|
||||||
ctx->callbacks.backtrace_fn(ctx->output_file);
|
ctx->callbacks.backtrace_fn(ctx->output_file);
|
||||||
|
@@ -51,8 +51,6 @@ list(APPEND LIBRARIES ${CYCLES_GL_LIBRARIES})
|
|||||||
|
|
||||||
# Common configuration.
|
# Common configuration.
|
||||||
|
|
||||||
cycles_link_directories()
|
|
||||||
|
|
||||||
add_definitions(${GL_DEFINITIONS})
|
add_definitions(${GL_DEFINITIONS})
|
||||||
|
|
||||||
include_directories(${INC})
|
include_directories(${INC})
|
||||||
|
@@ -82,7 +82,7 @@ static void session_print_status()
|
|||||||
string status, substatus;
|
string status, substatus;
|
||||||
|
|
||||||
/* get status */
|
/* get status */
|
||||||
float progress = options.session->progress.get_progress();
|
double progress = options.session->progress.get_progress();
|
||||||
options.session->progress.get_status(status, substatus);
|
options.session->progress.get_status(status, substatus);
|
||||||
|
|
||||||
if (substatus != "")
|
if (substatus != "")
|
||||||
@@ -183,7 +183,7 @@ static void display_info(Progress &progress)
|
|||||||
|
|
||||||
progress.get_time(total_time, sample_time);
|
progress.get_time(total_time, sample_time);
|
||||||
progress.get_status(status, substatus);
|
progress.get_status(status, substatus);
|
||||||
float progress_val = progress.get_progress();
|
double progress_val = progress.get_progress();
|
||||||
|
|
||||||
if (substatus != "")
|
if (substatus != "")
|
||||||
status += ": " + substatus;
|
status += ": " + substatus;
|
||||||
|
@@ -40,6 +40,7 @@ set(SRC
|
|||||||
object_cull.cpp
|
object_cull.cpp
|
||||||
output_driver.cpp
|
output_driver.cpp
|
||||||
particles.cpp
|
particles.cpp
|
||||||
|
pointcloud.cpp
|
||||||
curves.cpp
|
curves.cpp
|
||||||
logging.cpp
|
logging.cpp
|
||||||
python.cpp
|
python.cpp
|
||||||
@@ -87,6 +88,7 @@ endif()
|
|||||||
|
|
||||||
set(ADDON_FILES
|
set(ADDON_FILES
|
||||||
addon/__init__.py
|
addon/__init__.py
|
||||||
|
addon/camera.py
|
||||||
addon/engine.py
|
addon/engine.py
|
||||||
addon/operators.py
|
addon/operators.py
|
||||||
addon/osl.py
|
addon/osl.py
|
||||||
@@ -101,6 +103,11 @@ add_definitions(${GL_DEFINITIONS})
|
|||||||
if(WITH_CYCLES_DEVICE_HIP)
|
if(WITH_CYCLES_DEVICE_HIP)
|
||||||
add_definitions(-DWITH_HIP)
|
add_definitions(-DWITH_HIP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_CYCLES_DEVICE_METAL)
|
||||||
|
add_definitions(-DWITH_METAL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_MOD_FLUID)
|
if(WITH_MOD_FLUID)
|
||||||
add_definitions(-DWITH_FLUID)
|
add_definitions(-DWITH_FLUID)
|
||||||
endif()
|
endif()
|
||||||
|
84
intern/cycles/blender/addon/camera.py
Normal file
84
intern/cycles/blender/addon/camera.py
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
# <pep8 compliant>
|
||||||
|
|
||||||
|
# Fit to match default projective camera with focal_length 50 and sensor_width 36.
|
||||||
|
default_fisheye_polynomial = [-1.1735143712967577e-05,
|
||||||
|
-0.019988736953434998,
|
||||||
|
-3.3525322965709175e-06,
|
||||||
|
3.099275275886036e-06,
|
||||||
|
-2.6064646454854524e-08]
|
||||||
|
|
||||||
|
# Utilities to generate lens polynomials to match built-in camera types, only here
|
||||||
|
# for reference at the moment, not used by the code.
|
||||||
|
def create_grid(sensor_height, sensor_width):
|
||||||
|
import numpy as np
|
||||||
|
if sensor_height is None:
|
||||||
|
sensor_height = sensor_width / (16 / 9) # Default aspect ration 16:9
|
||||||
|
uu, vv = np.meshgrid(np.linspace(0, 1, 100), np.linspace(0, 1, 100))
|
||||||
|
uu = (uu - 0.5) * sensor_width
|
||||||
|
vv = (vv - 0.5) * sensor_height
|
||||||
|
rr = np.sqrt(uu ** 2 + vv ** 2)
|
||||||
|
return rr
|
||||||
|
|
||||||
|
|
||||||
|
def fisheye_lens_polynomial_from_projective(focal_length=50, sensor_width=36, sensor_height=None):
|
||||||
|
import numpy as np
|
||||||
|
rr = create_grid(sensor_height, sensor_width)
|
||||||
|
polynomial = np.polyfit(rr.flat, (-np.arctan(rr / focal_length)).flat, 4)
|
||||||
|
return list(reversed(polynomial))
|
||||||
|
|
||||||
|
|
||||||
|
def fisheye_lens_polynomial_from_projective_fov(fov, sensor_width=36, sensor_height=None):
|
||||||
|
import numpy as np
|
||||||
|
f = sensor_width / 2 / np.tan(fov / 2)
|
||||||
|
return fisheye_lens_polynomial_from_projective(f, sensor_width, sensor_height)
|
||||||
|
|
||||||
|
|
||||||
|
def fisheye_lens_polynomial_from_equisolid(lens=10.5, sensor_width=36, sensor_height=None):
|
||||||
|
import numpy as np
|
||||||
|
rr = create_grid(sensor_height, sensor_width)
|
||||||
|
x = rr.reshape(-1)
|
||||||
|
x = np.stack([x**i for i in [1, 2, 3, 4]])
|
||||||
|
y = (-2 * np.arcsin(rr / (2 * lens))).reshape(-1)
|
||||||
|
polynomial = np.linalg.lstsq(x.T, y.T, rcond=None)[0]
|
||||||
|
return [0] + list(polynomial)
|
||||||
|
|
||||||
|
|
||||||
|
def fisheye_lens_polynomial_from_equidistant(fov=180, sensor_width=36, sensor_height=None):
|
||||||
|
import numpy as np
|
||||||
|
return [0, -np.radians(fov) / sensor_width, 0, 0, 0]
|
||||||
|
|
||||||
|
|
||||||
|
def fisheye_lens_polynomial_from_distorted_projective_polynomial(k1, k2, k3, focal_length=50, sensor_width=36, sensor_height=None):
|
||||||
|
import numpy as np
|
||||||
|
rr = create_grid(sensor_height, sensor_width)
|
||||||
|
r2 = (rr / focal_length) ** 2
|
||||||
|
r4 = r2 * r2
|
||||||
|
r6 = r4 * r2
|
||||||
|
r_coeff = 1 + k1 * r2 + k2 * r4 + k3 * r6
|
||||||
|
polynomial = np.polyfit(rr.flat, (-np.arctan(rr / focal_length * r_coeff)).flat, 4)
|
||||||
|
return list(reversed(polynomial))
|
||||||
|
|
||||||
|
def fisheye_lens_polynomial_from_distorted_projective_divisions(k1, k2, focal_length=50, sensor_width=36, sensor_height=None):
|
||||||
|
import numpy as np
|
||||||
|
rr = create_grid(sensor_height, sensor_width)
|
||||||
|
r2 = (rr / focal_length) ** 2
|
||||||
|
r4 = r2 * r2
|
||||||
|
r_coeff = 1 + k1 * r2 + k2 * r4
|
||||||
|
polynomial = np.polyfit(rr.flat, (-np.arctan(rr / focal_length / r_coeff)).flat, 4)
|
||||||
|
return list(reversed(polynomial))
|
@@ -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', 'OPTIX', or 'HIP'"
|
"Valid options are 'CPU', 'CUDA', 'OPTIX', 'HIP' or 'METAL'."
|
||||||
"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
|
||||||
@@ -60,9 +60,8 @@ def init():
|
|||||||
|
|
||||||
path = os.path.dirname(__file__)
|
path = os.path.dirname(__file__)
|
||||||
user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', path='')))
|
user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', path='')))
|
||||||
temp_path = bpy.app.tempdir
|
|
||||||
|
|
||||||
_cycles.init(path, user_path, temp_path, bpy.app.background)
|
_cycles.init(path, user_path, bpy.app.background)
|
||||||
_parse_command_line()
|
_parse_command_line()
|
||||||
|
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ from math import pi
|
|||||||
# enums
|
# enums
|
||||||
|
|
||||||
from . import engine
|
from . import engine
|
||||||
|
from . import camera
|
||||||
|
|
||||||
enum_devices = (
|
enum_devices = (
|
||||||
('CPU', "CPU", "Use CPU for rendering"),
|
('CPU', "CPU", "Use CPU for rendering"),
|
||||||
@@ -72,6 +73,8 @@ enum_panorama_types = (
|
|||||||
('FISHEYE_EQUISOLID', "Fisheye Equisolid",
|
('FISHEYE_EQUISOLID', "Fisheye Equisolid",
|
||||||
"Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
|
"Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
|
||||||
('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"),
|
('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"),
|
||||||
|
('FISHEYE_LENS_POLYNOMIAL', "Fisheye Lens Polynomial",
|
||||||
|
"Defines the lens projection as polynomial to allow real world camera lenses to be mimicked."),
|
||||||
)
|
)
|
||||||
|
|
||||||
enum_curve_shape = (
|
enum_curve_shape = (
|
||||||
@@ -111,7 +114,8 @@ 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)
|
('HIP', "HIP", "HIP", 4),
|
||||||
|
('METAL', "Metal", "Metal", 5)
|
||||||
)
|
)
|
||||||
|
|
||||||
enum_texture_limit = (
|
enum_texture_limit = (
|
||||||
@@ -429,7 +433,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
)
|
)
|
||||||
|
|
||||||
direct_light_sampling_type: EnumProperty(
|
direct_light_sampling_type: EnumProperty(
|
||||||
name="Direct Light Sampling Type",
|
name="Direct Light Sampling",
|
||||||
description="The type of strategy used for sampling direct light contributions",
|
description="The type of strategy used for sampling direct light contributions",
|
||||||
items=enum_direct_light_sampling_type,
|
items=enum_direct_light_sampling_type,
|
||||||
default='MULTIPLE_IMPORTANCE_SAMPLING',
|
default='MULTIPLE_IMPORTANCE_SAMPLING',
|
||||||
@@ -663,6 +667,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
description="Use special type BVH optimized for hair (uses more ram but renders faster)",
|
description="Use special type BVH optimized for hair (uses more ram but renders faster)",
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
|
debug_use_compact_bvh: BoolProperty(
|
||||||
|
name="Use Compact BVH",
|
||||||
|
description="Use compact BVH structure (uses less ram but renders slower)",
|
||||||
|
default=True,
|
||||||
|
)
|
||||||
debug_bvh_time_steps: IntProperty(
|
debug_bvh_time_steps: IntProperty(
|
||||||
name="BVH Time Steps",
|
name="BVH Time Steps",
|
||||||
description="Split BVH primitives by this number of time steps to speed up render time in cost of memory",
|
description="Split BVH primitives by this number of time steps to speed up render time in cost of memory",
|
||||||
@@ -790,7 +799,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
)
|
)
|
||||||
|
|
||||||
use_auto_tile: BoolProperty(
|
use_auto_tile: BoolProperty(
|
||||||
name="Using Tiling",
|
name="Use Tiling",
|
||||||
description="Render high resolution images in tiles to reduce memory usage, using the specified tile size. Tiles are cached to disk while rendering to save memory",
|
description="Render high resolution images in tiles to reduce memory usage, using the specified tile size. Tiles are cached to disk while rendering to save memory",
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
@@ -798,7 +807,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
name="Tile Size",
|
name="Tile Size",
|
||||||
default=2048,
|
default=2048,
|
||||||
description="",
|
description="",
|
||||||
min=8, max=16384,
|
min=8, max=8192,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Various fine-tuning debug flags
|
# Various fine-tuning debug flags
|
||||||
@@ -890,6 +899,32 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
|
|||||||
default=pi,
|
default=pi,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fisheye_polynomial_k0: FloatProperty(
|
||||||
|
name="Fisheye Polynomial K0",
|
||||||
|
description="Coefficient K0 of the lens polinomial",
|
||||||
|
default=camera.default_fisheye_polynomial[0], precision=6, step=0.1, subtype='ANGLE',
|
||||||
|
)
|
||||||
|
fisheye_polynomial_k1: FloatProperty(
|
||||||
|
name="Fisheye Polynomial K1",
|
||||||
|
description="Coefficient K1 of the lens polinomial",
|
||||||
|
default=camera.default_fisheye_polynomial[1], precision=6, step=0.1, subtype='ANGLE',
|
||||||
|
)
|
||||||
|
fisheye_polynomial_k2: FloatProperty(
|
||||||
|
name="Fisheye Polynomial K2",
|
||||||
|
description="Coefficient K2 of the lens polinomial",
|
||||||
|
default=camera.default_fisheye_polynomial[2], precision=6, step=0.1, subtype='ANGLE',
|
||||||
|
)
|
||||||
|
fisheye_polynomial_k3: FloatProperty(
|
||||||
|
name="Fisheye Polynomial K3",
|
||||||
|
description="Coefficient K3 of the lens polinomial",
|
||||||
|
default=camera.default_fisheye_polynomial[3], precision=6, step=0.1, subtype='ANGLE',
|
||||||
|
)
|
||||||
|
fisheye_polynomial_k4: FloatProperty(
|
||||||
|
name="Fisheye Polynomial K4",
|
||||||
|
description="Coefficient K4 of the lens polinomial",
|
||||||
|
default=camera.default_fisheye_polynomial[4], precision=6, step=0.1, subtype='ANGLE',
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def register(cls):
|
def register(cls):
|
||||||
bpy.types.Camera.cycles = PointerProperty(
|
bpy.types.Camera.cycles = PointerProperty(
|
||||||
@@ -1312,8 +1347,7 @@ 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, has_hip = _cycles.get_device_types()
|
has_cuda, has_optix, has_hip, has_metal = _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))
|
||||||
@@ -1321,6 +1355,8 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
list.append(('OPTIX', "OptiX", "Use OptiX for GPU acceleration", 3))
|
list.append(('OPTIX', "OptiX", "Use OptiX for GPU acceleration", 3))
|
||||||
if has_hip:
|
if has_hip:
|
||||||
list.append(('HIP', "HIP", "Use HIP for GPU acceleration", 4))
|
list.append(('HIP', "HIP", "Use HIP for GPU acceleration", 4))
|
||||||
|
if has_metal:
|
||||||
|
list.append(('METAL', "Metal", "Use Metal for GPU acceleration", 5))
|
||||||
|
|
||||||
return list
|
return list
|
||||||
|
|
||||||
@@ -1346,7 +1382,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', 'HIP'}:
|
if not device[1] in {'CUDA', 'OPTIX', 'CPU', 'HIP', 'METAL'}:
|
||||||
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)
|
||||||
@@ -1390,7 +1426,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', 'HIP'):
|
for device_type in ('CUDA', 'OPTIX', 'HIP', 'METAL'):
|
||||||
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.
|
||||||
@@ -1416,6 +1452,19 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
num += 1
|
num += 1
|
||||||
return num
|
return num
|
||||||
|
|
||||||
|
def has_multi_device(self):
|
||||||
|
import _cycles
|
||||||
|
compute_device_type = self.get_compute_device_type()
|
||||||
|
device_list = _cycles.available_devices(compute_device_type)
|
||||||
|
for device in device_list:
|
||||||
|
if device[1] == compute_device_type:
|
||||||
|
continue
|
||||||
|
for dev in self.devices:
|
||||||
|
if dev.use and dev.id == device[2]:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def has_active_device(self):
|
def has_active_device(self):
|
||||||
return self.get_num_gpu_devices() > 0
|
return self.get_num_gpu_devices() > 0
|
||||||
|
|
||||||
@@ -1442,6 +1491,8 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
col.label(text="Requires discrete AMD GPU with RDNA architecture", icon='BLANK1')
|
col.label(text="Requires discrete AMD GPU with RDNA architecture", icon='BLANK1')
|
||||||
if sys.platform[:3] == "win":
|
if sys.platform[:3] == "win":
|
||||||
col.label(text="and AMD Radeon Pro 21.Q4 driver or newer", icon='BLANK1')
|
col.label(text="and AMD Radeon Pro 21.Q4 driver or newer", icon='BLANK1')
|
||||||
|
elif device_type == 'METAL':
|
||||||
|
col.label(text="Requires Apple Silicon and macOS 12.0 or newer", icon='BLANK1')
|
||||||
return
|
return
|
||||||
|
|
||||||
for device in devices:
|
for device in devices:
|
||||||
|
@@ -97,6 +97,11 @@ def use_cpu(context):
|
|||||||
return (get_device_type(context) == 'NONE' or cscene.device == 'CPU')
|
return (get_device_type(context) == 'NONE' or cscene.device == 'CPU')
|
||||||
|
|
||||||
|
|
||||||
|
def use_metal(context):
|
||||||
|
cscene = context.scene.cycles
|
||||||
|
|
||||||
|
return (get_device_type(context) == 'METAL' and cscene.device == 'GPU')
|
||||||
|
|
||||||
def use_cuda(context):
|
def use_cuda(context):
|
||||||
cscene = context.scene.cycles
|
cscene = context.scene.cycles
|
||||||
|
|
||||||
@@ -113,11 +118,11 @@ def use_optix(context):
|
|||||||
|
|
||||||
return (get_device_type(context) == 'OPTIX' and cscene.device == 'GPU')
|
return (get_device_type(context) == 'OPTIX' and cscene.device == 'GPU')
|
||||||
|
|
||||||
|
def use_multi_device(context):
|
||||||
def use_sample_all_lights(context):
|
|
||||||
cscene = context.scene.cycles
|
cscene = context.scene.cycles
|
||||||
|
if cscene.device != 'GPU':
|
||||||
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
|
return False
|
||||||
|
return context.preferences.addons[__package__].preferences.has_multi_device()
|
||||||
|
|
||||||
|
|
||||||
def show_device_active(context):
|
def show_device_active(context):
|
||||||
@@ -662,6 +667,10 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
|
|||||||
bl_label = "Acceleration Structure"
|
bl_label = "Acceleration Structure"
|
||||||
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return not use_optix(context) or has_multi_device(context)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
import _cycles
|
import _cycles
|
||||||
|
|
||||||
@@ -674,21 +683,33 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
|
|||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|
||||||
use_embree = False
|
use_embree = _cycles.with_embree
|
||||||
|
|
||||||
if use_cpu(context):
|
if use_cpu(context):
|
||||||
use_embree = _cycles.with_embree
|
col.prop(cscene, "debug_use_spatial_splits")
|
||||||
if not use_embree:
|
if use_embree:
|
||||||
|
col.prop(cscene, "debug_use_compact_bvh")
|
||||||
|
else:
|
||||||
|
sub = col.column()
|
||||||
|
sub.active = not cscene.debug_use_spatial_splits
|
||||||
|
sub.prop(cscene, "debug_bvh_time_steps")
|
||||||
|
|
||||||
|
col.prop(cscene, "debug_use_hair_bvh")
|
||||||
|
|
||||||
sub = col.column(align=True)
|
sub = col.column(align=True)
|
||||||
sub.label(text="Cycles built without Embree support")
|
sub.label(text="Cycles built without Embree support")
|
||||||
sub.label(text="CPU raytracing performance will be poor")
|
sub.label(text="CPU raytracing performance will be poor")
|
||||||
|
else:
|
||||||
|
col.prop(cscene, "debug_use_spatial_splits")
|
||||||
|
sub = col.column()
|
||||||
|
sub.active = not cscene.debug_use_spatial_splits
|
||||||
|
sub.prop(cscene, "debug_bvh_time_steps")
|
||||||
|
|
||||||
col.prop(cscene, "debug_use_spatial_splits")
|
col.prop(cscene, "debug_use_hair_bvh")
|
||||||
sub = col.column()
|
|
||||||
sub.active = not use_embree
|
# CPU is used in addition to a GPU
|
||||||
sub.prop(cscene, "debug_use_hair_bvh")
|
if use_multi_device(context) and use_embree:
|
||||||
sub = col.column()
|
col.prop(cscene, "debug_use_compact_bvh")
|
||||||
sub.active = not cscene.debug_use_spatial_splits and not use_embree
|
|
||||||
sub.prop(cscene, "debug_bvh_time_steps")
|
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_RENDER_PT_performance_final_render(CyclesButtonsPanel, Panel):
|
class CYCLES_RENDER_PT_performance_final_render(CyclesButtonsPanel, Panel):
|
||||||
@@ -1015,7 +1036,7 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
ob = context.object
|
ob = context.object
|
||||||
if CyclesButtonsPanel.poll(context) and ob:
|
if CyclesButtonsPanel.poll(context) and ob:
|
||||||
if ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META', 'CAMERA'}:
|
if ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META', 'CAMERA', 'HAIR', 'POINTCLOUD'}:
|
||||||
return True
|
return True
|
||||||
if ob.instance_type == 'COLLECTION' and ob.instance_collection:
|
if ob.instance_type == 'COLLECTION' and ob.instance_collection:
|
||||||
return True
|
return True
|
||||||
@@ -1798,18 +1819,45 @@ class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, Panel):
|
|||||||
rd = scene.render
|
rd = scene.render
|
||||||
|
|
||||||
if rd.use_bake_multires:
|
if rd.use_bake_multires:
|
||||||
layout.prop(rd, "bake_margin")
|
|
||||||
layout.prop(rd, "use_bake_clear", text="Clear Image")
|
layout.prop(rd, "use_bake_clear", text="Clear Image")
|
||||||
|
|
||||||
if rd.bake_type == 'DISPLACEMENT':
|
if rd.bake_type == 'DISPLACEMENT':
|
||||||
layout.prop(rd, "use_bake_lores_mesh")
|
layout.prop(rd, "use_bake_lores_mesh")
|
||||||
else:
|
else:
|
||||||
layout.prop(cbk, "target")
|
layout.prop(cbk, "target")
|
||||||
|
|
||||||
if cbk.target == 'IMAGE_TEXTURES':
|
if cbk.target == 'IMAGE_TEXTURES':
|
||||||
layout.prop(cbk, "margin")
|
|
||||||
layout.prop(cbk, "use_clear", text="Clear Image")
|
layout.prop(cbk, "use_clear", text="Clear Image")
|
||||||
|
|
||||||
|
class CYCLES_RENDER_PT_bake_output_margin(CyclesButtonsPanel, Panel):
|
||||||
|
bl_label = "Margin"
|
||||||
|
bl_context = "render"
|
||||||
|
bl_parent_id = "CYCLES_RENDER_PT_bake_output"
|
||||||
|
COMPAT_ENGINES = {'CYCLES'}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
scene = context.scene
|
||||||
|
cbk = scene.render.bake
|
||||||
|
return cbk.target == 'IMAGE_TEXTURES'
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
layout.use_property_decorate = False # No animation.
|
||||||
|
|
||||||
|
scene = context.scene
|
||||||
|
cscene = scene.cycles
|
||||||
|
cbk = scene.render.bake
|
||||||
|
rd = scene.render
|
||||||
|
|
||||||
|
if rd.use_bake_multires:
|
||||||
|
layout.prop(rd, "bake_margin_type", text="Type")
|
||||||
|
layout.prop(rd, "bake_margin", text="Size")
|
||||||
|
else:
|
||||||
|
if cbk.target == 'IMAGE_TEXTURES':
|
||||||
|
layout.prop(cbk, "margin_type", text="Type")
|
||||||
|
layout.prop(cbk, "margin", text="Size")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel):
|
class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel):
|
||||||
bl_label = "Debug"
|
bl_label = "Debug"
|
||||||
@@ -1819,37 +1867,38 @@ class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
layout.use_property_decorate = False # No animation.
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column(heading="CPU")
|
||||||
|
|
||||||
col.label(text="CPU Flags:")
|
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(cscene, "debug_use_cpu_sse2", toggle=True)
|
row.prop(cscene, "debug_use_cpu_sse2", toggle=True)
|
||||||
row.prop(cscene, "debug_use_cpu_sse3", toggle=True)
|
row.prop(cscene, "debug_use_cpu_sse3", toggle=True)
|
||||||
row.prop(cscene, "debug_use_cpu_sse41", toggle=True)
|
row.prop(cscene, "debug_use_cpu_sse41", toggle=True)
|
||||||
row.prop(cscene, "debug_use_cpu_avx", toggle=True)
|
row.prop(cscene, "debug_use_cpu_avx", toggle=True)
|
||||||
row.prop(cscene, "debug_use_cpu_avx2", toggle=True)
|
row.prop(cscene, "debug_use_cpu_avx2", toggle=True)
|
||||||
col.prop(cscene, "debug_bvh_layout")
|
col.prop(cscene, "debug_bvh_layout", text="BVH")
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column(heading="CUDA")
|
||||||
col.label(text="CUDA Flags:")
|
|
||||||
col.prop(cscene, "debug_use_cuda_adaptive_compile")
|
col.prop(cscene, "debug_use_cuda_adaptive_compile")
|
||||||
|
col = layout.column(heading="OptiX")
|
||||||
|
col.prop(cscene, "debug_use_optix_debug", text="Module Debug")
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
col = layout.column()
|
col.prop(cscene, "debug_bvh_type", text="Viewport BVH")
|
||||||
col.label(text="OptiX Flags:")
|
|
||||||
col.prop(cscene, "debug_use_optix_debug")
|
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
col = layout.column()
|
import _cycles
|
||||||
col.prop(cscene, "debug_bvh_type")
|
if _cycles.with_debug:
|
||||||
|
col.prop(cscene, "direct_light_sampling_type")
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_RENDER_PT_simplify(CyclesButtonsPanel, Panel):
|
class CYCLES_RENDER_PT_simplify(CyclesButtonsPanel, Panel):
|
||||||
@@ -2177,6 +2226,7 @@ classes = (
|
|||||||
CYCLES_RENDER_PT_bake_influence,
|
CYCLES_RENDER_PT_bake_influence,
|
||||||
CYCLES_RENDER_PT_bake_selected_to_active,
|
CYCLES_RENDER_PT_bake_selected_to_active,
|
||||||
CYCLES_RENDER_PT_bake_output,
|
CYCLES_RENDER_PT_bake_output,
|
||||||
|
CYCLES_RENDER_PT_bake_output_margin,
|
||||||
CYCLES_RENDER_PT_debug,
|
CYCLES_RENDER_PT_debug,
|
||||||
node_panel(CYCLES_MATERIAL_PT_settings),
|
node_panel(CYCLES_MATERIAL_PT_settings),
|
||||||
node_panel(CYCLES_MATERIAL_PT_settings_surface),
|
node_panel(CYCLES_MATERIAL_PT_settings_surface),
|
||||||
|
@@ -69,6 +69,12 @@ struct BlenderCamera {
|
|||||||
float pole_merge_angle_from;
|
float pole_merge_angle_from;
|
||||||
float pole_merge_angle_to;
|
float pole_merge_angle_to;
|
||||||
|
|
||||||
|
float fisheye_polynomial_k0;
|
||||||
|
float fisheye_polynomial_k1;
|
||||||
|
float fisheye_polynomial_k2;
|
||||||
|
float fisheye_polynomial_k3;
|
||||||
|
float fisheye_polynomial_k4;
|
||||||
|
|
||||||
enum { AUTO, HORIZONTAL, VERTICAL } sensor_fit;
|
enum { AUTO, HORIZONTAL, VERTICAL } sensor_fit;
|
||||||
float sensor_width;
|
float sensor_width;
|
||||||
float sensor_height;
|
float sensor_height;
|
||||||
@@ -200,6 +206,12 @@ static void blender_camera_from_object(BlenderCamera *bcam,
|
|||||||
bcam->longitude_min = RNA_float_get(&ccamera, "longitude_min");
|
bcam->longitude_min = RNA_float_get(&ccamera, "longitude_min");
|
||||||
bcam->longitude_max = RNA_float_get(&ccamera, "longitude_max");
|
bcam->longitude_max = RNA_float_get(&ccamera, "longitude_max");
|
||||||
|
|
||||||
|
bcam->fisheye_polynomial_k0 = RNA_float_get(&ccamera, "fisheye_polynomial_k0");
|
||||||
|
bcam->fisheye_polynomial_k1 = RNA_float_get(&ccamera, "fisheye_polynomial_k1");
|
||||||
|
bcam->fisheye_polynomial_k2 = RNA_float_get(&ccamera, "fisheye_polynomial_k2");
|
||||||
|
bcam->fisheye_polynomial_k3 = RNA_float_get(&ccamera, "fisheye_polynomial_k3");
|
||||||
|
bcam->fisheye_polynomial_k4 = RNA_float_get(&ccamera, "fisheye_polynomial_k4");
|
||||||
|
|
||||||
bcam->interocular_distance = b_camera.stereo().interocular_distance();
|
bcam->interocular_distance = b_camera.stereo().interocular_distance();
|
||||||
if (b_camera.stereo().convergence_mode() == BL::CameraStereoData::convergence_mode_PARALLEL) {
|
if (b_camera.stereo().convergence_mode() == BL::CameraStereoData::convergence_mode_PARALLEL) {
|
||||||
bcam->convergence_distance = FLT_MAX;
|
bcam->convergence_distance = FLT_MAX;
|
||||||
@@ -422,7 +434,8 @@ static void blender_camera_sync(Camera *cam,
|
|||||||
cam->set_full_height(height);
|
cam->set_full_height(height);
|
||||||
|
|
||||||
/* panorama sensor */
|
/* panorama sensor */
|
||||||
if (bcam->type == CAMERA_PANORAMA && bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID) {
|
if (bcam->type == CAMERA_PANORAMA && (bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID ||
|
||||||
|
bcam->panorama_type == PANORAMA_FISHEYE_LENS_POLYNOMIAL)) {
|
||||||
float fit_xratio = (float)bcam->render_width * bcam->pixelaspect.x;
|
float fit_xratio = (float)bcam->render_width * bcam->pixelaspect.x;
|
||||||
float fit_yratio = (float)bcam->render_height * bcam->pixelaspect.y;
|
float fit_yratio = (float)bcam->render_height * bcam->pixelaspect.y;
|
||||||
bool horizontal_fit;
|
bool horizontal_fit;
|
||||||
@@ -465,6 +478,12 @@ static void blender_camera_sync(Camera *cam,
|
|||||||
cam->set_latitude_min(bcam->latitude_min);
|
cam->set_latitude_min(bcam->latitude_min);
|
||||||
cam->set_latitude_max(bcam->latitude_max);
|
cam->set_latitude_max(bcam->latitude_max);
|
||||||
|
|
||||||
|
cam->set_fisheye_polynomial_k0(bcam->fisheye_polynomial_k0);
|
||||||
|
cam->set_fisheye_polynomial_k1(bcam->fisheye_polynomial_k1);
|
||||||
|
cam->set_fisheye_polynomial_k2(bcam->fisheye_polynomial_k2);
|
||||||
|
cam->set_fisheye_polynomial_k3(bcam->fisheye_polynomial_k3);
|
||||||
|
cam->set_fisheye_polynomial_k4(bcam->fisheye_polynomial_k4);
|
||||||
|
|
||||||
cam->set_longitude_min(bcam->longitude_min);
|
cam->set_longitude_min(bcam->longitude_min);
|
||||||
cam->set_longitude_max(bcam->longitude_max);
|
cam->set_longitude_max(bcam->longitude_max);
|
||||||
|
|
||||||
|
@@ -819,11 +819,14 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, H
|
|||||||
new_hair.set_used_shaders(used_shaders);
|
new_hair.set_used_shaders(used_shaders);
|
||||||
|
|
||||||
if (view_layer.use_hair) {
|
if (view_layer.use_hair) {
|
||||||
|
#ifdef WITH_HAIR_NODES
|
||||||
if (b_ob_info.object_data.is_a(&RNA_Hair)) {
|
if (b_ob_info.object_data.is_a(&RNA_Hair)) {
|
||||||
/* Hair object. */
|
/* Hair object. */
|
||||||
sync_hair(&new_hair, b_ob_info, false);
|
sync_hair(&new_hair, b_ob_info, false);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* Particle hair. */
|
/* Particle hair. */
|
||||||
bool need_undeformed = new_hair.need_attribute(scene, ATTR_STD_GENERATED);
|
bool need_undeformed = new_hair.need_attribute(scene, ATTR_STD_GENERATED);
|
||||||
BL::Mesh b_mesh = object_to_mesh(
|
BL::Mesh b_mesh = object_to_mesh(
|
||||||
@@ -870,12 +873,15 @@ void BlenderSync::sync_hair_motion(BL::Depsgraph b_depsgraph,
|
|||||||
|
|
||||||
/* Export deformed coordinates. */
|
/* Export deformed coordinates. */
|
||||||
if (ccl::BKE_object_is_deform_modified(b_ob_info, b_scene, preview)) {
|
if (ccl::BKE_object_is_deform_modified(b_ob_info, b_scene, preview)) {
|
||||||
|
#ifdef WITH_HAIR_NODES
|
||||||
if (b_ob_info.object_data.is_a(&RNA_Hair)) {
|
if (b_ob_info.object_data.is_a(&RNA_Hair)) {
|
||||||
/* Hair object. */
|
/* Hair object. */
|
||||||
sync_hair(hair, b_ob_info, true, motion_step);
|
sync_hair(hair, b_ob_info, true, motion_step);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* Particle hair. */
|
/* Particle hair. */
|
||||||
BL::Mesh b_mesh = object_to_mesh(
|
BL::Mesh b_mesh = object_to_mesh(
|
||||||
b_data, b_ob_info, b_depsgraph, false, Mesh::SUBDIVISION_NONE);
|
b_data, b_ob_info, b_depsgraph, false, Mesh::SUBDIVISION_NONE);
|
||||||
|
@@ -27,6 +27,7 @@ enum ComputeDevice {
|
|||||||
COMPUTE_DEVICE_CUDA = 1,
|
COMPUTE_DEVICE_CUDA = 1,
|
||||||
COMPUTE_DEVICE_OPTIX = 3,
|
COMPUTE_DEVICE_OPTIX = 3,
|
||||||
COMPUTE_DEVICE_HIP = 4,
|
COMPUTE_DEVICE_HIP = 4,
|
||||||
|
COMPUTE_DEVICE_METAL = 5,
|
||||||
|
|
||||||
COMPUTE_DEVICE_NUM
|
COMPUTE_DEVICE_NUM
|
||||||
};
|
};
|
||||||
@@ -85,6 +86,9 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scen
|
|||||||
else if (compute_device == COMPUTE_DEVICE_HIP) {
|
else if (compute_device == COMPUTE_DEVICE_HIP) {
|
||||||
mask |= DEVICE_MASK_HIP;
|
mask |= DEVICE_MASK_HIP;
|
||||||
}
|
}
|
||||||
|
else if (compute_device == COMPUTE_DEVICE_METAL) {
|
||||||
|
mask |= DEVICE_MASK_METAL;
|
||||||
|
}
|
||||||
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. */
|
||||||
|
@@ -272,12 +272,300 @@ uint BlenderDisplaySpaceShader::get_shader_program()
|
|||||||
return shader_program_;
|
return shader_program_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------
|
||||||
|
* DrawTile.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Higher level representation of a texture from the graphics library. */
|
||||||
|
class GLTexture {
|
||||||
|
public:
|
||||||
|
/* Global counter for all allocated OpenGL textures used by instances of this class. */
|
||||||
|
static inline std::atomic<int> num_used = 0;
|
||||||
|
|
||||||
|
GLTexture() = default;
|
||||||
|
|
||||||
|
~GLTexture()
|
||||||
|
{
|
||||||
|
assert(gl_id == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GLTexture(const GLTexture &other) = delete;
|
||||||
|
GLTexture &operator=(GLTexture &other) = delete;
|
||||||
|
|
||||||
|
GLTexture(GLTexture &&other) noexcept
|
||||||
|
: gl_id(other.gl_id), width(other.width), height(other.height)
|
||||||
|
{
|
||||||
|
other.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
GLTexture &operator=(GLTexture &&other)
|
||||||
|
{
|
||||||
|
if (this == &other) {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_id = other.gl_id;
|
||||||
|
width = other.width;
|
||||||
|
height = other.height;
|
||||||
|
|
||||||
|
other.reset();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool gl_resources_ensure()
|
||||||
|
{
|
||||||
|
if (gl_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create texture. */
|
||||||
|
glGenTextures(1, &gl_id);
|
||||||
|
if (!gl_id) {
|
||||||
|
LOG(ERROR) << "Error creating texture.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Configure the texture. */
|
||||||
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, gl_id);
|
||||||
|
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
|
/* Clamp to edge so that precision issues when zoomed out (which forces linear interpolation)
|
||||||
|
* does not cause unwanted repetition. */
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
|
++num_used;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gl_resources_destroy()
|
||||||
|
{
|
||||||
|
if (!gl_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
glDeleteTextures(1, &gl_id);
|
||||||
|
|
||||||
|
reset();
|
||||||
|
|
||||||
|
--num_used;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* OpenGL resource IDs of the texture.
|
||||||
|
*
|
||||||
|
* NOTE: Allocated on the render engine's context. */
|
||||||
|
uint gl_id = 0;
|
||||||
|
|
||||||
|
/* Dimensions of the texture in pixels. */
|
||||||
|
int width = 0;
|
||||||
|
int height = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void reset()
|
||||||
|
{
|
||||||
|
gl_id = 0;
|
||||||
|
width = 0;
|
||||||
|
height = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Higher level representation of a Pixel Buffer Object (PBO) from the graphics library. */
|
||||||
|
class GLPixelBufferObject {
|
||||||
|
public:
|
||||||
|
/* Global counter for all allocated OpenGL PBOs used by instances of this class. */
|
||||||
|
static inline std::atomic<int> num_used = 0;
|
||||||
|
|
||||||
|
GLPixelBufferObject() = default;
|
||||||
|
|
||||||
|
~GLPixelBufferObject()
|
||||||
|
{
|
||||||
|
assert(gl_id == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GLPixelBufferObject(const GLPixelBufferObject &other) = delete;
|
||||||
|
GLPixelBufferObject &operator=(GLPixelBufferObject &other) = delete;
|
||||||
|
|
||||||
|
GLPixelBufferObject(GLPixelBufferObject &&other) noexcept
|
||||||
|
: gl_id(other.gl_id), width(other.width), height(other.height)
|
||||||
|
{
|
||||||
|
other.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
GLPixelBufferObject &operator=(GLPixelBufferObject &&other)
|
||||||
|
{
|
||||||
|
if (this == &other) {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_id = other.gl_id;
|
||||||
|
width = other.width;
|
||||||
|
height = other.height;
|
||||||
|
|
||||||
|
other.reset();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool gl_resources_ensure()
|
||||||
|
{
|
||||||
|
if (gl_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
glGenBuffers(1, &gl_id);
|
||||||
|
if (!gl_id) {
|
||||||
|
LOG(ERROR) << "Error creating texture pixel buffer object.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
++num_used;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gl_resources_destroy()
|
||||||
|
{
|
||||||
|
if (!gl_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
glDeleteBuffers(1, &gl_id);
|
||||||
|
|
||||||
|
reset();
|
||||||
|
|
||||||
|
--num_used;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* OpenGL resource IDs of the PBO.
|
||||||
|
*
|
||||||
|
* NOTE: Allocated on the render engine's context. */
|
||||||
|
uint gl_id = 0;
|
||||||
|
|
||||||
|
/* Dimensions of the PBO. */
|
||||||
|
int width = 0;
|
||||||
|
int height = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void reset()
|
||||||
|
{
|
||||||
|
gl_id = 0;
|
||||||
|
width = 0;
|
||||||
|
height = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawTile {
|
||||||
|
public:
|
||||||
|
DrawTile() = default;
|
||||||
|
~DrawTile() = default;
|
||||||
|
|
||||||
|
DrawTile(const DrawTile &other) = delete;
|
||||||
|
DrawTile &operator=(const DrawTile &other) = delete;
|
||||||
|
|
||||||
|
DrawTile(DrawTile &&other) noexcept = default;
|
||||||
|
|
||||||
|
DrawTile &operator=(DrawTile &&other) = default;
|
||||||
|
|
||||||
|
bool gl_resources_ensure()
|
||||||
|
{
|
||||||
|
if (!texture.gl_resources_ensure()) {
|
||||||
|
gl_resources_destroy();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gl_vertex_buffer) {
|
||||||
|
glGenBuffers(1, &gl_vertex_buffer);
|
||||||
|
if (!gl_vertex_buffer) {
|
||||||
|
LOG(ERROR) << "Error allocating tile VBO.";
|
||||||
|
gl_resources_destroy();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gl_resources_destroy()
|
||||||
|
{
|
||||||
|
texture.gl_resources_destroy();
|
||||||
|
|
||||||
|
if (gl_vertex_buffer) {
|
||||||
|
glDeleteBuffers(1, &gl_vertex_buffer);
|
||||||
|
gl_vertex_buffer = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool ready_to_draw() const
|
||||||
|
{
|
||||||
|
return texture.gl_id != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Texture which contains pixels of the tile. */
|
||||||
|
GLTexture texture;
|
||||||
|
|
||||||
|
/* Display parameters the texture of this tile has been updated for. */
|
||||||
|
BlenderDisplayDriver::Params params;
|
||||||
|
|
||||||
|
/* OpenGL resources needed for drawing. */
|
||||||
|
uint gl_vertex_buffer = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawTileAndPBO {
|
||||||
|
public:
|
||||||
|
bool gl_resources_ensure()
|
||||||
|
{
|
||||||
|
if (!tile.gl_resources_ensure() || !buffer_object.gl_resources_ensure()) {
|
||||||
|
gl_resources_destroy();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gl_resources_destroy()
|
||||||
|
{
|
||||||
|
tile.gl_resources_destroy();
|
||||||
|
buffer_object.gl_resources_destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawTile tile;
|
||||||
|
GLPixelBufferObject buffer_object;
|
||||||
|
};
|
||||||
|
|
||||||
/* --------------------------------------------------------------------
|
/* --------------------------------------------------------------------
|
||||||
* BlenderDisplayDriver.
|
* BlenderDisplayDriver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
struct BlenderDisplayDriver::Tiles {
|
||||||
|
/* Resources of a tile which is being currently rendered. */
|
||||||
|
DrawTileAndPBO current_tile;
|
||||||
|
|
||||||
|
/* All tiles which rendering is finished and which content will not be changed. */
|
||||||
|
struct {
|
||||||
|
vector<DrawTile> tiles;
|
||||||
|
|
||||||
|
void gl_resources_destroy_and_clear()
|
||||||
|
{
|
||||||
|
for (DrawTile &tile : tiles) {
|
||||||
|
tile.gl_resources_destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles.clear();
|
||||||
|
}
|
||||||
|
} finished_tiles;
|
||||||
|
};
|
||||||
|
|
||||||
BlenderDisplayDriver::BlenderDisplayDriver(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)),
|
||||||
|
tiles_(make_unique<Tiles>())
|
||||||
{
|
{
|
||||||
/* Create context while on the main thread. */
|
/* Create context while on the main thread. */
|
||||||
gl_context_create();
|
gl_context_create();
|
||||||
@@ -292,6 +580,21 @@ BlenderDisplayDriver::~BlenderDisplayDriver()
|
|||||||
* Update procedure.
|
* Update procedure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void BlenderDisplayDriver::next_tile_begin()
|
||||||
|
{
|
||||||
|
if (!tiles_->current_tile.tile.ready_to_draw()) {
|
||||||
|
LOG(ERROR)
|
||||||
|
<< "Unexpectedly moving to the next tile without any data provided for current tile.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Moving to the next tile without giving render data for the current tile is not an expected
|
||||||
|
* situation. */
|
||||||
|
DCHECK(!need_clear_);
|
||||||
|
|
||||||
|
tiles_->finished_tiles.tiles.emplace_back(std::move(tiles_->current_tile.tile));
|
||||||
|
}
|
||||||
|
|
||||||
bool BlenderDisplayDriver::update_begin(const Params ¶ms,
|
bool BlenderDisplayDriver::update_begin(const Params ¶ms,
|
||||||
int texture_width,
|
int texture_width,
|
||||||
int texture_height)
|
int texture_height)
|
||||||
@@ -312,24 +615,33 @@ bool BlenderDisplayDriver::update_begin(const Params ¶ms,
|
|||||||
glWaitSync((GLsync)gl_render_sync_, 0, GL_TIMEOUT_IGNORED);
|
glWaitSync((GLsync)gl_render_sync_, 0, GL_TIMEOUT_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gl_texture_resources_ensure()) {
|
DrawTile ¤t_tile = tiles_->current_tile.tile;
|
||||||
|
GLPixelBufferObject ¤t_tile_buffer_object = tiles_->current_tile.buffer_object;
|
||||||
|
|
||||||
|
/* Clear storage of all finished tiles when display clear is requested.
|
||||||
|
* Do it when new tile data is provided to handle the display clear flag in a single place.
|
||||||
|
* It also makes the logic reliable from the whether drawing did happen or not point of view. */
|
||||||
|
if (need_clear_) {
|
||||||
|
tiles_->finished_tiles.gl_resources_destroy_and_clear();
|
||||||
|
need_clear_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tiles_->current_tile.gl_resources_ensure()) {
|
||||||
|
tiles_->current_tile.gl_resources_destroy();
|
||||||
gl_context_disable();
|
gl_context_disable();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update texture dimensions if needed. */
|
/* Update texture dimensions if needed. */
|
||||||
if (texture_.width != texture_width || texture_.height != texture_height) {
|
if (current_tile.texture.width != texture_width ||
|
||||||
|
current_tile.texture.height != texture_height) {
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_.gl_id);
|
glBindTexture(GL_TEXTURE_2D, current_tile.texture.gl_id);
|
||||||
glTexImage2D(
|
glTexImage2D(
|
||||||
GL_TEXTURE_2D, 0, GL_RGBA16F, texture_width, texture_height, 0, GL_RGBA, GL_HALF_FLOAT, 0);
|
GL_TEXTURE_2D, 0, GL_RGBA16F, texture_width, texture_height, 0, GL_RGBA, GL_HALF_FLOAT, 0);
|
||||||
texture_.width = texture_width;
|
current_tile.texture.width = texture_width;
|
||||||
texture_.height = texture_height;
|
current_tile.texture.height = texture_height;
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
/* Texture did change, and no pixel storage was provided. Tag for an explicit zeroing out to
|
|
||||||
* avoid undefined content. */
|
|
||||||
texture_.need_clear = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update PBO dimensions if needed.
|
/* Update PBO dimensions if needed.
|
||||||
@@ -341,29 +653,58 @@ bool BlenderDisplayDriver::update_begin(const Params ¶ms,
|
|||||||
* sending too much data to GPU when resolution divider is not 1. */
|
* sending too much data to GPU when resolution divider is not 1. */
|
||||||
/* TODO(sergey): Investigate whether keeping the PBO exact size of the texture makes non-interop
|
/* TODO(sergey): Investigate whether keeping the PBO exact size of the texture makes non-interop
|
||||||
* mode faster. */
|
* mode faster. */
|
||||||
const int buffer_width = params.full_size.x;
|
const int buffer_width = params.size.x;
|
||||||
const int buffer_height = params.full_size.y;
|
const int buffer_height = params.size.y;
|
||||||
if (texture_.buffer_width != buffer_width || texture_.buffer_height != buffer_height) {
|
if (current_tile_buffer_object.width != buffer_width ||
|
||||||
|
current_tile_buffer_object.height != buffer_height) {
|
||||||
const size_t size_in_bytes = sizeof(half4) * buffer_width * buffer_height;
|
const size_t size_in_bytes = sizeof(half4) * buffer_width * buffer_height;
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture_.gl_pbo_id);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, current_tile_buffer_object.gl_id);
|
||||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, size_in_bytes, 0, GL_DYNAMIC_DRAW);
|
glBufferData(GL_PIXEL_UNPACK_BUFFER, size_in_bytes, 0, GL_DYNAMIC_DRAW);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
|
|
||||||
texture_.buffer_width = buffer_width;
|
current_tile_buffer_object.width = buffer_width;
|
||||||
texture_.buffer_height = buffer_height;
|
current_tile_buffer_object.height = buffer_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* New content will be provided to the texture in one way or another, so mark this in a
|
/* Store an updated parameters of the current tile.
|
||||||
* centralized place. */
|
* In theory it is only needed once per update of the tile, but doing it on every update is
|
||||||
texture_.need_update = true;
|
* the easiest and is not expensive. */
|
||||||
|
tiles_->current_tile.tile.params = params;
|
||||||
texture_.params = params;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void update_tile_texture_pixels(const DrawTileAndPBO &tile)
|
||||||
|
{
|
||||||
|
const GLTexture &texture = tile.tile.texture;
|
||||||
|
|
||||||
|
DCHECK_NE(tile.buffer_object.gl_id, 0);
|
||||||
|
|
||||||
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture.gl_id);
|
||||||
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, tile.buffer_object.gl_id);
|
||||||
|
|
||||||
|
glTexSubImage2D(
|
||||||
|
GL_TEXTURE_2D, 0, 0, 0, texture.width, texture.height, GL_RGBA, GL_HALF_FLOAT, 0);
|
||||||
|
|
||||||
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void BlenderDisplayDriver::update_end()
|
void BlenderDisplayDriver::update_end()
|
||||||
{
|
{
|
||||||
|
/* Unpack the PBO into the texture as soon as the new content is provided.
|
||||||
|
*
|
||||||
|
* This allows to ensure that the unpacking happens while resources like graphics interop (which
|
||||||
|
* lifetime is outside of control of the display driver) are still valid, as well as allows to
|
||||||
|
* move the tile from being current to finished immediately after this call.
|
||||||
|
*
|
||||||
|
* One concern with this approach is that if the update happens more often than drawing then
|
||||||
|
* doing the unpack here occupies GPU transfer for no good reason. However, the render scheduler
|
||||||
|
* takes care of ensuring updates don't happen that often. In regular applications redraw will
|
||||||
|
* happen much more often than this update. */
|
||||||
|
update_tile_texture_pixels(tiles_->current_tile);
|
||||||
|
|
||||||
gl_upload_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
gl_upload_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|
||||||
@@ -376,7 +717,11 @@ void BlenderDisplayDriver::update_end()
|
|||||||
|
|
||||||
half4 *BlenderDisplayDriver::map_texture_buffer()
|
half4 *BlenderDisplayDriver::map_texture_buffer()
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture_.gl_pbo_id);
|
const uint pbo_gl_id = tiles_->current_tile.buffer_object.gl_id;
|
||||||
|
|
||||||
|
DCHECK_NE(pbo_gl_id, 0);
|
||||||
|
|
||||||
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo_gl_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));
|
||||||
@@ -384,15 +729,6 @@ half4 *BlenderDisplayDriver::map_texture_buffer()
|
|||||||
LOG(ERROR) << "Error mapping BlenderDisplayDriver pixel buffer object.";
|
LOG(ERROR) << "Error mapping BlenderDisplayDriver pixel buffer object.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_.need_clear) {
|
|
||||||
const int64_t texture_width = texture_.width;
|
|
||||||
const int64_t texture_height = texture_.height;
|
|
||||||
memset(reinterpret_cast<void *>(mapped_rgba_pixels),
|
|
||||||
0,
|
|
||||||
texture_width * texture_height * sizeof(half4));
|
|
||||||
texture_.need_clear = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mapped_rgba_pixels;
|
return mapped_rgba_pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,12 +747,9 @@ BlenderDisplayDriver::GraphicsInterop BlenderDisplayDriver::graphics_interop_get
|
|||||||
{
|
{
|
||||||
GraphicsInterop interop_dst;
|
GraphicsInterop interop_dst;
|
||||||
|
|
||||||
interop_dst.buffer_width = texture_.buffer_width;
|
interop_dst.buffer_width = tiles_->current_tile.buffer_object.width;
|
||||||
interop_dst.buffer_height = texture_.buffer_height;
|
interop_dst.buffer_height = tiles_->current_tile.buffer_object.height;
|
||||||
interop_dst.opengl_pbo_id = texture_.gl_pbo_id;
|
interop_dst.opengl_pbo_id = tiles_->current_tile.buffer_object.gl_id;
|
||||||
|
|
||||||
interop_dst.need_clear = texture_.need_clear;
|
|
||||||
texture_.need_clear = false;
|
|
||||||
|
|
||||||
return interop_dst;
|
return interop_dst;
|
||||||
}
|
}
|
||||||
@@ -437,7 +770,7 @@ void BlenderDisplayDriver::graphics_interop_deactivate()
|
|||||||
|
|
||||||
void BlenderDisplayDriver::clear()
|
void BlenderDisplayDriver::clear()
|
||||||
{
|
{
|
||||||
texture_.need_clear = true;
|
need_clear_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderDisplayDriver::set_zoom(float zoom_x, float zoom_y)
|
void BlenderDisplayDriver::set_zoom(float zoom_x, float zoom_y)
|
||||||
@@ -445,26 +778,155 @@ void BlenderDisplayDriver::set_zoom(float zoom_x, float zoom_y)
|
|||||||
zoom_ = make_float2(zoom_x, zoom_y);
|
zoom_ = make_float2(zoom_x, zoom_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update vertex buffer with new coordinates of vertex positions and texture coordinates.
|
||||||
|
* This buffer is used to render texture in the viewport.
|
||||||
|
*
|
||||||
|
* NOTE: The buffer needs to be bound. */
|
||||||
|
static void vertex_buffer_update(const DisplayDriver::Params ¶ms)
|
||||||
|
{
|
||||||
|
const int x = params.full_offset.x;
|
||||||
|
const int y = params.full_offset.y;
|
||||||
|
|
||||||
|
const int width = params.size.x;
|
||||||
|
const int height = params.size.y;
|
||||||
|
|
||||||
|
/* Invalidate old contents - avoids stalling if the buffer is still waiting in queue to be
|
||||||
|
* rendered. */
|
||||||
|
glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STREAM_DRAW);
|
||||||
|
|
||||||
|
float *vpointer = reinterpret_cast<float *>(glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY));
|
||||||
|
if (!vpointer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
vpointer[0] = 0.0f;
|
||||||
|
vpointer[1] = 0.0f;
|
||||||
|
vpointer[2] = x;
|
||||||
|
vpointer[3] = y;
|
||||||
|
|
||||||
|
vpointer[4] = 1.0f;
|
||||||
|
vpointer[5] = 0.0f;
|
||||||
|
vpointer[6] = x + width;
|
||||||
|
vpointer[7] = y;
|
||||||
|
|
||||||
|
vpointer[8] = 1.0f;
|
||||||
|
vpointer[9] = 1.0f;
|
||||||
|
vpointer[10] = x + width;
|
||||||
|
vpointer[11] = y + height;
|
||||||
|
|
||||||
|
vpointer[12] = 0.0f;
|
||||||
|
vpointer[13] = 1.0f;
|
||||||
|
vpointer[14] = x;
|
||||||
|
vpointer[15] = y + height;
|
||||||
|
|
||||||
|
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void draw_tile(const float2 &zoom,
|
||||||
|
const int texcoord_attribute,
|
||||||
|
const int position_attribute,
|
||||||
|
const DrawTile &draw_tile)
|
||||||
|
{
|
||||||
|
if (!draw_tile.ready_to_draw()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const GLTexture &texture = draw_tile.texture;
|
||||||
|
|
||||||
|
DCHECK_NE(texture.gl_id, 0);
|
||||||
|
DCHECK_NE(draw_tile.gl_vertex_buffer, 0);
|
||||||
|
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, draw_tile.gl_vertex_buffer);
|
||||||
|
|
||||||
|
/* 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. */
|
||||||
|
vertex_buffer_update(draw_tile.params);
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture.gl_id);
|
||||||
|
|
||||||
|
/* Trick to keep sharp rendering without jagged edges on all GPUs.
|
||||||
|
*
|
||||||
|
* The idea here is to enforce driver to use linear interpolation when the image is not zoomed
|
||||||
|
* in.
|
||||||
|
* For the render result with a resolution divider in effect we always use nearest interpolation.
|
||||||
|
*
|
||||||
|
* Use explicit MIN assignment to make sure the driver does not have an undefined behavior at
|
||||||
|
* the zoom level 1. The MAG filter is always NEAREST. */
|
||||||
|
const float zoomed_width = draw_tile.params.size.x * zoom.x;
|
||||||
|
const float zoomed_height = draw_tile.params.size.y * zoom.y;
|
||||||
|
if (texture.width != draw_tile.params.size.x || texture.height != draw_tile.params.size.y) {
|
||||||
|
/* Resolution divider is different from 1, force nearest interpolation. */
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
}
|
||||||
|
else if (zoomed_width - draw_tile.params.size.x > 0.5f ||
|
||||||
|
zoomed_height - draw_tile.params.size.y > 0.5f) {
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
glVertexAttribPointer(
|
||||||
|
texcoord_attribute, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (const GLvoid *)0);
|
||||||
|
glVertexAttribPointer(position_attribute,
|
||||||
|
2,
|
||||||
|
GL_FLOAT,
|
||||||
|
GL_FALSE,
|
||||||
|
4 * sizeof(float),
|
||||||
|
(const GLvoid *)(sizeof(float) * 2));
|
||||||
|
|
||||||
|
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlenderDisplayDriver::flush()
|
||||||
|
{
|
||||||
|
/* This is called from the render thread that also calls update_begin/end, right before ending
|
||||||
|
* the render loop. We wait for any queued PBO and render commands to be done, before destroying
|
||||||
|
* the render thread and activating the context in the main thread to destroy resources.
|
||||||
|
*
|
||||||
|
* If we don't do this, the NVIDIA driver hangs for a few seconds for when ending 3D viewport
|
||||||
|
* rendering, for unknown reasons. This was found with NVIDIA driver version 470.73 and a Quadro
|
||||||
|
* RTX 6000 on Linux. */
|
||||||
|
if (!gl_context_enable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gl_upload_sync_) {
|
||||||
|
glWaitSync((GLsync)gl_upload_sync_, 0, GL_TIMEOUT_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gl_render_sync_) {
|
||||||
|
glWaitSync((GLsync)gl_render_sync_, 0, GL_TIMEOUT_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_context_disable();
|
||||||
|
}
|
||||||
|
|
||||||
void BlenderDisplayDriver::draw(const Params ¶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 (!gl_draw_resources_ensure()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (use_gl_context_) {
|
if (use_gl_context_) {
|
||||||
gl_context_mutex_.lock();
|
gl_context_mutex_.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_.need_clear) {
|
if (need_clear_) {
|
||||||
/* Texture is requested to be cleared and was not yet cleared.
|
/* Texture is requested to be cleared and was not yet cleared.
|
||||||
*
|
*
|
||||||
* Do early return which should be equivalent of drawing all-zero texture.
|
* 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
|
* Watch out for the lock though so that the clear happening during update is properly
|
||||||
* synchronized here. */
|
* synchronized here. */
|
||||||
gl_context_mutex_.unlock();
|
if (use_gl_context_) {
|
||||||
|
gl_context_mutex_.unlock();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,66 +939,37 @@ void BlenderDisplayDriver::draw(const Params ¶ms)
|
|||||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
display_shader_->bind(params.full_size.x, params.full_size.y);
|
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_.gl_id);
|
|
||||||
|
|
||||||
/* Trick to keep sharp rendering without jagged edges on all GPUs.
|
/* NOTE: The VAO is to be allocated on the drawing context as it is not shared across contexts.
|
||||||
*
|
* Simplest is to allocate it on every redraw so that it is possible to destroy it from a
|
||||||
* The idea here is to enforce driver to use linear interpolation when the image is not zoomed
|
* correct context. */
|
||||||
* in.
|
|
||||||
* For the render result with a resolution divider in effect we always use nearest interpolation.
|
|
||||||
*
|
|
||||||
* Use explicit MIN assignment to make sure the driver does not have an undefined behavior at
|
|
||||||
* the zoom level 1. The MAG filter is always NEAREST. */
|
|
||||||
const float zoomed_width = params.size.x * zoom_.x;
|
|
||||||
const float zoomed_height = params.size.y * zoom_.y;
|
|
||||||
if (texture_.width != params.size.x || texture_.height != params.size.y) {
|
|
||||||
/* Resolution divider is different from 1, force nearest interpolation. */
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
}
|
|
||||||
else if (zoomed_width - params.size.x > 0.5f || zoomed_height - params.size.y > 0.5f) {
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_);
|
|
||||||
|
|
||||||
texture_update_if_needed();
|
|
||||||
vertex_buffer_update(params);
|
|
||||||
|
|
||||||
/* TODO(sergey): Does it make sense/possible to cache/reuse the VAO? */
|
|
||||||
GLuint vertex_array_object;
|
GLuint vertex_array_object;
|
||||||
glGenVertexArrays(1, &vertex_array_object);
|
glGenVertexArrays(1, &vertex_array_object);
|
||||||
glBindVertexArray(vertex_array_object);
|
glBindVertexArray(vertex_array_object);
|
||||||
|
|
||||||
|
display_shader_->bind(params.full_size.x, params.full_size.y);
|
||||||
|
|
||||||
const int texcoord_attribute = display_shader_->get_tex_coord_attrib_location();
|
const int texcoord_attribute = display_shader_->get_tex_coord_attrib_location();
|
||||||
const int position_attribute = display_shader_->get_position_attrib_location();
|
const int position_attribute = display_shader_->get_position_attrib_location();
|
||||||
|
|
||||||
glEnableVertexAttribArray(texcoord_attribute);
|
glEnableVertexAttribArray(texcoord_attribute);
|
||||||
glEnableVertexAttribArray(position_attribute);
|
glEnableVertexAttribArray(position_attribute);
|
||||||
|
|
||||||
glVertexAttribPointer(
|
draw_tile(zoom_, texcoord_attribute, position_attribute, tiles_->current_tile.tile);
|
||||||
texcoord_attribute, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (const GLvoid *)0);
|
|
||||||
glVertexAttribPointer(position_attribute,
|
|
||||||
2,
|
|
||||||
GL_FLOAT,
|
|
||||||
GL_FALSE,
|
|
||||||
4 * sizeof(float),
|
|
||||||
(const GLvoid *)(sizeof(float) * 2));
|
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
for (const DrawTile &tile : tiles_->finished_tiles.tiles) {
|
||||||
|
draw_tile(zoom_, texcoord_attribute, position_attribute, tile);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
}
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
glDeleteVertexArrays(1, &vertex_array_object);
|
|
||||||
|
|
||||||
display_shader_->unbind();
|
display_shader_->unbind();
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
glBindVertexArray(0);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
|
||||||
|
glDeleteVertexArrays(1, &vertex_array_object);
|
||||||
|
|
||||||
if (transparent) {
|
if (transparent) {
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
}
|
}
|
||||||
@@ -544,6 +977,11 @@ void BlenderDisplayDriver::draw(const Params ¶ms)
|
|||||||
gl_render_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
gl_render_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|
||||||
|
if (VLOG_IS_ON(5)) {
|
||||||
|
VLOG(5) << "Number of textures: " << GLTexture::num_used;
|
||||||
|
VLOG(5) << "Number of PBOs: " << GLPixelBufferObject::num_used;
|
||||||
|
}
|
||||||
|
|
||||||
if (use_gl_context_) {
|
if (use_gl_context_) {
|
||||||
gl_context_mutex_.unlock();
|
gl_context_mutex_.unlock();
|
||||||
}
|
}
|
||||||
@@ -618,154 +1056,16 @@ void BlenderDisplayDriver::gl_context_dispose()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlenderDisplayDriver::gl_draw_resources_ensure()
|
|
||||||
{
|
|
||||||
if (!texture_.gl_id) {
|
|
||||||
/* If there is no texture allocated, there is nothing to draw. Inform the draw call that it can
|
|
||||||
* can not continue. Note that this is not an unrecoverable error, so once the texture is known
|
|
||||||
* we will come back here and create all the GPU resources needed for draw. */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gl_draw_resource_creation_attempted_) {
|
|
||||||
return gl_draw_resources_created_;
|
|
||||||
}
|
|
||||||
gl_draw_resource_creation_attempted_ = true;
|
|
||||||
|
|
||||||
if (!vertex_buffer_) {
|
|
||||||
glGenBuffers(1, &vertex_buffer_);
|
|
||||||
if (!vertex_buffer_) {
|
|
||||||
LOG(ERROR) << "Error creating vertex buffer.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_draw_resources_created_ = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderDisplayDriver::gl_resources_destroy()
|
void BlenderDisplayDriver::gl_resources_destroy()
|
||||||
{
|
{
|
||||||
gl_context_enable();
|
gl_context_enable();
|
||||||
|
|
||||||
if (vertex_buffer_ != 0) {
|
tiles_->current_tile.gl_resources_destroy();
|
||||||
glDeleteBuffers(1, &vertex_buffer_);
|
tiles_->finished_tiles.gl_resources_destroy_and_clear();
|
||||||
}
|
|
||||||
|
|
||||||
if (texture_.gl_pbo_id) {
|
|
||||||
glDeleteBuffers(1, &texture_.gl_pbo_id);
|
|
||||||
texture_.gl_pbo_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture_.gl_id) {
|
|
||||||
glDeleteTextures(1, &texture_.gl_id);
|
|
||||||
texture_.gl_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_context_disable();
|
gl_context_disable();
|
||||||
|
|
||||||
gl_context_dispose();
|
gl_context_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlenderDisplayDriver::gl_texture_resources_ensure()
|
|
||||||
{
|
|
||||||
if (texture_.creation_attempted) {
|
|
||||||
return texture_.is_created;
|
|
||||||
}
|
|
||||||
texture_.creation_attempted = true;
|
|
||||||
|
|
||||||
DCHECK(!texture_.gl_id);
|
|
||||||
DCHECK(!texture_.gl_pbo_id);
|
|
||||||
|
|
||||||
/* Create texture. */
|
|
||||||
glGenTextures(1, &texture_.gl_id);
|
|
||||||
if (!texture_.gl_id) {
|
|
||||||
LOG(ERROR) << "Error creating texture.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Configure the texture. */
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_.gl_id);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
/* Create PBO for the texture. */
|
|
||||||
glGenBuffers(1, &texture_.gl_pbo_id);
|
|
||||||
if (!texture_.gl_pbo_id) {
|
|
||||||
LOG(ERROR) << "Error creating texture pixel buffer object.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Creation finished with a success. */
|
|
||||||
texture_.is_created = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderDisplayDriver::texture_update_if_needed()
|
|
||||||
{
|
|
||||||
if (!texture_.need_update) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture_.gl_pbo_id);
|
|
||||||
glTexSubImage2D(
|
|
||||||
GL_TEXTURE_2D, 0, 0, 0, texture_.width, texture_.height, GL_RGBA, GL_HALF_FLOAT, 0);
|
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
|
||||||
|
|
||||||
texture_.need_update = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
* rendered. */
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STREAM_DRAW);
|
|
||||||
|
|
||||||
float *vpointer = reinterpret_cast<float *>(glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY));
|
|
||||||
if (!vpointer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
vpointer[0] = 0.0f;
|
|
||||||
vpointer[1] = 0.0f;
|
|
||||||
vpointer[2] = x;
|
|
||||||
vpointer[3] = y;
|
|
||||||
|
|
||||||
vpointer[4] = 1.0f;
|
|
||||||
vpointer[5] = 0.0f;
|
|
||||||
vpointer[6] = x + width;
|
|
||||||
vpointer[7] = y;
|
|
||||||
|
|
||||||
vpointer[8] = 1.0f;
|
|
||||||
vpointer[9] = 1.0f;
|
|
||||||
vpointer[10] = x + width;
|
|
||||||
vpointer[11] = y + height;
|
|
||||||
|
|
||||||
vpointer[12] = 0.0f;
|
|
||||||
vpointer[13] = 1.0f;
|
|
||||||
vpointer[14] = x;
|
|
||||||
vpointer[15] = y + height;
|
|
||||||
|
|
||||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
|
||||||
}
|
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "util/thread.h"
|
#include "util/thread.h"
|
||||||
#include "util/unique_ptr.h"
|
#include "util/unique_ptr.h"
|
||||||
|
#include "util/vector.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -112,6 +113,8 @@ class BlenderDisplayDriver : public DisplayDriver {
|
|||||||
void set_zoom(float zoom_x, float zoom_y);
|
void set_zoom(float zoom_x, float zoom_y);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void next_tile_begin() override;
|
||||||
|
|
||||||
virtual bool update_begin(const Params ¶ms, int texture_width, int texture_height) override;
|
virtual bool update_begin(const Params ¶ms, int texture_width, int texture_height) override;
|
||||||
virtual void update_end() override;
|
virtual void update_end() override;
|
||||||
|
|
||||||
@@ -122,33 +125,17 @@ class BlenderDisplayDriver : public DisplayDriver {
|
|||||||
|
|
||||||
virtual void draw(const Params ¶ms) override;
|
virtual void draw(const Params ¶ms) override;
|
||||||
|
|
||||||
|
virtual void flush() override;
|
||||||
|
|
||||||
/* Helper function which allocates new GPU context. */
|
/* Helper function which allocates new GPU context. */
|
||||||
void gl_context_create();
|
void gl_context_create();
|
||||||
bool gl_context_enable();
|
bool gl_context_enable();
|
||||||
void gl_context_disable();
|
void gl_context_disable();
|
||||||
void gl_context_dispose();
|
void gl_context_dispose();
|
||||||
|
|
||||||
/* Make sure texture is allocated and its initial configuration is performed. */
|
|
||||||
bool gl_texture_resources_ensure();
|
|
||||||
|
|
||||||
/* Ensure all runtime GPU resources needed for drawing are allocated.
|
|
||||||
* Returns true if all resources needed for drawing are available. */
|
|
||||||
bool gl_draw_resources_ensure();
|
|
||||||
|
|
||||||
/* Destroy all GPU resources which are being used by this object. */
|
/* Destroy all GPU resources which are being used by this object. */
|
||||||
void gl_resources_destroy();
|
void gl_resources_destroy();
|
||||||
|
|
||||||
/* Update GPU texture dimensions and content if needed (new pixel data was provided).
|
|
||||||
*
|
|
||||||
* NOTE: The texture needs to be bound. */
|
|
||||||
void texture_update_if_needed();
|
|
||||||
|
|
||||||
/* Update vertex buffer with new coordinates of vertex positions and texture coordinates.
|
|
||||||
* This buffer is used to render texture in the viewport.
|
|
||||||
*
|
|
||||||
* NOTE: The buffer needs to be bound. */
|
|
||||||
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. */
|
||||||
@@ -159,50 +146,14 @@ class BlenderDisplayDriver : public DisplayDriver {
|
|||||||
/* Mutex used to guard the `gl_context_`. */
|
/* Mutex used to guard the `gl_context_`. */
|
||||||
thread_mutex gl_context_mutex_;
|
thread_mutex gl_context_mutex_;
|
||||||
|
|
||||||
/* Texture which contains pixels of the render result. */
|
/* Content of the display is to be filled with zeroes. */
|
||||||
struct {
|
std::atomic<bool> need_clear_ = true;
|
||||||
/* Indicates whether texture creation was attempted and succeeded.
|
|
||||||
* Used to avoid multiple attempts of texture creation on GPU issues or GPU context
|
|
||||||
* misconfiguration. */
|
|
||||||
bool creation_attempted = false;
|
|
||||||
bool is_created = false;
|
|
||||||
|
|
||||||
/* OpenGL resource IDs of the texture itself and Pixel Buffer Object (PBO) used to write
|
|
||||||
* pixels to it.
|
|
||||||
*
|
|
||||||
* NOTE: Allocated on the engine's context. */
|
|
||||||
uint gl_id = 0;
|
|
||||||
uint gl_pbo_id = 0;
|
|
||||||
|
|
||||||
/* Is true when new data was written to the PBO, meaning, the texture might need to be resized
|
|
||||||
* and new data is to be uploaded to the GPU. */
|
|
||||||
bool need_update = false;
|
|
||||||
|
|
||||||
/* Content of the texture is to be filled with zeroes. */
|
|
||||||
std::atomic<bool> need_clear = true;
|
|
||||||
|
|
||||||
/* Dimensions of the texture in pixels. */
|
|
||||||
int width = 0;
|
|
||||||
int height = 0;
|
|
||||||
|
|
||||||
/* Dimensions of the underlying PBO. */
|
|
||||||
int buffer_width = 0;
|
|
||||||
int buffer_height = 0;
|
|
||||||
|
|
||||||
/* Display parameters the texture has been updated for. */
|
|
||||||
Params params;
|
|
||||||
} texture_;
|
|
||||||
|
|
||||||
unique_ptr<BlenderDisplayShader> display_shader_;
|
unique_ptr<BlenderDisplayShader> display_shader_;
|
||||||
|
|
||||||
/* Special track of whether GPU resources were attempted to be created, to avoid attempts of
|
/* Opaque storage for an internal state and data for tiles. */
|
||||||
* their re-creation on failure on every redraw. */
|
struct Tiles;
|
||||||
bool gl_draw_resource_creation_attempted_ = false;
|
unique_ptr<Tiles> tiles_;
|
||||||
bool gl_draw_resources_created_ = false;
|
|
||||||
|
|
||||||
/* Vertex buffer which hold vertices of a triangle fan which is textures with the texture
|
|
||||||
* holding the render result. */
|
|
||||||
uint vertex_buffer_ = 0;
|
|
||||||
|
|
||||||
void *gl_render_sync_ = nullptr;
|
void *gl_render_sync_ = nullptr;
|
||||||
void *gl_upload_sync_ = nullptr;
|
void *gl_upload_sync_ = nullptr;
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include "scene/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "scene/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "scene/object.h"
|
#include "scene/object.h"
|
||||||
|
#include "scene/pointcloud.h"
|
||||||
#include "scene/volume.h"
|
#include "scene/volume.h"
|
||||||
|
|
||||||
#include "blender/sync.h"
|
#include "blender/sync.h"
|
||||||
@@ -31,10 +32,18 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
static Geometry::Type determine_geom_type(BObjectInfo &b_ob_info, bool use_particle_hair)
|
static Geometry::Type determine_geom_type(BObjectInfo &b_ob_info, bool use_particle_hair)
|
||||||
{
|
{
|
||||||
|
#ifdef WITH_HAIR_NODES
|
||||||
if (b_ob_info.object_data.is_a(&RNA_Hair) || use_particle_hair) {
|
if (b_ob_info.object_data.is_a(&RNA_Hair) || use_particle_hair) {
|
||||||
|
#else
|
||||||
|
if (use_particle_hair) {
|
||||||
|
#endif
|
||||||
return Geometry::HAIR;
|
return Geometry::HAIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (b_ob_info.object_data.is_a(&RNA_PointCloud)) {
|
||||||
|
return Geometry::POINTCLOUD;
|
||||||
|
}
|
||||||
|
|
||||||
if (b_ob_info.object_data.is_a(&RNA_Volume) ||
|
if (b_ob_info.object_data.is_a(&RNA_Volume) ||
|
||||||
(b_ob_info.object_data == b_ob_info.real_object.data() &&
|
(b_ob_info.object_data == b_ob_info.real_object.data() &&
|
||||||
object_fluid_gas_domain_find(b_ob_info.real_object))) {
|
object_fluid_gas_domain_find(b_ob_info.real_object))) {
|
||||||
@@ -107,6 +116,9 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
|||||||
else if (geom_type == Geometry::VOLUME) {
|
else if (geom_type == Geometry::VOLUME) {
|
||||||
geom = scene->create_node<Volume>();
|
geom = scene->create_node<Volume>();
|
||||||
}
|
}
|
||||||
|
else if (geom_type == Geometry::POINTCLOUD) {
|
||||||
|
geom = scene->create_node<PointCloud>();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
geom = scene->create_node<Mesh>();
|
geom = scene->create_node<Mesh>();
|
||||||
}
|
}
|
||||||
@@ -166,6 +178,10 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
|||||||
Volume *volume = static_cast<Volume *>(geom);
|
Volume *volume = static_cast<Volume *>(geom);
|
||||||
sync_volume(b_ob_info, volume);
|
sync_volume(b_ob_info, volume);
|
||||||
}
|
}
|
||||||
|
else if (geom_type == Geometry::POINTCLOUD) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
sync_pointcloud(pointcloud, b_ob_info);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||||
sync_mesh(b_depsgraph, b_ob_info, mesh);
|
sync_mesh(b_depsgraph, b_ob_info, mesh);
|
||||||
@@ -215,7 +231,11 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
|
|||||||
if (progress.get_cancel())
|
if (progress.get_cancel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef WITH_HAIR_NODES
|
||||||
if (b_ob_info.object_data.is_a(&RNA_Hair) || use_particle_hair) {
|
if (b_ob_info.object_data.is_a(&RNA_Hair) || use_particle_hair) {
|
||||||
|
#else
|
||||||
|
if (use_particle_hair) {
|
||||||
|
#endif
|
||||||
Hair *hair = static_cast<Hair *>(geom);
|
Hair *hair = static_cast<Hair *>(geom);
|
||||||
sync_hair_motion(b_depsgraph, b_ob_info, hair, motion_step);
|
sync_hair_motion(b_depsgraph, b_ob_info, hair, motion_step);
|
||||||
}
|
}
|
||||||
@@ -223,6 +243,10 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
|
|||||||
object_fluid_gas_domain_find(b_ob_info.real_object)) {
|
object_fluid_gas_domain_find(b_ob_info.real_object)) {
|
||||||
/* No volume motion blur support yet. */
|
/* No volume motion blur support yet. */
|
||||||
}
|
}
|
||||||
|
else if (b_ob_info.object_data.is_a(&RNA_PointCloud)) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
sync_pointcloud_motion(pointcloud, b_ob_info, motion_step);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||||
sync_mesh_motion(b_depsgraph, b_ob_info, mesh, motion_step);
|
sync_mesh_motion(b_depsgraph, b_ob_info, mesh, motion_step);
|
||||||
|
@@ -24,8 +24,14 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
/* Packed Images */
|
/* Packed Images */
|
||||||
|
|
||||||
BlenderImageLoader::BlenderImageLoader(BL::Image b_image, int frame)
|
BlenderImageLoader::BlenderImageLoader(BL::Image b_image,
|
||||||
: b_image(b_image), frame(frame), free_cache(!b_image.has_data())
|
const int frame,
|
||||||
|
const bool is_preview_render)
|
||||||
|
: b_image(b_image),
|
||||||
|
frame(frame),
|
||||||
|
/* Don't free cache for preview render to avoid race condition from T93560, to be fixed
|
||||||
|
properly later as we are close to release. */
|
||||||
|
free_cache(!is_preview_render && !b_image.has_data())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
class BlenderImageLoader : public ImageLoader {
|
class BlenderImageLoader : public ImageLoader {
|
||||||
public:
|
public:
|
||||||
BlenderImageLoader(BL::Image b_image, int frame);
|
BlenderImageLoader(BL::Image b_image, const int frame, const bool is_preview_render);
|
||||||
|
|
||||||
bool load_metadata(const ImageDeviceFeatures &features, ImageMetaData &metadata) override;
|
bool load_metadata(const ImageDeviceFeatures &features, ImageMetaData &metadata) override;
|
||||||
bool load_pixels(const ImageMetaData &metadata,
|
bool load_pixels(const ImageMetaData &metadata,
|
||||||
|
@@ -1071,7 +1071,15 @@ static void create_subd_mesh(Scene *scene,
|
|||||||
|
|
||||||
for (BL::MeshEdge &e : b_mesh.edges) {
|
for (BL::MeshEdge &e : b_mesh.edges) {
|
||||||
if (e.crease() != 0.0f) {
|
if (e.crease() != 0.0f) {
|
||||||
mesh->add_crease(e.vertices()[0], e.vertices()[1], e.crease());
|
mesh->add_edge_crease(e.vertices()[0], e.vertices()[1], e.crease());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BL::MeshVertexCreaseLayer &c : b_mesh.vertex_creases) {
|
||||||
|
for (int i = 0; i < c.data.length(); ++i) {
|
||||||
|
if (c.data[i].value() != 0.0f) {
|
||||||
|
mesh->add_vertex_crease(i, c.data[i].value());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1086,40 +1094,6 @@ static void create_subd_mesh(Scene *scene,
|
|||||||
|
|
||||||
/* Sync */
|
/* Sync */
|
||||||
|
|
||||||
/* Check whether some of "built-in" motion-related attributes are needed to be exported (includes
|
|
||||||
* things like velocity from cache modifier, fluid simulation).
|
|
||||||
*
|
|
||||||
* NOTE: This code is run prior to object motion blur initialization. so can not access properties
|
|
||||||
* set by `sync_object_motion_init()`. */
|
|
||||||
static bool mesh_need_motion_attribute(BObjectInfo &b_ob_info, Scene *scene)
|
|
||||||
{
|
|
||||||
const Scene::MotionType need_motion = scene->need_motion();
|
|
||||||
if (need_motion == Scene::MOTION_NONE) {
|
|
||||||
/* Simple case: neither motion pass nor motion blur is needed, no need in the motion related
|
|
||||||
* attributes. */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_motion == Scene::MOTION_BLUR) {
|
|
||||||
/* A bit tricky and implicit case:
|
|
||||||
* - Motion blur is enabled in the scene, which implies specific number of time steps for
|
|
||||||
* objects.
|
|
||||||
* - If the object has motion blur disabled on it, it will have 0 time steps.
|
|
||||||
* - Motion attribute expects non-zero time steps.
|
|
||||||
*
|
|
||||||
* Avoid adding motion attributes if the motion blur will enforce 0 motion steps. */
|
|
||||||
PointerRNA cobject = RNA_pointer_get(&b_ob_info.real_object.ptr, "cycles");
|
|
||||||
const bool use_motion = get_boolean(cobject, "use_motion_blur");
|
|
||||||
if (!use_motion) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Motion pass which implies 3 motion steps, or motion blur which is not disabled on object
|
|
||||||
* level. */
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, Mesh *mesh)
|
void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, Mesh *mesh)
|
||||||
{
|
{
|
||||||
/* make a copy of the shaders as the caller in the main thread still need them for syncing the
|
/* make a copy of the shaders as the caller in the main thread still need them for syncing the
|
||||||
@@ -1144,7 +1118,7 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, M
|
|||||||
|
|
||||||
if (b_mesh) {
|
if (b_mesh) {
|
||||||
/* Motion blur attribute is relative to seconds, we need it relative to frames. */
|
/* Motion blur attribute is relative to seconds, we need it relative to frames. */
|
||||||
const bool need_motion = mesh_need_motion_attribute(b_ob_info, scene);
|
const bool need_motion = object_need_motion_attribute(b_ob_info, scene);
|
||||||
const float motion_scale = (need_motion) ?
|
const float motion_scale = (need_motion) ?
|
||||||
scene->motion_shutter_time() /
|
scene->motion_shutter_time() /
|
||||||
(b_scene.render().fps() / b_scene.render().fps_base()) :
|
(b_scene.render().fps() / b_scene.render().fps_base()) :
|
||||||
|
@@ -72,7 +72,8 @@ bool BlenderSync::object_is_geometry(BObjectInfo &b_ob_info)
|
|||||||
|
|
||||||
BL::Object::type_enum type = b_ob_info.iter_object.type();
|
BL::Object::type_enum type = b_ob_info.iter_object.type();
|
||||||
|
|
||||||
if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR) {
|
if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR ||
|
||||||
|
type == BL::Object::type_POINTCLOUD) {
|
||||||
/* Will be exported attached to mesh. */
|
/* Will be exported attached to mesh. */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -206,7 +207,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only interested in object that we can create meshes from */
|
/* only interested in object that we can create geometry from */
|
||||||
if (!object_is_geometry(b_ob_info)) {
|
if (!object_is_geometry(b_ob_info)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -528,6 +529,17 @@ void BlenderSync::sync_procedural(BL::Object &b_ob,
|
|||||||
string absolute_path = blender_absolute_path(b_data, b_ob, b_mesh_cache.cache_file().filepath());
|
string absolute_path = blender_absolute_path(b_data, b_ob, b_mesh_cache.cache_file().filepath());
|
||||||
procedural->set_filepath(ustring(absolute_path));
|
procedural->set_filepath(ustring(absolute_path));
|
||||||
|
|
||||||
|
array<ustring> layers;
|
||||||
|
for (BL::CacheFileLayer &layer : cache_file.layers) {
|
||||||
|
if (layer.hide_layer()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
absolute_path = blender_absolute_path(b_data, b_ob, layer.filepath());
|
||||||
|
layers.push_back_slow(ustring(absolute_path));
|
||||||
|
}
|
||||||
|
procedural->set_layers(layers);
|
||||||
|
|
||||||
procedural->set_scale(cache_file.scale());
|
procedural->set_scale(cache_file.scale());
|
||||||
|
|
||||||
procedural->set_use_prefetch(cache_file.use_prefetch());
|
procedural->set_use_prefetch(cache_file.use_prefetch());
|
||||||
|
@@ -51,8 +51,6 @@ bool BlenderOutputDriver::read_render_tile(const Tile &tile)
|
|||||||
|
|
||||||
BL::RenderLayer b_rlay = *b_single_rlay;
|
BL::RenderLayer b_rlay = *b_single_rlay;
|
||||||
|
|
||||||
vector<float> pixels(tile.size.x * tile.size.y * 4);
|
|
||||||
|
|
||||||
/* Copy each pass.
|
/* Copy each pass.
|
||||||
* TODO:copy only the required ones for better performance? */
|
* TODO:copy only the required ones for better performance? */
|
||||||
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
||||||
@@ -66,7 +64,7 @@ bool BlenderOutputDriver::read_render_tile(const Tile &tile)
|
|||||||
|
|
||||||
bool BlenderOutputDriver::update_render_tile(const Tile &tile)
|
bool BlenderOutputDriver::update_render_tile(const Tile &tile)
|
||||||
{
|
{
|
||||||
/* Use final write for preview renders, otherwise render result wouldn't be be updated
|
/* Use final write for preview renders, otherwise render result wouldn't be updated
|
||||||
* quickly on Blender side. For all other cases we use the display driver. */
|
* quickly on Blender side. For all other cases we use the display driver. */
|
||||||
if (b_engine_.is_preview()) {
|
if (b_engine_.is_preview()) {
|
||||||
write_render_tile(tile);
|
write_render_tile(tile);
|
||||||
@@ -109,7 +107,7 @@ void BlenderOutputDriver::write_render_tile(const Tile &tile)
|
|||||||
|
|
||||||
BL::RenderLayer b_rlay = *b_single_rlay;
|
BL::RenderLayer b_rlay = *b_single_rlay;
|
||||||
|
|
||||||
vector<float> pixels(tile.size.x * tile.size.y * 4);
|
vector<float> pixels(static_cast<size_t>(tile.size.x) * tile.size.y * 4);
|
||||||
|
|
||||||
/* Copy each pass. */
|
/* Copy each pass. */
|
||||||
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
||||||
@@ -120,7 +118,7 @@ void BlenderOutputDriver::write_render_tile(const Tile &tile)
|
|||||||
b_pass.rect(&pixels[0]);
|
b_pass.rect(&pixels[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
b_engine_.end_result(b_rr, true, false, true);
|
b_engine_.end_result(b_rr, false, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
303
intern/cycles/blender/pointcloud.cpp
Normal file
303
intern/cycles/blender/pointcloud.cpp
Normal file
@@ -0,0 +1,303 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011-2013 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 "scene/pointcloud.h"
|
||||||
|
#include "scene/attribute.h"
|
||||||
|
#include "scene/scene.h"
|
||||||
|
|
||||||
|
#include "blender/sync.h"
|
||||||
|
#include "blender/util.h"
|
||||||
|
|
||||||
|
#include "util/foreach.h"
|
||||||
|
#include "util/hash.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
template<typename TypeInCycles, typename GetValueAtIndex>
|
||||||
|
static void fill_generic_attribute(BL::PointCloud &b_pointcloud,
|
||||||
|
TypeInCycles *data,
|
||||||
|
const GetValueAtIndex &get_value_at_index)
|
||||||
|
{
|
||||||
|
const int num_points = b_pointcloud.points.length();
|
||||||
|
for (int i = 0; i < num_points; i++) {
|
||||||
|
data[i] = get_value_at_index(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void attr_create_motion(PointCloud *pointcloud,
|
||||||
|
BL::Attribute &b_attribute,
|
||||||
|
const float motion_scale)
|
||||||
|
{
|
||||||
|
if (!(b_attribute.domain() == BL::Attribute::domain_POINT) &&
|
||||||
|
(b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BL::FloatVectorAttribute b_vector_attribute(b_attribute);
|
||||||
|
const int num_points = pointcloud->get_points().size();
|
||||||
|
|
||||||
|
/* Find or add attribute */
|
||||||
|
float3 *P = &pointcloud->get_points()[0];
|
||||||
|
Attribute *attr_mP = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
|
||||||
|
if (!attr_mP) {
|
||||||
|
attr_mP = pointcloud->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Only export previous and next frame, we don't have any in between data. */
|
||||||
|
float motion_times[2] = {-1.0f, 1.0f};
|
||||||
|
for (int step = 0; step < 2; step++) {
|
||||||
|
const float relative_time = motion_times[step] * 0.5f * motion_scale;
|
||||||
|
float3 *mP = attr_mP->data_float3() + step * num_points;
|
||||||
|
|
||||||
|
for (int i = 0; i < num_points; i++) {
|
||||||
|
mP[i] = P[i] + get_float3(b_vector_attribute.data[i].vector()) * relative_time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void copy_attributes(PointCloud *pointcloud,
|
||||||
|
BL::PointCloud b_pointcloud,
|
||||||
|
const bool need_motion,
|
||||||
|
const float motion_scale)
|
||||||
|
{
|
||||||
|
AttributeSet &attributes = pointcloud->attributes;
|
||||||
|
static const ustring u_velocity("velocity");
|
||||||
|
for (BL::Attribute &b_attribute : b_pointcloud.attributes) {
|
||||||
|
const ustring name{b_attribute.name().c_str()};
|
||||||
|
|
||||||
|
if (need_motion && name == u_velocity) {
|
||||||
|
attr_create_motion(pointcloud, b_attribute, motion_scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attributes.find(name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AttributeElement element = ATTR_ELEMENT_VERTEX;
|
||||||
|
const BL::Attribute::data_type_enum b_data_type = b_attribute.data_type();
|
||||||
|
switch (b_data_type) {
|
||||||
|
case BL::Attribute::data_type_FLOAT: {
|
||||||
|
BL::FloatAttribute b_float_attribute{b_attribute};
|
||||||
|
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||||
|
float *data = attr->data_float();
|
||||||
|
fill_generic_attribute(
|
||||||
|
b_pointcloud, data, [&](int i) { return b_float_attribute.data[i].value(); });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BL::Attribute::data_type_BOOLEAN: {
|
||||||
|
BL::BoolAttribute b_bool_attribute{b_attribute};
|
||||||
|
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||||
|
float *data = attr->data_float();
|
||||||
|
fill_generic_attribute(
|
||||||
|
b_pointcloud, data, [&](int i) { return (float)b_bool_attribute.data[i].value(); });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BL::Attribute::data_type_INT: {
|
||||||
|
BL::IntAttribute b_int_attribute{b_attribute};
|
||||||
|
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||||
|
float *data = attr->data_float();
|
||||||
|
fill_generic_attribute(
|
||||||
|
b_pointcloud, data, [&](int i) { return (float)b_int_attribute.data[i].value(); });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BL::Attribute::data_type_FLOAT_VECTOR: {
|
||||||
|
BL::FloatVectorAttribute b_vector_attribute{b_attribute};
|
||||||
|
Attribute *attr = attributes.add(name, TypeVector, element);
|
||||||
|
float3 *data = attr->data_float3();
|
||||||
|
fill_generic_attribute(b_pointcloud, data, [&](int i) {
|
||||||
|
BL::Array<float, 3> v = b_vector_attribute.data[i].vector();
|
||||||
|
return make_float3(v[0], v[1], v[2]);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BL::Attribute::data_type_FLOAT_COLOR: {
|
||||||
|
BL::FloatColorAttribute b_color_attribute{b_attribute};
|
||||||
|
Attribute *attr = attributes.add(name, TypeRGBA, element);
|
||||||
|
float4 *data = attr->data_float4();
|
||||||
|
fill_generic_attribute(b_pointcloud, data, [&](int i) {
|
||||||
|
BL::Array<float, 4> v = b_color_attribute.data[i].color();
|
||||||
|
return make_float4(v[0], v[1], v[2], v[3]);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BL::Attribute::data_type_FLOAT2: {
|
||||||
|
BL::Float2Attribute b_float2_attribute{b_attribute};
|
||||||
|
Attribute *attr = attributes.add(name, TypeFloat2, element);
|
||||||
|
float2 *data = attr->data_float2();
|
||||||
|
fill_generic_attribute(b_pointcloud, data, [&](int i) {
|
||||||
|
BL::Array<float, 2> v = b_float2_attribute.data[i].vector();
|
||||||
|
return make_float2(v[0], v[1]);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
/* Not supported. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void export_pointcloud(Scene *scene,
|
||||||
|
PointCloud *pointcloud,
|
||||||
|
BL::PointCloud b_pointcloud,
|
||||||
|
const bool need_motion,
|
||||||
|
const float motion_scale)
|
||||||
|
{
|
||||||
|
/* TODO: optimize so we can straight memcpy arrays from Blender? */
|
||||||
|
|
||||||
|
/* Add requested attributes. */
|
||||||
|
Attribute *attr_random = NULL;
|
||||||
|
if (pointcloud->need_attribute(scene, ATTR_STD_POINT_RANDOM)) {
|
||||||
|
attr_random = pointcloud->attributes.add(ATTR_STD_POINT_RANDOM);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reserve memory. */
|
||||||
|
const int num_points = b_pointcloud.points.length();
|
||||||
|
pointcloud->reserve(num_points);
|
||||||
|
|
||||||
|
/* Export points. */
|
||||||
|
BL::PointCloud::points_iterator b_point_iter;
|
||||||
|
for (b_pointcloud.points.begin(b_point_iter); b_point_iter != b_pointcloud.points.end();
|
||||||
|
++b_point_iter) {
|
||||||
|
BL::Point b_point = *b_point_iter;
|
||||||
|
const float3 co = get_float3(b_point.co());
|
||||||
|
const float radius = b_point.radius();
|
||||||
|
pointcloud->add_point(co, radius);
|
||||||
|
|
||||||
|
/* Random number per point. */
|
||||||
|
if (attr_random != NULL) {
|
||||||
|
attr_random->add(hash_uint2_to_float(b_point.index(), 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Export attributes */
|
||||||
|
copy_attributes(pointcloud, b_pointcloud, need_motion, motion_scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void export_pointcloud_motion(PointCloud *pointcloud,
|
||||||
|
BL::PointCloud b_pointcloud,
|
||||||
|
int motion_step)
|
||||||
|
{
|
||||||
|
/* Find or add attribute. */
|
||||||
|
Attribute *attr_mP = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
bool new_attribute = false;
|
||||||
|
|
||||||
|
if (!attr_mP) {
|
||||||
|
attr_mP = pointcloud->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
new_attribute = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Export motion points. */
|
||||||
|
const int num_points = pointcloud->num_points();
|
||||||
|
float3 *mP = attr_mP->data_float3() + motion_step * num_points;
|
||||||
|
bool have_motion = false;
|
||||||
|
int num_motion_points = 0;
|
||||||
|
const array<float3> &pointcloud_points = pointcloud->get_points();
|
||||||
|
|
||||||
|
BL::PointCloud::points_iterator b_point_iter;
|
||||||
|
for (b_pointcloud.points.begin(b_point_iter); b_point_iter != b_pointcloud.points.end();
|
||||||
|
++b_point_iter) {
|
||||||
|
BL::Point b_point = *b_point_iter;
|
||||||
|
|
||||||
|
if (num_motion_points < num_points) {
|
||||||
|
float3 P = get_float3(b_point.co());
|
||||||
|
P.w = b_point.radius();
|
||||||
|
mP[num_motion_points] = P;
|
||||||
|
have_motion = have_motion || (P != pointcloud_points[num_motion_points]);
|
||||||
|
num_motion_points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* In case of new attribute, we verify if there really was any motion. */
|
||||||
|
if (new_attribute) {
|
||||||
|
if (num_motion_points != num_points || !have_motion) {
|
||||||
|
pointcloud->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
}
|
||||||
|
else if (motion_step > 0) {
|
||||||
|
/* Motion, fill up previous steps that we might have skipped because
|
||||||
|
* they had no motion, but we need them anyway now. */
|
||||||
|
for (int step = 0; step < motion_step; step++) {
|
||||||
|
pointcloud->copy_center_to_motion_step(step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Export attributes */
|
||||||
|
copy_attributes(pointcloud, b_pointcloud, false, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlenderSync::sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info)
|
||||||
|
{
|
||||||
|
size_t old_numpoints = pointcloud->num_points();
|
||||||
|
|
||||||
|
array<Node *> used_shaders = pointcloud->get_used_shaders();
|
||||||
|
|
||||||
|
PointCloud new_pointcloud;
|
||||||
|
new_pointcloud.set_used_shaders(used_shaders);
|
||||||
|
|
||||||
|
/* TODO: add option to filter out points in the view layer. */
|
||||||
|
BL::PointCloud b_pointcloud(b_ob_info.object_data);
|
||||||
|
/* Motion blur attribute is relative to seconds, we need it relative to frames. */
|
||||||
|
const bool need_motion = object_need_motion_attribute(b_ob_info, scene);
|
||||||
|
const float motion_scale = (need_motion) ?
|
||||||
|
scene->motion_shutter_time() /
|
||||||
|
(b_scene.render().fps() / b_scene.render().fps_base()) :
|
||||||
|
0.0f;
|
||||||
|
export_pointcloud(scene, &new_pointcloud, b_pointcloud, need_motion, motion_scale);
|
||||||
|
|
||||||
|
/* update original sockets */
|
||||||
|
for (const SocketType &socket : new_pointcloud.type->inputs) {
|
||||||
|
/* Those sockets are updated in sync_object, so do not modify them. */
|
||||||
|
if (socket.name == "use_motion_blur" || socket.name == "motion_steps" ||
|
||||||
|
socket.name == "used_shaders") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pointcloud->set_value(socket, new_pointcloud, socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
pointcloud->attributes.clear();
|
||||||
|
foreach (Attribute &attr, new_pointcloud.attributes.attributes) {
|
||||||
|
pointcloud->attributes.attributes.push_back(std::move(attr));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* tag update */
|
||||||
|
const bool rebuild = (pointcloud && old_numpoints != pointcloud->num_points());
|
||||||
|
pointcloud->tag_update(scene, rebuild);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlenderSync::sync_pointcloud_motion(PointCloud *pointcloud,
|
||||||
|
BObjectInfo &b_ob_info,
|
||||||
|
int motion_step)
|
||||||
|
{
|
||||||
|
/* Skip if nothing exported. */
|
||||||
|
if (pointcloud->num_points() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Export deformed coordinates. */
|
||||||
|
if (ccl::BKE_object_is_deform_modified(b_ob_info, b_scene, preview)) {
|
||||||
|
/* PointCloud object. */
|
||||||
|
BL::PointCloud b_pointcloud(b_ob_info.object_data);
|
||||||
|
export_pointcloud_motion(pointcloud, b_pointcloud, motion_step);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* No deformation on this frame, copy coordinates if other frames did have it. */
|
||||||
|
pointcloud->copy_center_to_motion_step(motion_step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
@@ -138,20 +138,18 @@ static const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
|
|||||||
|
|
||||||
static PyObject *init_func(PyObject * /*self*/, PyObject *args)
|
static PyObject *init_func(PyObject * /*self*/, PyObject *args)
|
||||||
{
|
{
|
||||||
PyObject *path, *user_path, *temp_path;
|
PyObject *path, *user_path;
|
||||||
int headless;
|
int headless;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "OOOi", &path, &user_path, &temp_path, &headless)) {
|
if (!PyArg_ParseTuple(args, "OOi", &path, &user_path, &headless)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *path_coerce = nullptr, *user_path_coerce = nullptr, *temp_path_coerce = nullptr;
|
PyObject *path_coerce = nullptr, *user_path_coerce = nullptr;
|
||||||
path_init(PyC_UnicodeAsByte(path, &path_coerce),
|
path_init(PyC_UnicodeAsByte(path, &path_coerce),
|
||||||
PyC_UnicodeAsByte(user_path, &user_path_coerce),
|
PyC_UnicodeAsByte(user_path, &user_path_coerce));
|
||||||
PyC_UnicodeAsByte(temp_path, &temp_path_coerce));
|
|
||||||
Py_XDECREF(path_coerce);
|
Py_XDECREF(path_coerce);
|
||||||
Py_XDECREF(user_path_coerce);
|
Py_XDECREF(user_path_coerce);
|
||||||
Py_XDECREF(temp_path_coerce);
|
|
||||||
|
|
||||||
BlenderSession::headless = headless;
|
BlenderSession::headless = headless;
|
||||||
|
|
||||||
@@ -735,27 +733,20 @@ static bool image_parse_filepaths(PyObject *pyfilepaths, vector<string> &filepat
|
|||||||
|
|
||||||
static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *keywords)
|
static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *keywords)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
(void)args;
|
|
||||||
(void)keywords;
|
|
||||||
#else
|
|
||||||
static const char *keyword_list[] = {
|
static const char *keyword_list[] = {
|
||||||
"preferences", "scene", "view_layer", "input", "output", "tile_size", "samples", NULL};
|
"preferences", "scene", "view_layer", "input", "output", NULL};
|
||||||
PyObject *pypreferences, *pyscene, *pyviewlayer;
|
PyObject *pypreferences, *pyscene, *pyviewlayer;
|
||||||
PyObject *pyinput, *pyoutput = NULL;
|
PyObject *pyinput, *pyoutput = NULL;
|
||||||
int tile_size = 0, samples = 0;
|
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args,
|
if (!PyArg_ParseTupleAndKeywords(args,
|
||||||
keywords,
|
keywords,
|
||||||
"OOOO|Oii",
|
"OOOO|O",
|
||||||
(char **)keyword_list,
|
(char **)keyword_list,
|
||||||
&pypreferences,
|
&pypreferences,
|
||||||
&pyscene,
|
&pyscene,
|
||||||
&pyviewlayer,
|
&pyviewlayer,
|
||||||
&pyinput,
|
&pyinput,
|
||||||
&pyoutput,
|
&pyoutput)) {
|
||||||
&tile_size,
|
|
||||||
&samples)) {
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -777,14 +768,10 @@ static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *key
|
|||||||
&RNA_ViewLayer,
|
&RNA_ViewLayer,
|
||||||
PyLong_AsVoidPtr(pyviewlayer),
|
PyLong_AsVoidPtr(pyviewlayer),
|
||||||
&viewlayerptr);
|
&viewlayerptr);
|
||||||
PointerRNA cviewlayer = RNA_pointer_get(&viewlayerptr, "cycles");
|
BL::ViewLayer b_view_layer(viewlayerptr);
|
||||||
|
|
||||||
DenoiseParams params;
|
DenoiseParams params = BlenderSync::get_denoise_params(b_scene, b_view_layer, true);
|
||||||
params.radius = get_int(cviewlayer, "denoising_radius");
|
params.use = true;
|
||||||
params.strength = get_float(cviewlayer, "denoising_strength");
|
|
||||||
params.feature_strength = get_float(cviewlayer, "denoising_feature_strength");
|
|
||||||
params.relative_pca = get_boolean(cviewlayer, "denoising_relative_pca");
|
|
||||||
params.neighbor_frames = get_int(cviewlayer, "denoising_neighbor_frames");
|
|
||||||
|
|
||||||
/* Parse file paths list. */
|
/* Parse file paths list. */
|
||||||
vector<string> input, output;
|
vector<string> input, output;
|
||||||
@@ -812,24 +799,15 @@ static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *key
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create denoiser. */
|
/* Create denoiser. */
|
||||||
DenoiserPipeline denoiser(device);
|
DenoiserPipeline denoiser(device, params);
|
||||||
denoiser.params = params;
|
|
||||||
denoiser.input = input;
|
denoiser.input = input;
|
||||||
denoiser.output = output;
|
denoiser.output = output;
|
||||||
|
|
||||||
if (tile_size > 0) {
|
|
||||||
denoiser.tile_size = make_int2(tile_size, tile_size);
|
|
||||||
}
|
|
||||||
if (samples > 0) {
|
|
||||||
denoiser.samples_override = samples;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Run denoiser. */
|
/* Run denoiser. */
|
||||||
if (!denoiser.run()) {
|
if (!denoiser.run()) {
|
||||||
PyErr_SetString(PyExc_ValueError, denoiser.error.c_str());
|
PyErr_SetString(PyExc_ValueError, denoiser.error.c_str());
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
@@ -906,16 +884,18 @@ 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, has_hip = false;
|
bool has_cuda = false, has_optix = false, has_hip = false, has_metal = 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);
|
has_hip |= (device_type == DEVICE_HIP);
|
||||||
|
has_metal |= (device_type == DEVICE_METAL);
|
||||||
}
|
}
|
||||||
PyObject *list = PyTuple_New(3);
|
PyObject *list = PyTuple_New(4);
|
||||||
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));
|
PyTuple_SET_ITEM(list, 2, PyBool_FromLong(has_hip));
|
||||||
|
PyTuple_SET_ITEM(list, 3, PyBool_FromLong(has_metal));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,6 +924,9 @@ static PyObject *set_device_override_func(PyObject * /*self*/, PyObject *arg)
|
|||||||
else if (override == "HIP") {
|
else if (override == "HIP") {
|
||||||
BlenderSession::device_override = DEVICE_MASK_HIP;
|
BlenderSession::device_override = DEVICE_MASK_HIP;
|
||||||
}
|
}
|
||||||
|
else if (override == "METAL") {
|
||||||
|
BlenderSession::device_override = DEVICE_MASK_METAL;
|
||||||
|
}
|
||||||
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;
|
||||||
@@ -1054,5 +1037,13 @@ void *CCL_python_module_init()
|
|||||||
Py_INCREF(Py_False);
|
Py_INCREF(Py_False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_CYCLES_DEBUG
|
||||||
|
PyModule_AddObject(mod, "with_debug", Py_True);
|
||||||
|
Py_INCREF(Py_True);
|
||||||
|
#else /* WITH_CYCLES_DEBUG */
|
||||||
|
PyModule_AddObject(mod, "with_debug", Py_False);
|
||||||
|
Py_INCREF(Py_False);
|
||||||
|
#endif /* WITH_CYCLES_DEBUG */
|
||||||
|
|
||||||
return (void *)mod;
|
return (void *)mod;
|
||||||
}
|
}
|
||||||
|
@@ -396,6 +396,13 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
|
|||||||
/* set the current view */
|
/* set the current view */
|
||||||
b_engine.active_view_set(b_rview_name.c_str());
|
b_engine.active_view_set(b_rview_name.c_str());
|
||||||
|
|
||||||
|
/* Force update in this case, since the camera transform on each frame changes
|
||||||
|
* in different views. This could be optimized by somehow storing the animated
|
||||||
|
* camera transforms separate from the fixed stereo transform. */
|
||||||
|
if ((scene->need_motion() != Scene::MOTION_NONE) && view_index > 0) {
|
||||||
|
sync->tag_update();
|
||||||
|
}
|
||||||
|
|
||||||
/* update scene */
|
/* update scene */
|
||||||
BL::Object b_camera_override(b_engine.camera_override());
|
BL::Object b_camera_override(b_engine.camera_override());
|
||||||
sync->sync_camera(b_render, b_camera_override, width, height, b_rview_name.c_str());
|
sync->sync_camera(b_render, b_camera_override, width, height, b_rview_name.c_str());
|
||||||
@@ -495,10 +502,15 @@ void BlenderSession::render_frame_finish()
|
|||||||
path_remove(filename);
|
path_remove(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear driver. */
|
/* Clear output driver. */
|
||||||
session->set_output_driver(nullptr);
|
session->set_output_driver(nullptr);
|
||||||
session->full_buffer_written_cb = function_null;
|
session->full_buffer_written_cb = function_null;
|
||||||
|
|
||||||
|
/* The display driver holds OpenGL resources which belong to an OpenGL context held by the render
|
||||||
|
* engine on Blender side. Force destruction of those resources. */
|
||||||
|
display_driver_ = nullptr;
|
||||||
|
session->set_display_driver(nullptr);
|
||||||
|
|
||||||
/* All the files are handled.
|
/* All the files are handled.
|
||||||
* Clear the list so that this session can be re-used by Persistent Data. */
|
* Clear the list so that this session can be re-used by Persistent Data. */
|
||||||
full_buffer_files_.clear();
|
full_buffer_files_.clear();
|
||||||
@@ -629,7 +641,7 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
|
|||||||
integrator->set_use_emission((bake_filter & BL::BakeSettings::pass_filter_EMIT) != 0);
|
integrator->set_use_emission((bake_filter & BL::BakeSettings::pass_filter_EMIT) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Always use transpanent background for baking. */
|
/* Always use transparent background for baking. */
|
||||||
scene->background->set_transparent(true);
|
scene->background->set_transparent(true);
|
||||||
|
|
||||||
/* Load built-in images from Blender. */
|
/* Load built-in images from Blender. */
|
||||||
|
@@ -378,10 +378,19 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
}
|
}
|
||||||
else if (b_node.is_a(&RNA_ShaderNodeMapRange)) {
|
else if (b_node.is_a(&RNA_ShaderNodeMapRange)) {
|
||||||
BL::ShaderNodeMapRange b_map_range_node(b_node);
|
BL::ShaderNodeMapRange b_map_range_node(b_node);
|
||||||
MapRangeNode *map_range_node = graph->create_node<MapRangeNode>();
|
if (b_map_range_node.data_type() == BL::ShaderNodeMapRange::data_type_FLOAT_VECTOR) {
|
||||||
map_range_node->set_clamp(b_map_range_node.clamp());
|
VectorMapRangeNode *vector_map_range_node = graph->create_node<VectorMapRangeNode>();
|
||||||
map_range_node->set_range_type((NodeMapRangeType)b_map_range_node.interpolation_type());
|
vector_map_range_node->set_use_clamp(b_map_range_node.clamp());
|
||||||
node = map_range_node;
|
vector_map_range_node->set_range_type(
|
||||||
|
(NodeMapRangeType)b_map_range_node.interpolation_type());
|
||||||
|
node = vector_map_range_node;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MapRangeNode *map_range_node = graph->create_node<MapRangeNode>();
|
||||||
|
map_range_node->set_clamp(b_map_range_node.clamp());
|
||||||
|
map_range_node->set_range_type((NodeMapRangeType)b_map_range_node.interpolation_type());
|
||||||
|
node = map_range_node;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (b_node.is_a(&RNA_ShaderNodeClamp)) {
|
else if (b_node.is_a(&RNA_ShaderNodeClamp)) {
|
||||||
BL::ShaderNodeClamp b_clamp_node(b_node);
|
BL::ShaderNodeClamp b_clamp_node(b_node);
|
||||||
@@ -680,6 +689,9 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
else if (b_node.is_a(&RNA_ShaderNodeHairInfo)) {
|
else if (b_node.is_a(&RNA_ShaderNodeHairInfo)) {
|
||||||
node = graph->create_node<HairInfoNode>();
|
node = graph->create_node<HairInfoNode>();
|
||||||
}
|
}
|
||||||
|
else if (b_node.is_a(&RNA_ShaderNodePointInfo)) {
|
||||||
|
node = graph->create_node<PointInfoNode>();
|
||||||
|
}
|
||||||
else if (b_node.is_a(&RNA_ShaderNodeVolumeInfo)) {
|
else if (b_node.is_a(&RNA_ShaderNodeVolumeInfo)) {
|
||||||
node = graph->create_node<VolumeInfoNode>();
|
node = graph->create_node<VolumeInfoNode>();
|
||||||
}
|
}
|
||||||
@@ -762,11 +774,12 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
int scene_frame = b_scene.frame_current();
|
int scene_frame = b_scene.frame_current();
|
||||||
int image_frame = image_user_frame_number(b_image_user, b_image, scene_frame);
|
int image_frame = image_user_frame_number(b_image_user, b_image, scene_frame);
|
||||||
image->handle = scene->image_manager->add_image(
|
image->handle = scene->image_manager->add_image(
|
||||||
new BlenderImageLoader(b_image, image_frame), image->image_params());
|
new BlenderImageLoader(b_image, image_frame, b_engine.is_preview()),
|
||||||
|
image->image_params());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ustring filename = ustring(
|
ustring filename = ustring(
|
||||||
image_user_file_path(b_image_user, b_image, b_scene.frame_current(), true));
|
image_user_file_path(b_image_user, b_image, b_scene.frame_current()));
|
||||||
image->set_filename(filename);
|
image->set_filename(filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -797,12 +810,13 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
if (is_builtin) {
|
if (is_builtin) {
|
||||||
int scene_frame = b_scene.frame_current();
|
int scene_frame = b_scene.frame_current();
|
||||||
int image_frame = image_user_frame_number(b_image_user, b_image, scene_frame);
|
int image_frame = image_user_frame_number(b_image_user, b_image, scene_frame);
|
||||||
env->handle = scene->image_manager->add_image(new BlenderImageLoader(b_image, image_frame),
|
env->handle = scene->image_manager->add_image(
|
||||||
env->image_params());
|
new BlenderImageLoader(b_image, image_frame, b_engine.is_preview()),
|
||||||
|
env->image_params());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
env->set_filename(
|
env->set_filename(
|
||||||
ustring(image_user_file_path(b_image_user, b_image, b_scene.frame_current(), false)));
|
ustring(image_user_file_path(b_image_user, b_image, b_scene.frame_current())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node = env;
|
node = env;
|
||||||
|
@@ -95,6 +95,11 @@ void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
|
|||||||
this->b_scene = b_scene;
|
this->b_scene = b_scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlenderSync::tag_update()
|
||||||
|
{
|
||||||
|
has_updates_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sync */
|
/* Sync */
|
||||||
|
|
||||||
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
||||||
@@ -782,6 +787,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene &b_scene, bool background)
|
|||||||
params.bvh_type = BVH_TYPE_DYNAMIC;
|
params.bvh_type = BVH_TYPE_DYNAMIC;
|
||||||
|
|
||||||
params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
|
params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
|
||||||
|
params.use_bvh_compact_structure = RNA_boolean_get(&cscene, "debug_use_compact_bvh");
|
||||||
params.use_bvh_unaligned_nodes = RNA_boolean_get(&cscene, "debug_use_hair_bvh");
|
params.use_bvh_unaligned_nodes = RNA_boolean_get(&cscene, "debug_use_hair_bvh");
|
||||||
params.num_bvh_time_steps = RNA_int_get(&cscene, "debug_bvh_time_steps");
|
params.num_bvh_time_steps = RNA_int_get(&cscene, "debug_bvh_time_steps");
|
||||||
|
|
||||||
@@ -827,6 +833,14 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine &b_engine,
|
|||||||
SessionParams params;
|
SessionParams params;
|
||||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||||
|
|
||||||
|
if (background && !b_engine.is_preview()) {
|
||||||
|
/* Viewport and preview renders do not require temp directory and do request session
|
||||||
|
* parameters more often than the background render.
|
||||||
|
* Optimize RNA-C++ usage and memory allocation a bit by saving string access which we know is
|
||||||
|
* not needed for viewport render. */
|
||||||
|
params.temp_dir = b_engine.temporary_directory();
|
||||||
|
}
|
||||||
|
|
||||||
/* feature set */
|
/* feature set */
|
||||||
params.experimental = (get_enum(cscene, "feature_set") != 0);
|
params.experimental = (get_enum(cscene, "feature_set") != 0);
|
||||||
|
|
||||||
|
@@ -66,6 +66,8 @@ class BlenderSync {
|
|||||||
|
|
||||||
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
|
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
|
||||||
|
|
||||||
|
void tag_update();
|
||||||
|
|
||||||
/* sync */
|
/* sync */
|
||||||
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
||||||
void sync_data(BL::RenderSettings &b_render,
|
void sync_data(BL::RenderSettings &b_render,
|
||||||
@@ -103,11 +105,11 @@ class BlenderSync {
|
|||||||
static BufferParams get_buffer_params(
|
static BufferParams get_buffer_params(
|
||||||
BL::SpaceView3D &b_v3d, BL::RegionView3D &b_rv3d, Camera *cam, int width, int height);
|
BL::SpaceView3D &b_v3d, BL::RegionView3D &b_rv3d, Camera *cam, int width, int height);
|
||||||
|
|
||||||
private:
|
|
||||||
static DenoiseParams get_denoise_params(BL::Scene &b_scene,
|
static DenoiseParams get_denoise_params(BL::Scene &b_scene,
|
||||||
BL::ViewLayer &b_view_layer,
|
BL::ViewLayer &b_view_layer,
|
||||||
bool background);
|
bool background);
|
||||||
|
|
||||||
|
private:
|
||||||
/* sync */
|
/* sync */
|
||||||
void sync_lights(BL::Depsgraph &b_depsgraph, bool update_all);
|
void sync_lights(BL::Depsgraph &b_depsgraph, bool update_all);
|
||||||
void sync_materials(BL::Depsgraph &b_depsgraph, bool update_all);
|
void sync_materials(BL::Depsgraph &b_depsgraph, bool update_all);
|
||||||
@@ -167,12 +169,16 @@ class BlenderSync {
|
|||||||
Hair *hair, BL::Mesh &b_mesh, BObjectInfo &b_ob_info, bool motion, int motion_step = 0);
|
Hair *hair, BL::Mesh &b_mesh, BObjectInfo &b_ob_info, bool motion, int motion_step = 0);
|
||||||
bool object_has_particle_hair(BL::Object b_ob);
|
bool object_has_particle_hair(BL::Object b_ob);
|
||||||
|
|
||||||
|
/* Point Cloud */
|
||||||
|
void sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info);
|
||||||
|
void sync_pointcloud_motion(PointCloud *pointcloud, BObjectInfo &b_ob_info, int motion_step = 0);
|
||||||
|
|
||||||
/* Camera */
|
/* Camera */
|
||||||
void sync_camera_motion(
|
void sync_camera_motion(
|
||||||
BL::RenderSettings &b_render, BL::Object &b_ob, int width, int height, float motion_time);
|
BL::RenderSettings &b_render, BL::Object &b_ob, int width, int height, float motion_time);
|
||||||
|
|
||||||
/* Geometry */
|
/* Geometry */
|
||||||
Geometry *sync_geometry(BL::Depsgraph &b_depsgrpah,
|
Geometry *sync_geometry(BL::Depsgraph &b_depsgraph,
|
||||||
BObjectInfo &b_ob_info,
|
BObjectInfo &b_ob_info,
|
||||||
bool object_updated,
|
bool object_updated,
|
||||||
bool use_particle_hair,
|
bool use_particle_hair,
|
||||||
@@ -267,7 +273,6 @@ class BlenderSync {
|
|||||||
|
|
||||||
Progress &progress;
|
Progress &progress;
|
||||||
|
|
||||||
protected:
|
|
||||||
/* Indicates that `sync_recalc()` detected changes in the scene.
|
/* Indicates that `sync_recalc()` detected changes in the scene.
|
||||||
* If this flag is false then the data is considered to be up-to-date and will not be
|
* If this flag is false then the data is considered to be up-to-date and will not be
|
||||||
* synchronized at all. */
|
* synchronized at all. */
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#define __BLENDER_UTIL_H__
|
#define __BLENDER_UTIL_H__
|
||||||
|
|
||||||
#include "scene/mesh.h"
|
#include "scene/mesh.h"
|
||||||
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "util/algorithm.h"
|
#include "util/algorithm.h"
|
||||||
#include "util/array.h"
|
#include "util/array.h"
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void BKE_image_user_frame_calc(void *ima, void *iuser, int cfra);
|
void BKE_image_user_frame_calc(void *ima, void *iuser, int cfra);
|
||||||
void BKE_image_user_file_path(void *iuser, void *ima, char *path);
|
void BKE_image_user_file_path_ex(void *iuser, void *ima, char *path, bool resolve_udim);
|
||||||
unsigned char *BKE_image_get_pixels_for_frame(void *image, int frame, int tile);
|
unsigned char *BKE_image_get_pixels_for_frame(void *image, int frame, int tile);
|
||||||
float *BKE_image_get_float_pixels_for_frame(void *image, int frame, int tile);
|
float *BKE_image_get_float_pixels_for_frame(void *image, int frame, int tile);
|
||||||
}
|
}
|
||||||
@@ -290,25 +291,14 @@ static inline int render_resolution_y(BL::RenderSettings &b_render)
|
|||||||
return b_render.resolution_y() * b_render.resolution_percentage() / 100;
|
return b_render.resolution_y() * b_render.resolution_percentage() / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline string image_user_file_path(BL::ImageUser &iuser,
|
static inline string image_user_file_path(BL::ImageUser &iuser, BL::Image &ima, int cfra)
|
||||||
BL::Image &ima,
|
|
||||||
int cfra,
|
|
||||||
bool load_tiled)
|
|
||||||
{
|
{
|
||||||
char filepath[1024];
|
char filepath[1024];
|
||||||
iuser.tile(0);
|
iuser.tile(0);
|
||||||
BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra);
|
BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra);
|
||||||
BKE_image_user_file_path(iuser.ptr.data, ima.ptr.data, filepath);
|
BKE_image_user_file_path_ex(iuser.ptr.data, ima.ptr.data, filepath, false);
|
||||||
|
|
||||||
string filepath_str = string(filepath);
|
return string(filepath);
|
||||||
if (load_tiled && ima.source() == BL::Image::source_TILED) {
|
|
||||||
string udim;
|
|
||||||
if (!ima.tiles.empty()) {
|
|
||||||
udim = to_string(ima.tiles[0].number());
|
|
||||||
}
|
|
||||||
string_replace(filepath_str, udim, "<UDIM>");
|
|
||||||
}
|
|
||||||
return filepath_str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int image_user_frame_number(BL::ImageUser &iuser, BL::Image &ima, int cfra)
|
static inline int image_user_frame_number(BL::ImageUser &iuser, BL::Image &ima, int cfra)
|
||||||
@@ -681,6 +671,40 @@ static inline uint object_ray_visibility(BL::Object &b_ob)
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check whether some of "built-in" motion-related attributes are needed to be exported (includes
|
||||||
|
* things like velocity from cache modifier, fluid simulation).
|
||||||
|
*
|
||||||
|
* NOTE: This code is run prior to object motion blur initialization. so can not access properties
|
||||||
|
* set by `sync_object_motion_init()`. */
|
||||||
|
static inline bool object_need_motion_attribute(BObjectInfo &b_ob_info, Scene *scene)
|
||||||
|
{
|
||||||
|
const Scene::MotionType need_motion = scene->need_motion();
|
||||||
|
if (need_motion == Scene::MOTION_NONE) {
|
||||||
|
/* Simple case: neither motion pass nor motion blur is needed, no need in the motion related
|
||||||
|
* attributes. */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (need_motion == Scene::MOTION_BLUR) {
|
||||||
|
/* A bit tricky and implicit case:
|
||||||
|
* - Motion blur is enabled in the scene, which implies specific number of time steps for
|
||||||
|
* objects.
|
||||||
|
* - If the object has motion blur disabled on it, it will have 0 time steps.
|
||||||
|
* - Motion attribute expects non-zero time steps.
|
||||||
|
*
|
||||||
|
* Avoid adding motion attributes if the motion blur will enforce 0 motion steps. */
|
||||||
|
PointerRNA cobject = RNA_pointer_get(&b_ob_info.real_object.ptr, "cycles");
|
||||||
|
const bool use_motion = get_boolean(cobject, "use_motion_blur");
|
||||||
|
if (!use_motion) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Motion pass which implies 3 motion steps, or motion blur which is not disabled on object
|
||||||
|
* level. */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
class EdgeMap {
|
class EdgeMap {
|
||||||
public:
|
public:
|
||||||
EdgeMap()
|
EdgeMap()
|
||||||
|
@@ -33,6 +33,17 @@ set(SRC
|
|||||||
unaligned.cpp
|
unaligned.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(SRC_METAL
|
||||||
|
metal.mm
|
||||||
|
)
|
||||||
|
|
||||||
|
if(WITH_CYCLES_DEVICE_METAL)
|
||||||
|
list(APPEND SRC
|
||||||
|
${SRC_METAL}
|
||||||
|
)
|
||||||
|
add_definitions(-DWITH_METAL)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SRC_HEADERS
|
set(SRC_HEADERS
|
||||||
bvh.h
|
bvh.h
|
||||||
bvh2.h
|
bvh2.h
|
||||||
@@ -46,6 +57,7 @@ set(SRC_HEADERS
|
|||||||
sort.h
|
sort.h
|
||||||
split.h
|
split.h
|
||||||
unaligned.h
|
unaligned.h
|
||||||
|
metal.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIB
|
set(LIB
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "scene/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "scene/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "scene/object.h"
|
#include "scene/object.h"
|
||||||
|
#include "scene/pointcloud.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/scene.h"
|
||||||
|
|
||||||
#include "util/algorithm.h"
|
#include "util/algorithm.h"
|
||||||
@@ -113,9 +114,9 @@ void BVHBuild::add_reference_triangles(BoundBox &root,
|
|||||||
else {
|
else {
|
||||||
/* Motion triangles, trace optimized case: we split triangle
|
/* Motion triangles, trace optimized case: we split triangle
|
||||||
* primitives into separate nodes for each of the time steps.
|
* primitives into separate nodes for each of the time steps.
|
||||||
* This way we minimize overlap of neighbor curve primitives.
|
* This way we minimize overlap of neighbor triangle primitives.
|
||||||
*/
|
*/
|
||||||
const int num_bvh_steps = params.num_motion_curve_steps * 2 + 1;
|
const int num_bvh_steps = params.num_motion_triangle_steps * 2 + 1;
|
||||||
const float num_bvh_steps_inv_1 = 1.0f / (num_bvh_steps - 1);
|
const float num_bvh_steps_inv_1 = 1.0f / (num_bvh_steps - 1);
|
||||||
const size_t num_verts = mesh->verts.size();
|
const size_t num_verts = mesh->verts.size();
|
||||||
const size_t num_steps = mesh->motion_steps;
|
const size_t num_steps = mesh->motion_steps;
|
||||||
@@ -269,6 +270,101 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BVHBuild::add_reference_points(BoundBox &root,
|
||||||
|
BoundBox ¢er,
|
||||||
|
PointCloud *pointcloud,
|
||||||
|
int i)
|
||||||
|
{
|
||||||
|
const Attribute *point_attr_mP = NULL;
|
||||||
|
if (pointcloud->has_motion_blur()) {
|
||||||
|
point_attr_mP = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
}
|
||||||
|
|
||||||
|
const float3 *points_data = &pointcloud->points[0];
|
||||||
|
const float *radius_data = &pointcloud->radius[0];
|
||||||
|
const size_t num_points = pointcloud->num_points();
|
||||||
|
const float3 *motion_data = (point_attr_mP) ? point_attr_mP->data_float3() : NULL;
|
||||||
|
const size_t num_steps = pointcloud->get_motion_steps();
|
||||||
|
|
||||||
|
if (point_attr_mP == NULL) {
|
||||||
|
/* Really simple logic for static points. */
|
||||||
|
for (uint j = 0; j < num_points; j++) {
|
||||||
|
const PointCloud::Point point = pointcloud->get_point(j);
|
||||||
|
BoundBox bounds = BoundBox::empty;
|
||||||
|
point.bounds_grow(points_data, radius_data, bounds);
|
||||||
|
if (bounds.valid()) {
|
||||||
|
references.push_back(BVHReference(bounds, j, i, PRIMITIVE_POINT));
|
||||||
|
root.grow(bounds);
|
||||||
|
center.grow(bounds.center2());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (params.num_motion_point_steps == 0 || params.use_spatial_split) {
|
||||||
|
/* Simple case of motion points: single node for the whole
|
||||||
|
* shutter time. Lowest memory usage but less optimal
|
||||||
|
* rendering.
|
||||||
|
*/
|
||||||
|
/* TODO(sergey): Support motion steps for spatially split BVH. */
|
||||||
|
for (uint j = 0; j < num_points; j++) {
|
||||||
|
const PointCloud::Point point = pointcloud->get_point(j);
|
||||||
|
BoundBox bounds = BoundBox::empty;
|
||||||
|
point.bounds_grow(points_data, radius_data, bounds);
|
||||||
|
for (size_t step = 0; step < num_steps - 1; step++) {
|
||||||
|
point.bounds_grow(motion_data + step * num_points, radius_data, bounds);
|
||||||
|
}
|
||||||
|
if (bounds.valid()) {
|
||||||
|
references.push_back(BVHReference(bounds, j, i, PRIMITIVE_MOTION_POINT));
|
||||||
|
root.grow(bounds);
|
||||||
|
center.grow(bounds.center2());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* Motion points, trace optimized case: we split point
|
||||||
|
* primitives into separate nodes for each of the time steps.
|
||||||
|
* This way we minimize overlap of neighbor point primitives.
|
||||||
|
*/
|
||||||
|
const int num_bvh_steps = params.num_motion_point_steps * 2 + 1;
|
||||||
|
const float num_bvh_steps_inv_1 = 1.0f / (num_bvh_steps - 1);
|
||||||
|
|
||||||
|
for (uint j = 0; j < num_points; j++) {
|
||||||
|
const PointCloud::Point point = pointcloud->get_point(j);
|
||||||
|
const size_t num_steps = pointcloud->get_motion_steps();
|
||||||
|
const float3 *point_steps = point_attr_mP->data_float3();
|
||||||
|
|
||||||
|
/* Calculate bounding box of the previous time step.
|
||||||
|
* Will be reused later to avoid duplicated work on
|
||||||
|
* calculating BVH time step boundbox.
|
||||||
|
*/
|
||||||
|
float4 prev_key = point.motion_key(
|
||||||
|
points_data, radius_data, point_steps, num_points, num_steps, 0.0f, j);
|
||||||
|
BoundBox prev_bounds = BoundBox::empty;
|
||||||
|
point.bounds_grow(prev_key, prev_bounds);
|
||||||
|
/* Create all primitive time steps, */
|
||||||
|
for (int bvh_step = 1; bvh_step < num_bvh_steps; ++bvh_step) {
|
||||||
|
const float curr_time = (float)(bvh_step)*num_bvh_steps_inv_1;
|
||||||
|
float4 curr_key = point.motion_key(
|
||||||
|
points_data, radius_data, point_steps, num_points, num_steps, curr_time, j);
|
||||||
|
BoundBox curr_bounds = BoundBox::empty;
|
||||||
|
point.bounds_grow(curr_key, curr_bounds);
|
||||||
|
BoundBox bounds = prev_bounds;
|
||||||
|
bounds.grow(curr_bounds);
|
||||||
|
if (bounds.valid()) {
|
||||||
|
const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1;
|
||||||
|
references.push_back(
|
||||||
|
BVHReference(bounds, j, i, PRIMITIVE_MOTION_POINT, prev_time, curr_time));
|
||||||
|
root.grow(bounds);
|
||||||
|
center.grow(bounds.center2());
|
||||||
|
}
|
||||||
|
/* Current time boundbox becomes previous one for the
|
||||||
|
* next time step.
|
||||||
|
*/
|
||||||
|
prev_bounds = curr_bounds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BVHBuild::add_reference_geometry(BoundBox &root,
|
void BVHBuild::add_reference_geometry(BoundBox &root,
|
||||||
BoundBox ¢er,
|
BoundBox ¢er,
|
||||||
Geometry *geom,
|
Geometry *geom,
|
||||||
@@ -282,6 +378,10 @@ void BVHBuild::add_reference_geometry(BoundBox &root,
|
|||||||
Hair *hair = static_cast<Hair *>(geom);
|
Hair *hair = static_cast<Hair *>(geom);
|
||||||
add_reference_curves(root, center, hair, object_index);
|
add_reference_curves(root, center, hair, object_index);
|
||||||
}
|
}
|
||||||
|
else if (geom->geometry_type == Geometry::POINTCLOUD) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
add_reference_points(root, center, pointcloud, object_index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BVHBuild::add_reference_object(BoundBox &root, BoundBox ¢er, Object *ob, int i)
|
void BVHBuild::add_reference_object(BoundBox &root, BoundBox ¢er, Object *ob, int i)
|
||||||
@@ -311,6 +411,10 @@ static size_t count_primitives(Geometry *geom)
|
|||||||
Hair *hair = static_cast<Hair *>(geom);
|
Hair *hair = static_cast<Hair *>(geom);
|
||||||
return count_curve_segments(hair);
|
return count_curve_segments(hair);
|
||||||
}
|
}
|
||||||
|
else if (geom->geometry_type == Geometry::POINTCLOUD) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
return pointcloud->num_points();
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -328,8 +432,9 @@ void BVHBuild::add_references(BVHRange &root)
|
|||||||
if (!ob->get_geometry()->is_instanced()) {
|
if (!ob->get_geometry()->is_instanced()) {
|
||||||
num_alloc_references += count_primitives(ob->get_geometry());
|
num_alloc_references += count_primitives(ob->get_geometry());
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
num_alloc_references++;
|
num_alloc_references++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
num_alloc_references += count_primitives(ob->get_geometry());
|
num_alloc_references += count_primitives(ob->get_geometry());
|
||||||
@@ -394,7 +499,7 @@ BVHNode *BVHBuild::run()
|
|||||||
spatial_min_overlap = root.bounds().safe_area() * params.spatial_split_alpha;
|
spatial_min_overlap = root.bounds().safe_area() * params.spatial_split_alpha;
|
||||||
spatial_free_index = 0;
|
spatial_free_index = 0;
|
||||||
|
|
||||||
need_prim_time = params.num_motion_curve_steps > 0 || params.num_motion_triangle_steps > 0;
|
need_prim_time = params.use_motion_steps();
|
||||||
|
|
||||||
/* init progress updates */
|
/* init progress updates */
|
||||||
double build_start_time;
|
double build_start_time;
|
||||||
@@ -535,7 +640,8 @@ bool BVHBuild::range_within_max_leaf_size(const BVHRange &range,
|
|||||||
const vector<BVHReference> &references) const
|
const vector<BVHReference> &references) const
|
||||||
{
|
{
|
||||||
size_t size = range.size();
|
size_t size = range.size();
|
||||||
size_t max_leaf_size = max(params.max_triangle_leaf_size, params.max_curve_leaf_size);
|
size_t max_leaf_size = max(max(params.max_triangle_leaf_size, params.max_curve_leaf_size),
|
||||||
|
params.max_point_leaf_size);
|
||||||
|
|
||||||
if (size > max_leaf_size)
|
if (size > max_leaf_size)
|
||||||
return false;
|
return false;
|
||||||
@@ -544,32 +650,44 @@ bool BVHBuild::range_within_max_leaf_size(const BVHRange &range,
|
|||||||
size_t num_motion_triangles = 0;
|
size_t num_motion_triangles = 0;
|
||||||
size_t num_curves = 0;
|
size_t num_curves = 0;
|
||||||
size_t num_motion_curves = 0;
|
size_t num_motion_curves = 0;
|
||||||
|
size_t num_points = 0;
|
||||||
|
size_t num_motion_points = 0;
|
||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
const BVHReference &ref = references[range.start() + i];
|
const BVHReference &ref = references[range.start() + i];
|
||||||
|
|
||||||
if (ref.prim_type() & PRIMITIVE_ALL_CURVE) {
|
if (ref.prim_type() & PRIMITIVE_CURVE) {
|
||||||
if (ref.prim_type() & PRIMITIVE_ALL_MOTION) {
|
if (ref.prim_type() & PRIMITIVE_MOTION) {
|
||||||
num_motion_curves++;
|
num_motion_curves++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
num_curves++;
|
num_curves++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ref.prim_type() & PRIMITIVE_ALL_TRIANGLE) {
|
else if (ref.prim_type() & PRIMITIVE_TRIANGLE) {
|
||||||
if (ref.prim_type() & PRIMITIVE_ALL_MOTION) {
|
if (ref.prim_type() & PRIMITIVE_MOTION) {
|
||||||
num_motion_triangles++;
|
num_motion_triangles++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
num_triangles++;
|
num_triangles++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (ref.prim_type() & PRIMITIVE_POINT) {
|
||||||
|
if (ref.prim_type() & PRIMITIVE_MOTION) {
|
||||||
|
num_motion_points++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
num_points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (num_triangles <= params.max_triangle_leaf_size) &&
|
return (num_triangles <= params.max_triangle_leaf_size) &&
|
||||||
(num_motion_triangles <= params.max_motion_triangle_leaf_size) &&
|
(num_motion_triangles <= params.max_motion_triangle_leaf_size) &&
|
||||||
(num_curves <= params.max_curve_leaf_size) &&
|
(num_curves <= params.max_curve_leaf_size) &&
|
||||||
(num_motion_curves <= params.max_motion_curve_leaf_size);
|
(num_motion_curves <= params.max_motion_curve_leaf_size) &&
|
||||||
|
(num_points <= params.max_point_leaf_size) &&
|
||||||
|
(num_motion_points <= params.max_motion_point_leaf_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* multithreaded binning builder */
|
/* multithreaded binning builder */
|
||||||
@@ -817,7 +935,7 @@ BVHNode *BVHBuild::create_object_leaf_nodes(const BVHReference *ref, int start,
|
|||||||
|
|
||||||
BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHReference> &references)
|
BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHReference> &references)
|
||||||
{
|
{
|
||||||
/* This is a bit overallocating here (considering leaf size into account),
|
/* This is a bit over-allocating here (considering leaf size into account),
|
||||||
* but chunk-based re-allocation in vector makes it difficult to use small
|
* but chunk-based re-allocation in vector makes it difficult to use small
|
||||||
* size of stack storage here. Some tweaks are possible tho.
|
* size of stack storage here. Some tweaks are possible tho.
|
||||||
*
|
*
|
||||||
@@ -855,7 +973,7 @@ BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHRefer
|
|||||||
for (int i = 0; i < range.size(); i++) {
|
for (int i = 0; i < range.size(); i++) {
|
||||||
const BVHReference &ref = references[range.start() + i];
|
const BVHReference &ref = references[range.start() + i];
|
||||||
if (ref.prim_index() != -1) {
|
if (ref.prim_index() != -1) {
|
||||||
uint32_t type_index = bitscan((uint32_t)(ref.prim_type() & PRIMITIVE_ALL));
|
uint32_t type_index = PRIMITIVE_INDEX(ref.prim_type() & PRIMITIVE_ALL);
|
||||||
p_ref[type_index].push_back(ref);
|
p_ref[type_index].push_back(ref);
|
||||||
p_type[type_index].push_back(ref.prim_type());
|
p_type[type_index].push_back(ref.prim_type());
|
||||||
p_index[type_index].push_back(ref.prim_index());
|
p_index[type_index].push_back(ref.prim_index());
|
||||||
|
@@ -39,6 +39,7 @@ class Geometry;
|
|||||||
class Hair;
|
class Hair;
|
||||||
class Mesh;
|
class Mesh;
|
||||||
class Object;
|
class Object;
|
||||||
|
class PointCloud;
|
||||||
class Progress;
|
class Progress;
|
||||||
|
|
||||||
/* BVH Builder */
|
/* BVH Builder */
|
||||||
@@ -68,6 +69,7 @@ class BVHBuild {
|
|||||||
/* Adding references. */
|
/* Adding references. */
|
||||||
void add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *mesh, int i);
|
void add_reference_triangles(BoundBox &root, BoundBox ¢er, Mesh *mesh, int i);
|
||||||
void add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair, int i);
|
void add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair, int i);
|
||||||
|
void add_reference_points(BoundBox &root, BoundBox ¢er, PointCloud *pointcloud, int i);
|
||||||
void add_reference_geometry(BoundBox &root, BoundBox ¢er, Geometry *geom, int i);
|
void add_reference_geometry(BoundBox &root, BoundBox ¢er, Geometry *geom, int i);
|
||||||
void add_reference_object(BoundBox &root, BoundBox ¢er, Object *ob, int i);
|
void add_reference_object(BoundBox &root, BoundBox ¢er, Object *ob, int i);
|
||||||
void add_references(BVHRange &root);
|
void add_references(BVHRange &root);
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "bvh/bvh2.h"
|
#include "bvh/bvh2.h"
|
||||||
#include "bvh/embree.h"
|
#include "bvh/embree.h"
|
||||||
|
#include "bvh/metal.h"
|
||||||
#include "bvh/multi.h"
|
#include "bvh/multi.h"
|
||||||
#include "bvh/optix.h"
|
#include "bvh/optix.h"
|
||||||
|
|
||||||
@@ -40,8 +41,12 @@ const char *bvh_layout_name(BVHLayout layout)
|
|||||||
return "EMBREE";
|
return "EMBREE";
|
||||||
case BVH_LAYOUT_OPTIX:
|
case BVH_LAYOUT_OPTIX:
|
||||||
return "OPTIX";
|
return "OPTIX";
|
||||||
|
case BVH_LAYOUT_METAL:
|
||||||
|
return "METAL";
|
||||||
case BVH_LAYOUT_MULTI_OPTIX:
|
case BVH_LAYOUT_MULTI_OPTIX:
|
||||||
|
case BVH_LAYOUT_MULTI_METAL:
|
||||||
case BVH_LAYOUT_MULTI_OPTIX_EMBREE:
|
case BVH_LAYOUT_MULTI_OPTIX_EMBREE:
|
||||||
|
case BVH_LAYOUT_MULTI_METAL_EMBREE:
|
||||||
return "MULTI";
|
return "MULTI";
|
||||||
case BVH_LAYOUT_ALL:
|
case BVH_LAYOUT_ALL:
|
||||||
return "ALL";
|
return "ALL";
|
||||||
@@ -102,9 +107,18 @@ BVH *BVH::create(const BVHParams ¶ms,
|
|||||||
#else
|
#else
|
||||||
(void)device;
|
(void)device;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
case BVH_LAYOUT_METAL:
|
||||||
|
#ifdef WITH_METAL
|
||||||
|
return bvh_metal_create(params, geometry, objects, device);
|
||||||
|
#else
|
||||||
|
(void)device;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
case BVH_LAYOUT_MULTI_OPTIX:
|
case BVH_LAYOUT_MULTI_OPTIX:
|
||||||
|
case BVH_LAYOUT_MULTI_METAL:
|
||||||
case BVH_LAYOUT_MULTI_OPTIX_EMBREE:
|
case BVH_LAYOUT_MULTI_OPTIX_EMBREE:
|
||||||
|
case BVH_LAYOUT_MULTI_METAL_EMBREE:
|
||||||
return new BVHMulti(params, geometry, objects);
|
return new BVHMulti(params, geometry, objects);
|
||||||
case BVH_LAYOUT_NONE:
|
case BVH_LAYOUT_NONE:
|
||||||
case BVH_LAYOUT_ALL:
|
case BVH_LAYOUT_ALL:
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include "scene/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "scene/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "scene/object.h"
|
#include "scene/object.h"
|
||||||
|
#include "scene/pointcloud.h"
|
||||||
|
|
||||||
#include "bvh/build.h"
|
#include "bvh/build.h"
|
||||||
#include "bvh/node.h"
|
#include "bvh/node.h"
|
||||||
@@ -386,7 +387,7 @@ void BVH2::refit_primitives(int start, int end, BoundBox &bbox, uint &visibility
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Primitives. */
|
/* Primitives. */
|
||||||
if (pack.prim_type[prim] & PRIMITIVE_ALL_CURVE) {
|
if (pack.prim_type[prim] & PRIMITIVE_CURVE) {
|
||||||
/* Curves. */
|
/* Curves. */
|
||||||
const Hair *hair = static_cast<const Hair *>(ob->get_geometry());
|
const Hair *hair = static_cast<const Hair *>(ob->get_geometry());
|
||||||
int prim_offset = (params.top_level) ? hair->prim_offset : 0;
|
int prim_offset = (params.top_level) ? hair->prim_offset : 0;
|
||||||
@@ -409,6 +410,30 @@ void BVH2::refit_primitives(int start, int end, BoundBox &bbox, uint &visibility
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (pack.prim_type[prim] & PRIMITIVE_POINT) {
|
||||||
|
/* Points. */
|
||||||
|
const PointCloud *pointcloud = static_cast<const PointCloud *>(ob->get_geometry());
|
||||||
|
int prim_offset = (params.top_level) ? pointcloud->prim_offset : 0;
|
||||||
|
const float3 *points = &pointcloud->points[0];
|
||||||
|
const float *radius = &pointcloud->radius[0];
|
||||||
|
PointCloud::Point point = pointcloud->get_point(pidx - prim_offset);
|
||||||
|
|
||||||
|
point.bounds_grow(points, radius, bbox);
|
||||||
|
|
||||||
|
/* Motion points. */
|
||||||
|
if (pointcloud->get_use_motion_blur()) {
|
||||||
|
Attribute *attr = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
|
||||||
|
if (attr) {
|
||||||
|
size_t pointcloud_size = pointcloud->points.size();
|
||||||
|
size_t steps = pointcloud->get_motion_steps() - 1;
|
||||||
|
float3 *point_steps = attr->data_float3();
|
||||||
|
|
||||||
|
for (size_t i = 0; i < steps; i++)
|
||||||
|
point.bounds_grow(point_steps + i * pointcloud_size, radius, bbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* Triangles. */
|
/* Triangles. */
|
||||||
const Mesh *mesh = static_cast<const Mesh *>(ob->get_geometry());
|
const Mesh *mesh = static_cast<const Mesh *>(ob->get_geometry());
|
||||||
@@ -505,7 +530,8 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_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());
|
||||||
|
|
||||||
if (params.num_motion_curve_steps > 0 || params.num_motion_triangle_steps > 0) {
|
if (params.num_motion_curve_steps > 0 || params.num_motion_triangle_steps > 0 ||
|
||||||
|
params.num_motion_point_steps > 0) {
|
||||||
pack.prim_time.resize(prim_index_size);
|
pack.prim_time.resize(prim_index_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,13 +590,7 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
|
|||||||
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) {
|
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;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + geom_prim_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
pack_prim_type[pack_prim_index_offset] = bvh_prim_type[i];
|
pack_prim_type[pack_prim_index_offset] = bvh_prim_type[i];
|
||||||
pack_prim_visibility[pack_prim_index_offset] = bvh_prim_visibility[i];
|
pack_prim_visibility[pack_prim_index_offset] = bvh_prim_visibility[i];
|
||||||
pack_prim_object[pack_prim_index_offset] = 0; // unused for instances
|
pack_prim_object[pack_prim_index_offset] = 0; // unused for instances
|
||||||
|
@@ -45,6 +45,7 @@
|
|||||||
# include "scene/hair.h"
|
# include "scene/hair.h"
|
||||||
# include "scene/mesh.h"
|
# include "scene/mesh.h"
|
||||||
# include "scene/object.h"
|
# include "scene/object.h"
|
||||||
|
# include "scene/pointcloud.h"
|
||||||
|
|
||||||
# include "util/foreach.h"
|
# include "util/foreach.h"
|
||||||
# include "util/log.h"
|
# include "util/log.h"
|
||||||
@@ -60,6 +61,26 @@ static_assert(Object::MAX_MOTION_STEPS == Geometry::MAX_MOTION_STEPS,
|
|||||||
|
|
||||||
# define IS_HAIR(x) (x & 1)
|
# define IS_HAIR(x) (x & 1)
|
||||||
|
|
||||||
|
/* This gets called by Embree at every valid ray/object intersection.
|
||||||
|
* Things like recording subsurface or shadow hits for later evaluation
|
||||||
|
* as well as filtering for volume objects happen here.
|
||||||
|
* Cycles' own BVH does that directly inside the traversal calls.
|
||||||
|
*/
|
||||||
|
static void rtc_filter_intersection_func(const RTCFilterFunctionNArguments *args)
|
||||||
|
{
|
||||||
|
/* Current implementation in Cycles assumes only single-ray intersection queries. */
|
||||||
|
assert(args->N == 1);
|
||||||
|
|
||||||
|
RTCHit *hit = (RTCHit *)args->hit;
|
||||||
|
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
|
||||||
|
const KernelGlobalsCPU *kg = ctx->kg;
|
||||||
|
const Ray *cray = ctx->ray;
|
||||||
|
|
||||||
|
if (kernel_embree_is_self_intersection(kg, hit, cray)) {
|
||||||
|
*args->valid = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This gets called by Embree at every valid ray/object intersection.
|
/* This gets called by Embree at every valid ray/object intersection.
|
||||||
* Things like recording subsurface or shadow hits for later evaluation
|
* Things like recording subsurface or shadow hits for later evaluation
|
||||||
* as well as filtering for volume objects happen here.
|
* as well as filtering for volume objects happen here.
|
||||||
@@ -74,12 +95,16 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
RTCHit *hit = (RTCHit *)args->hit;
|
RTCHit *hit = (RTCHit *)args->hit;
|
||||||
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
|
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
|
||||||
const KernelGlobalsCPU *kg = ctx->kg;
|
const KernelGlobalsCPU *kg = ctx->kg;
|
||||||
|
const Ray *cray = ctx->ray;
|
||||||
|
|
||||||
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 (intersection_skip_self_shadow(cray->self, current_isect.object, current_isect.prim)) {
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* If no transparent shadows or max number of hits exceeded, 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, current_isect.prim, current_isect.type);
|
const int flags = intersection_get_shader_flags(kg, current_isect.prim, current_isect.type);
|
||||||
if (!(flags & (SD_HAS_TRANSPARENT_SHADOW)) || ctx->num_hits >= ctx->max_hits) {
|
if (!(flags & (SD_HAS_TRANSPARENT_SHADOW)) || ctx->num_hits >= ctx->max_hits) {
|
||||||
@@ -90,7 +115,7 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
++ctx->num_hits;
|
++ctx->num_hits;
|
||||||
|
|
||||||
/* Always use baked shadow transparency for curves. */
|
/* Always use baked shadow transparency for curves. */
|
||||||
if (current_isect.type & PRIMITIVE_ALL_CURVE) {
|
if (current_isect.type & PRIMITIVE_CURVE) {
|
||||||
ctx->throughput *= intersection_curve_shadow_transparency(
|
ctx->throughput *= intersection_curve_shadow_transparency(
|
||||||
kg, current_isect.object, current_isect.prim, current_isect.u);
|
kg, current_isect.object, current_isect.prim, current_isect.u);
|
||||||
|
|
||||||
@@ -159,6 +184,10 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (intersection_skip_self_local(cray->self, current_isect.prim)) {
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* No intersection information requested, just return a hit. */
|
/* No intersection information requested, just return a hit. */
|
||||||
if (ctx->max_hits == 0) {
|
if (ctx->max_hits == 0) {
|
||||||
@@ -224,6 +253,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);
|
||||||
|
if (intersection_skip_self(cray->self, current_isect.object, current_isect.prim)) {
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
@@ -235,17 +269,20 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
}
|
}
|
||||||
/* This tells Embree to continue tracing. */
|
/* This tells Embree to continue tracing. */
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case CCLIntersectContext::RAY_REGULAR:
|
case CCLIntersectContext::RAY_REGULAR:
|
||||||
default:
|
default:
|
||||||
/* Nothing to do here. */
|
if (kernel_embree_is_self_intersection(kg, hit, cray)) {
|
||||||
|
*args->valid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtc_filter_func_thick_curve(const RTCFilterFunctionNArguments *args)
|
static void rtc_filter_func_backface_cull(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;
|
||||||
@@ -256,9 +293,17 @@ static void rtc_filter_func_thick_curve(const RTCFilterFunctionNArguments *args)
|
|||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
|
||||||
|
const KernelGlobalsCPU *kg = ctx->kg;
|
||||||
|
const Ray *cray = ctx->ray;
|
||||||
|
|
||||||
|
if (kernel_embree_is_self_intersection(kg, hit, cray)) {
|
||||||
|
*args->valid = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtc_filter_occluded_func_thick_curve(const RTCFilterFunctionNArguments *args)
|
static void rtc_filter_occluded_func_backface_cull(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;
|
||||||
@@ -354,10 +399,12 @@ void BVHEmbree::build(Progress &progress, Stats *stats, RTCDevice rtc_device_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool dynamic = params.bvh_type == BVH_TYPE_DYNAMIC;
|
const bool dynamic = params.bvh_type == BVH_TYPE_DYNAMIC;
|
||||||
|
const bool compact = params.use_compact_structure;
|
||||||
|
|
||||||
scene = rtcNewScene(rtc_device);
|
scene = rtcNewScene(rtc_device);
|
||||||
const RTCSceneFlags scene_flags = (dynamic ? RTC_SCENE_FLAG_DYNAMIC : RTC_SCENE_FLAG_NONE) |
|
const RTCSceneFlags scene_flags = (dynamic ? RTC_SCENE_FLAG_DYNAMIC : RTC_SCENE_FLAG_NONE) |
|
||||||
RTC_SCENE_FLAG_COMPACT | RTC_SCENE_FLAG_ROBUST;
|
(compact ? RTC_SCENE_FLAG_COMPACT : RTC_SCENE_FLAG_NONE) |
|
||||||
|
RTC_SCENE_FLAG_ROBUST;
|
||||||
rtcSetSceneFlags(scene, scene_flags);
|
rtcSetSceneFlags(scene, scene_flags);
|
||||||
build_quality = dynamic ? RTC_BUILD_QUALITY_LOW :
|
build_quality = dynamic ? RTC_BUILD_QUALITY_LOW :
|
||||||
(params.use_spatial_split ? RTC_BUILD_QUALITY_HIGH :
|
(params.use_spatial_split ? RTC_BUILD_QUALITY_HIGH :
|
||||||
@@ -410,6 +457,12 @@ void BVHEmbree::add_object(Object *ob, int i)
|
|||||||
add_curves(ob, hair, i);
|
add_curves(ob, hair, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (geom->geometry_type == Geometry::POINTCLOUD) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
if (pointcloud->num_points() > 0) {
|
||||||
|
add_points(ob, pointcloud, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BVHEmbree::add_instance(Object *ob, int i)
|
void BVHEmbree::add_instance(Object *ob, int i)
|
||||||
@@ -496,6 +549,7 @@ void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
|
|||||||
|
|
||||||
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
||||||
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
||||||
|
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_intersection_func);
|
||||||
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
||||||
|
|
||||||
rtcCommitGeometry(geom_id);
|
rtcCommitGeometry(geom_id);
|
||||||
@@ -624,6 +678,89 @@ void BVHEmbree::set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BVHEmbree::set_point_vertex_buffer(RTCGeometry geom_id,
|
||||||
|
const PointCloud *pointcloud,
|
||||||
|
const bool update)
|
||||||
|
{
|
||||||
|
const Attribute *attr_mP = NULL;
|
||||||
|
size_t num_motion_steps = 1;
|
||||||
|
if (pointcloud->has_motion_blur()) {
|
||||||
|
attr_mP = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
if (attr_mP) {
|
||||||
|
num_motion_steps = pointcloud->get_motion_steps();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const size_t num_points = pointcloud->num_points();
|
||||||
|
|
||||||
|
/* Copy the point data to Embree */
|
||||||
|
const int t_mid = (num_motion_steps - 1) / 2;
|
||||||
|
const float *radius = pointcloud->get_radius().data();
|
||||||
|
for (int t = 0; t < num_motion_steps; ++t) {
|
||||||
|
const float3 *verts;
|
||||||
|
if (t == t_mid || attr_mP == NULL) {
|
||||||
|
verts = pointcloud->get_points().data();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int t_ = (t > t_mid) ? (t - 1) : t;
|
||||||
|
verts = &attr_mP->data_float3()[t_ * num_points];
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 *rtc_verts = (update) ? (float4 *)rtcGetGeometryBufferData(
|
||||||
|
geom_id, RTC_BUFFER_TYPE_VERTEX, t) :
|
||||||
|
(float4 *)rtcSetNewGeometryBuffer(geom_id,
|
||||||
|
RTC_BUFFER_TYPE_VERTEX,
|
||||||
|
t,
|
||||||
|
RTC_FORMAT_FLOAT4,
|
||||||
|
sizeof(float) * 4,
|
||||||
|
num_points);
|
||||||
|
|
||||||
|
assert(rtc_verts);
|
||||||
|
if (rtc_verts) {
|
||||||
|
for (size_t j = 0; j < num_points; ++j) {
|
||||||
|
rtc_verts[j] = float3_to_float4(verts[j]);
|
||||||
|
rtc_verts[j].w = radius[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (update) {
|
||||||
|
rtcUpdateGeometryBuffer(geom_id, RTC_BUFFER_TYPE_VERTEX, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BVHEmbree::add_points(const Object *ob, const PointCloud *pointcloud, int i)
|
||||||
|
{
|
||||||
|
size_t prim_offset = pointcloud->prim_offset;
|
||||||
|
|
||||||
|
const Attribute *attr_mP = NULL;
|
||||||
|
size_t num_motion_steps = 1;
|
||||||
|
if (pointcloud->has_motion_blur()) {
|
||||||
|
attr_mP = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
if (attr_mP) {
|
||||||
|
num_motion_steps = pointcloud->get_motion_steps();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum RTCGeometryType type = RTC_GEOMETRY_TYPE_SPHERE_POINT;
|
||||||
|
|
||||||
|
RTCGeometry geom_id = rtcNewGeometry(rtc_device, type);
|
||||||
|
|
||||||
|
rtcSetGeometryBuildQuality(geom_id, build_quality);
|
||||||
|
rtcSetGeometryTimeStepCount(geom_id, num_motion_steps);
|
||||||
|
|
||||||
|
set_point_vertex_buffer(geom_id, pointcloud, false);
|
||||||
|
|
||||||
|
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
||||||
|
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func_backface_cull);
|
||||||
|
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func_backface_cull);
|
||||||
|
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
||||||
|
|
||||||
|
rtcCommitGeometry(geom_id);
|
||||||
|
rtcAttachGeometryByID(scene, geom_id, i * 2);
|
||||||
|
rtcReleaseGeometry(geom_id);
|
||||||
|
}
|
||||||
|
|
||||||
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->curve_segment_offset;
|
size_t prim_offset = hair->curve_segment_offset;
|
||||||
@@ -675,11 +812,12 @@ void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
|||||||
|
|
||||||
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
||||||
if (hair->curve_shape == CURVE_RIBBON) {
|
if (hair->curve_shape == CURVE_RIBBON) {
|
||||||
|
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_intersection_func);
|
||||||
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func_thick_curve);
|
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func_backface_cull);
|
||||||
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func_thick_curve);
|
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func_backface_cull);
|
||||||
}
|
}
|
||||||
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
||||||
|
|
||||||
@@ -716,6 +854,14 @@ void BVHEmbree::refit(Progress &progress)
|
|||||||
rtcCommitGeometry(geom);
|
rtcCommitGeometry(geom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (geom->geometry_type == Geometry::POINTCLOUD) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
if (pointcloud->num_points() > 0) {
|
||||||
|
RTCGeometry geom = rtcGetGeometry(scene, geom_id);
|
||||||
|
set_point_vertex_buffer(geom, pointcloud, true);
|
||||||
|
rtcCommitGeometry(geom);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
geom_id += 2;
|
geom_id += 2;
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,7 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
class Hair;
|
class Hair;
|
||||||
class Mesh;
|
class Mesh;
|
||||||
|
class PointCloud;
|
||||||
|
|
||||||
class BVHEmbree : public BVH {
|
class BVHEmbree : public BVH {
|
||||||
public:
|
public:
|
||||||
@@ -51,11 +52,15 @@ class BVHEmbree : public BVH {
|
|||||||
void add_object(Object *ob, int i);
|
void add_object(Object *ob, int i);
|
||||||
void add_instance(Object *ob, int i);
|
void add_instance(Object *ob, int i);
|
||||||
void add_curves(const Object *ob, const Hair *hair, int i);
|
void add_curves(const Object *ob, const Hair *hair, int i);
|
||||||
|
void add_points(const Object *ob, const PointCloud *pointcloud, int i);
|
||||||
void add_triangles(const Object *ob, const Mesh *mesh, int i);
|
void add_triangles(const Object *ob, const Mesh *mesh, int i);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, const bool update);
|
void set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, const bool update);
|
||||||
void set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, const bool update);
|
void set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, const bool update);
|
||||||
|
void set_point_vertex_buffer(RTCGeometry geom_id,
|
||||||
|
const PointCloud *pointcloud,
|
||||||
|
const bool update);
|
||||||
|
|
||||||
RTCDevice rtc_device;
|
RTCDevice rtc_device;
|
||||||
enum RTCBuildQuality build_quality;
|
enum RTCBuildQuality build_quality;
|
||||||
|
35
intern/cycles/bvh/metal.h
Normal file
35
intern/cycles/bvh/metal.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __BVH_METAL_H__
|
||||||
|
#define __BVH_METAL_H__
|
||||||
|
|
||||||
|
#ifdef WITH_METAL
|
||||||
|
|
||||||
|
# include "bvh/bvh.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
BVH *bvh_metal_create(const BVHParams ¶ms,
|
||||||
|
const vector<Geometry *> &geometry,
|
||||||
|
const vector<Object *> &objects,
|
||||||
|
Device *device);
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
#endif /* WITH_METAL */
|
||||||
|
|
||||||
|
#endif /* __BVH_METAL_H__ */
|
33
intern/cycles/bvh/metal.mm
Normal file
33
intern/cycles/bvh/metal.mm
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef WITH_METAL
|
||||||
|
|
||||||
|
# include "device/metal/bvh.h"
|
||||||
|
|
||||||
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
BVH *bvh_metal_create(const BVHParams ¶ms,
|
||||||
|
const vector<Geometry *> &geometry,
|
||||||
|
const vector<Object *> &objects,
|
||||||
|
Device *device)
|
||||||
|
{
|
||||||
|
return new BVHMetal(params, geometry, objects, device);
|
||||||
|
}
|
||||||
|
|
||||||
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
#endif /* WITH_METAL */
|
@@ -83,6 +83,8 @@ class BVHParams {
|
|||||||
int max_motion_triangle_leaf_size;
|
int max_motion_triangle_leaf_size;
|
||||||
int max_curve_leaf_size;
|
int max_curve_leaf_size;
|
||||||
int max_motion_curve_leaf_size;
|
int max_motion_curve_leaf_size;
|
||||||
|
int max_point_leaf_size;
|
||||||
|
int max_motion_point_leaf_size;
|
||||||
|
|
||||||
/* object or mesh level bvh */
|
/* object or mesh level bvh */
|
||||||
bool top_level;
|
bool top_level;
|
||||||
@@ -95,16 +97,19 @@ class BVHParams {
|
|||||||
*/
|
*/
|
||||||
bool use_unaligned_nodes;
|
bool use_unaligned_nodes;
|
||||||
|
|
||||||
|
/* Use compact acceleration structure (Embree)*/
|
||||||
|
bool use_compact_structure;
|
||||||
|
|
||||||
/* Split time range to this number of steps and create leaf node for each
|
/* Split time range to this number of steps and create leaf node for each
|
||||||
* of this time steps.
|
* of this time steps.
|
||||||
*
|
*
|
||||||
* Speeds up rendering of motion curve primitives in the cost of higher
|
* Speeds up rendering of motion primitives in the cost of higher memory usage.
|
||||||
* memory usage.
|
|
||||||
*/
|
*/
|
||||||
int num_motion_curve_steps;
|
|
||||||
|
|
||||||
/* Same as above, but for triangle primitives. */
|
/* Same as above, but for triangle primitives. */
|
||||||
int num_motion_triangle_steps;
|
int num_motion_triangle_steps;
|
||||||
|
int num_motion_curve_steps;
|
||||||
|
int num_motion_point_steps;
|
||||||
|
|
||||||
/* Same as in SceneParams. */
|
/* Same as in SceneParams. */
|
||||||
int bvh_type;
|
int bvh_type;
|
||||||
@@ -132,6 +137,8 @@ class BVHParams {
|
|||||||
max_motion_triangle_leaf_size = 8;
|
max_motion_triangle_leaf_size = 8;
|
||||||
max_curve_leaf_size = 1;
|
max_curve_leaf_size = 1;
|
||||||
max_motion_curve_leaf_size = 4;
|
max_motion_curve_leaf_size = 4;
|
||||||
|
max_point_leaf_size = 8;
|
||||||
|
max_motion_point_leaf_size = 8;
|
||||||
|
|
||||||
top_level = false;
|
top_level = false;
|
||||||
bvh_layout = BVH_LAYOUT_BVH2;
|
bvh_layout = BVH_LAYOUT_BVH2;
|
||||||
@@ -139,6 +146,7 @@ class BVHParams {
|
|||||||
|
|
||||||
num_motion_curve_steps = 0;
|
num_motion_curve_steps = 0;
|
||||||
num_motion_triangle_steps = 0;
|
num_motion_triangle_steps = 0;
|
||||||
|
num_motion_point_steps = 0;
|
||||||
|
|
||||||
bvh_type = 0;
|
bvh_type = 0;
|
||||||
|
|
||||||
@@ -166,6 +174,12 @@ class BVHParams {
|
|||||||
return (size <= min_leaf_size || level >= MAX_DEPTH);
|
return (size <= min_leaf_size || level >= MAX_DEPTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool use_motion_steps()
|
||||||
|
{
|
||||||
|
return num_motion_curve_steps > 0 || num_motion_triangle_steps > 0 ||
|
||||||
|
num_motion_point_steps > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Gets best matching BVH.
|
/* Gets best matching BVH.
|
||||||
*
|
*
|
||||||
* If the requested layout is supported by the device, it will be used.
|
* If the requested layout is supported by the device, it will be used.
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "scene/hair.h"
|
#include "scene/hair.h"
|
||||||
#include "scene/mesh.h"
|
#include "scene/mesh.h"
|
||||||
#include "scene/object.h"
|
#include "scene/object.h"
|
||||||
|
#include "scene/pointcloud.h"
|
||||||
|
|
||||||
#include "util/algorithm.h"
|
#include "util/algorithm.h"
|
||||||
|
|
||||||
@@ -426,6 +427,32 @@ void BVHSpatialSplit::split_curve_primitive(const Hair *hair,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BVHSpatialSplit::split_point_primitive(const PointCloud *pointcloud,
|
||||||
|
const Transform *tfm,
|
||||||
|
int prim_index,
|
||||||
|
int dim,
|
||||||
|
float pos,
|
||||||
|
BoundBox &left_bounds,
|
||||||
|
BoundBox &right_bounds)
|
||||||
|
{
|
||||||
|
/* No real splitting support for points, assume they are small enough for it
|
||||||
|
* not to matter. */
|
||||||
|
float3 point = pointcloud->get_points()[prim_index];
|
||||||
|
|
||||||
|
if (tfm != NULL) {
|
||||||
|
point = transform_point(tfm, point);
|
||||||
|
}
|
||||||
|
point = get_unaligned_point(point);
|
||||||
|
|
||||||
|
if (point[dim] <= pos) {
|
||||||
|
left_bounds.grow(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (point[dim] >= pos) {
|
||||||
|
right_bounds.grow(point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BVHSpatialSplit::split_triangle_reference(const BVHReference &ref,
|
void BVHSpatialSplit::split_triangle_reference(const BVHReference &ref,
|
||||||
const Mesh *mesh,
|
const Mesh *mesh,
|
||||||
int dim,
|
int dim,
|
||||||
@@ -453,6 +480,16 @@ void BVHSpatialSplit::split_curve_reference(const BVHReference &ref,
|
|||||||
right_bounds);
|
right_bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BVHSpatialSplit::split_point_reference(const BVHReference &ref,
|
||||||
|
const PointCloud *pointcloud,
|
||||||
|
int dim,
|
||||||
|
float pos,
|
||||||
|
BoundBox &left_bounds,
|
||||||
|
BoundBox &right_bounds)
|
||||||
|
{
|
||||||
|
split_point_primitive(pointcloud, NULL, ref.prim_index(), dim, pos, left_bounds, right_bounds);
|
||||||
|
}
|
||||||
|
|
||||||
void BVHSpatialSplit::split_object_reference(
|
void BVHSpatialSplit::split_object_reference(
|
||||||
const Object *object, int dim, float pos, BoundBox &left_bounds, BoundBox &right_bounds)
|
const Object *object, int dim, float pos, BoundBox &left_bounds, BoundBox &right_bounds)
|
||||||
{
|
{
|
||||||
@@ -475,6 +512,13 @@ void BVHSpatialSplit::split_object_reference(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (geom->geometry_type == Geometry::POINTCLOUD) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
|
||||||
|
for (int point_idx = 0; point_idx < pointcloud->num_points(); ++point_idx) {
|
||||||
|
split_point_primitive(
|
||||||
|
pointcloud, &object->get_tfm(), point_idx, dim, pos, left_bounds, right_bounds);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BVHSpatialSplit::split_reference(const BVHBuild &builder,
|
void BVHSpatialSplit::split_reference(const BVHBuild &builder,
|
||||||
@@ -491,14 +535,18 @@ void BVHSpatialSplit::split_reference(const BVHBuild &builder,
|
|||||||
/* loop over vertices/edges. */
|
/* loop over vertices/edges. */
|
||||||
const Object *ob = builder.objects[ref.prim_object()];
|
const Object *ob = builder.objects[ref.prim_object()];
|
||||||
|
|
||||||
if (ref.prim_type() & PRIMITIVE_ALL_TRIANGLE) {
|
if (ref.prim_type() & PRIMITIVE_TRIANGLE) {
|
||||||
Mesh *mesh = static_cast<Mesh *>(ob->get_geometry());
|
Mesh *mesh = static_cast<Mesh *>(ob->get_geometry());
|
||||||
split_triangle_reference(ref, mesh, dim, pos, left_bounds, right_bounds);
|
split_triangle_reference(ref, mesh, dim, pos, left_bounds, right_bounds);
|
||||||
}
|
}
|
||||||
else if (ref.prim_type() & PRIMITIVE_ALL_CURVE) {
|
else if (ref.prim_type() & PRIMITIVE_CURVE) {
|
||||||
Hair *hair = static_cast<Hair *>(ob->get_geometry());
|
Hair *hair = static_cast<Hair *>(ob->get_geometry());
|
||||||
split_curve_reference(ref, hair, dim, pos, left_bounds, right_bounds);
|
split_curve_reference(ref, hair, dim, pos, left_bounds, right_bounds);
|
||||||
}
|
}
|
||||||
|
else if (ref.prim_type() & PRIMITIVE_POINT) {
|
||||||
|
PointCloud *pointcloud = static_cast<PointCloud *>(ob->get_geometry());
|
||||||
|
split_point_reference(ref, pointcloud, dim, pos, left_bounds, right_bounds);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
split_object_reference(ob, dim, pos, left_bounds, right_bounds);
|
split_object_reference(ob, dim, pos, left_bounds, right_bounds);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user